import FileServer from '../src/server/file-server'; import { FileProgress, TaskProgress, TaskStatus, UploadTaskOptions } from '../src/server/create-task/types'; /** * Upload Task Class * Coordinates file scanning, queue management, progress tracking and all upload-related functions */ export declare class UploadTask { private taskId; private taskName; private server; private options; private queue; private tracker; private status; private progressInterval?; private isServerEventAttached; private isLoggedIn; private pendingFiles; private pendingEmptyDirs; private hasReportedTaskStart; private isScanComplete; private scannedFileCount; private runtimeFiles; private serverCheckingFiles; private smallFileCompressor; private loginInfo?; private groupId?; private spaceId?; private inputFileCount; private primaryRootName; constructor(server: FileServer, files: FileList | File[] | DataTransferItemList, options: UploadTaskOptions, loginInfo?: { username: string; password: string; spaceId: number; authWay: number; isEncrypt: boolean; }, groupId?: number, spaceId?: number); /** * Calculate input file count */ private calculateInputFileCount; private isCompressionEnabled; private maybeCollectSmallFile; private finalizeSmallFileCompression; private enqueueScannedFiles; /** * Generate task name * Format: RaySync|1|20260209180747474250800 * Parts: first file/folder name | input count | timestamp */ private generateTaskName; /** * Start scanning files immediately (synchronous call) */ private start; /** * Check if input is FileList or File[] */ private isFileListOrArray; /** * Process FileList/Array directly without scanning * FileList already contains all file information with webkitRelativePath */ private processFileListDirectly; /** * Scan DataTransferItemList using FileScanner */ private scanDataTransferItems; /** * Perform login asynchronously */ private startLogin; /** * Process pending files and empty directories */ private processPendingFiles; /** * Create empty directory */ private createEmptyDirectory; /** * Process queue */ private processQueue; /** * Extract first level directory or file name * Example: folder/subfolder/file.txt -> folder * file.txt -> file.txt */ private extractFirstLevel; /** * Extract directory path from relative path * Example: folder/subfolder/file.txt -> folder/subfolder * file.txt -> '' */ private extractDirectory; /** * Check if file should be filtered */ private shouldFilterFile; /** * Upload single file */ private uploadFile; private handleBundleUploaded; /** * Attach server event listeners */ private attachServerEvents; /** * Start progress reporting */ private startProgressReporting; /** * Stop progress reporting */ private stopProgressReporting; /** * Report final progress immediately (after stopping timer) */ private reportFinalProgress; /** * Check if task is complete */ private taskIsAllDone; private checkCompletion; private handleError; /** * Report upload progress info */ private reportUploadProgress; /** * Close server connection */ private closeServerConnection; /** * Report connection info */ private isReportedConnectionInfo; private reportConnectionInfo; /** * Get platform information */ private getPlatform; /** * Report task start */ private reportTaskStart; /** * Report task completion */ private reportTaskCompletion; /** * Pause task */ pause(): void; /** * Resume task */ resume(): void; /** * Cancel task */ cancel(): void; /** * Get current progress */ getProgress(): TaskProgress; /** * Get task ID */ getTaskId(): number; /** * Get task status */ getStatus(): TaskStatus; /** * Get all file details */ getAllFiles(): FileProgress[]; /** * Get file detail by requestId */ getFile(requestId: number): FileProgress | undefined; /** * Generate task ID */ private generateTaskId; }