icebox/dist/upload/index.d.ts

20 lines
612 B
TypeScript

interface S3Config {
region: string;
bucketName: string;
expirationSeconds: number;
}
interface UploadResult {
success: boolean;
url?: string;
key?: string;
error?: string;
}
/**
* Uploads a file to S3 and returns a private, time-limited URL to access it
* @param filePath - Absolute or relative path to the file to upload
* @param config - S3 configuration parameters
* @returns Promise containing the result with URL if successful
*/
export declare function upload(id: string, filePath: string, config: S3Config): Promise<UploadResult>;
export type { UploadResult, S3Config };