export declare const FileStatus: { readonly PENDING: "pending"; readonly PROCESSING: "processing"; readonly SUCCESS: "success"; readonly ERROR: "error"; }; export type FileStatusType = (typeof FileStatus)[keyof typeof FileStatus]; export type FileItem = { id: string; file: File; name: string; size: number; type: string; status: FileStatusType; progress: number; error: string | null; lastModified: number; preview: string | null; result?: unknown; }; export type ProgressContext = { onProgress: (progress: number) => void; }; export type FileHandlerCallbacks = { /** Called when a file needs to be processed (e.g., uploaded) */ onProcess?: (file: FileItem, context: ProgressContext) => Promise; /** Called when an error occurs during any operation */ onError?: (error: string, file?: FileItem) => void; /** Called when a file is successfully processed */ onSuccess?: (file: FileItem, result?: unknown) => void; /** Called when progress changes during processing */ onProgress?: (file: FileItem, progress: number) => void; /** Called when files are added to the collection */ onFileAdd?: (files: FileItem[]) => void; /** Called when a file is removed from the collection */ onFileRemove?: (file: FileItem) => void; }; export type FileValidator = (file: File) => string | null; export type FileTransformer = (baseFile: FileItem) => FileItem; export type FileHandlerOptions = { /** Maximum number of files allowed */ maxFiles?: number; /** Maximum file size in bytes */ maxFileSize?: number; /** Array of accepted MIME types */ acceptedTypes?: string[]; /** Allow multiple file selection */ multiple?: boolean; /** Automatically process files when added */ autoProcess?: boolean; /** Custom file validation function */ validator?: FileValidator; /** Custom file transformation function */ transformer?: FileTransformer; } & FileHandlerCallbacks; export type FileStats = { total: number; pending: number; processing: number; success: number; error: number; isProcessing: boolean; }; export type FileHandlerReturn = { files: FileItem[]; isDragging: boolean; stats: FileStats; addFiles: (newFiles: FileList | File[]) => Promise; removeFile: (fileId: string) => void; clearFiles: () => void; retryFile: (fileId: string) => Promise; processFile: (fileItem: FileItem) => Promise; processAllFiles: () => Promise; getFilesByStatus: (status: FileStatusType) => FileItem[]; validateFile: (file: File) => string | null; transformFile: (file: File) => FileItem; setIsDragging: (isDragging: boolean) => void; }; /** * Comprehensive hook for handling file operations including upload, validation, and processing * @param options - Configuration options and callback functions * @returns Object containing file state, actions, and utilities */ export declare const useFileHandler: (options?: FileHandlerOptions) => FileHandlerReturn; //# sourceMappingURL=useFileHandler.d.ts.map