export declare const validImageFormats: string[]; export declare const validDocumentFormats: string[]; export interface R2UploadData { key: string; bucket: string; contentType: string; size: number; eTag: string; url: string; } export interface R2PresignedUploadUrlRequest { fileName: string; contentType: string; folder?: string; expiresInSeconds?: number; } export interface R2PresignedUploadUrlData { uploadUrl: string; key: string; bucket: string; contentType: string; expiresInSeconds: number; expiresAt: string; publicUrl: string; } export interface R2PresignedUploadOptions { fileName?: string; contentType?: string; folder?: string; expiresInSeconds?: number; } export interface R2PresignedUploadResult { message: string; success: boolean; url?: string; data?: R2PresignedUploadUrlData; eTag?: string | null; } export interface UploadResponse { message: string; success: boolean; data?: T; } type UploadFileParam = Blob & { name?: string; type?: string; uri?: string; }; /** * Generic method to upload file or image * @param file File * @returns Promise<{message: string, success: boolean, url?: string}> */ export declare function uploadAttachment(file: File, token?: string): Promise<{ message: string; success: boolean; url?: string; }>; /** * Method to upload a file or image to R2 storage. * @param body FormData. Append the file under the "file" key. * @param token string? * @returns UploadResponse | null */ export declare function uploadR2Storage(body: FormData, token?: string): Promise | null>; /** * Method to request an R2 pre-signed upload URL from the backend. * @param body Request metadata for the file to upload. * @param token string? * @returns UploadResponse | null */ export declare function getR2PresignedUploadUrl(body: R2PresignedUploadUrlRequest, token?: string): Promise | null>; /** * Method to upload a file body to a pre-signed R2 URL. * @param uploadUrl URL returned by getR2PresignedUploadUrl * @param file Blob/File, raw body, or compatible file-like object * @param contentType Must match the contentType used when creating the signed URL. * @returns Response from R2 */ export declare function uploadToR2PresignedUrl(uploadUrl: string, file: UploadFileParam | Blob | BodyInit | any, contentType: string): Promise; /** * Full R2 pre-signed upload workflow: create URL, PUT file to R2, return public URL. * @param file Blob/File, raw body, or compatible file-like object * @param options Optional fileName/contentType/folder/expiresInSeconds overrides. * @param token string? * @returns R2PresignedUploadResult */ export declare function uploadWithR2PresignedUrl(file: UploadFileParam | Blob | BodyInit | any, options?: R2PresignedUploadOptions, token?: string): Promise; /** * Method to upload image to server * @param body FormData * @param token string? * @returns JSON | string | null */ export declare function uploadImage(body: FormData, token?: string): Promise; /** * Method to upload image to server * @param body FormData * @param token string? * @returns JSON | string | null */ export declare function uploadImageV2(body: FormData, token?: string): Promise | null>; /** * Method to upload file to server * @param body FormData * @param token string? * @returns JSON | string | null */ export declare function uploadFile(body: FormData, token?: string): Promise | null>; export declare function getUploadFileLimit(): Promise<{}>; export {};