UNPKG

@statezero/core

Version:

The type-safe frontend client for StateZero - connect directly to your backend models with zero boilerplate

63 lines (62 loc) 1.86 kB
/** * FileObject - A file wrapper that handles uploads to StateZero backend */ export class FileObject { static configKey: string; static MIN_CHUNK_SIZE: number; constructor(file: any, options?: {}); name: any; size: any; type: any; lastModified: number | null; uploaded: boolean; uploading: boolean; uploadResult: any; uploadError: any; fileData: any; uploadType: string | null; uploadId: any; totalChunks: number; completedChunks: number; chunkSize: any; maxConcurrency: any; uploadPromise: any; get isStoredFile(): any; get status(): "failed" | "uploading" | "uploaded" | "pending"; get filePath(): any; get fileUrl(): any; _initializeAndStartUpload(file: any, options: any): any; /** * Fast upload using S3 presigned URLs with multipart support */ _fastUpload(file: any, options?: {}): any; /** * Handle single file upload */ _singleUpload(file: any, uploadData: any, options: any): Promise<any>; /** * Handle multipart upload with concurrency using p-queue */ _multipartUpload(file: any, uploadData: any, options: any): Promise<any>; /** * Create file chunks for multipart upload */ _createFileChunks(file: any): any[]; /** * Complete the upload (both single and multipart) */ _completeUpload(filePath: any, originalName: any, uploadId?: null, parts?: null): Promise<any>; /** * Direct upload to Django backend (original method) */ _directUpload(options?: {}): Promise<any>; /** * Reads the file content into an ArrayBuffer (for direct uploads only) */ _readFileData(file: any): Promise<void>; /** * Gets the file data as a Blob (for direct uploads only) */ getBlob(): Blob; waitForUpload(): Promise<any>; }