/** * Interface defining the properties for the FileUploader component. */ export interface FileUploaderProps { /** * Accepted file types (e.g., "image/*, .pdf"). * Passed directly to react-dropzone's `accept` prop. */ accept?: Record | string; /** * Maximum file size in bytes. */ maxSize?: number; /** * Allow multiple file selection. * @default true */ multiple?: boolean; /** * Function to handle file upload. * Should return a Promise that resolves with the file URL or object. * @param file The file to upload. * @param onProgress Callback to report upload progress (0-100). */ uploadFunction: (file: File, onProgress: (progress: number) => void) => Promise; /** * Optional initial files to display (useful for edit mode). */ initialFiles?: Array<{ id: string; url: string; name: string; size?: number; type?: string; }>; /** * Visual variant of the uploader. * @default 'dropzone' */ variant?: 'dropzone' | 'button' | 'minimal'; /** * Label text for the dropzone. * @default 'Arrastra y suelta archivos aquĆ­' */ label?: string; /** * Text for the dropzone sub-label. * @default 'o haz clic para explorar' */ subLabel?: string; /** * Callback when files are added/removed/uploaded. * Useful for parent form state management. */ onFilesChange?: (files: UploadedFile[]) => void; /** * Custom class name for the container. */ className?: string; /** * Whether the uploader is disabled. */ disabled?: boolean; /** * Whether to upload files immediately after selection. * @default true */ autoUpload?: boolean; /** * Custom error messages for validation errors. * Keys are react-dropzone error codes (e.g. 'file-invalid-type', 'file-too-large'). */ errorMessages?: Record; /** * Dictionary for internationalization (i18n) of hardcoded texts. */ dictionary?: { hasErrors?: string; uploadFailed?: string; uploadPendingButton?: string; uploadingCancel?: string; remove?: string; errorUploading?: string; retryTooltip?: string; }; /** * Whether to show allowed extensions and max size hint. * @default true */ showValidationHints?: boolean; /** * Custom icon to display in the dropzone area. * Replaces the default CloudArrowUpIcon. */ icon?: React.ReactNode; /** * Custom classNames to override internal structural styling. */ classNames?: { dropzoneActive?: string; dropzoneInactive?: string; submitButton?: string; }; } /** * Internal state representation of a file in the uploader. */ export interface UploadedFile { id: string; file?: File; name: string; size?: number; type?: string; status: 'pending' | 'uploading' | 'completed' | 'error'; progress: number; url?: string; error?: string; preview?: string; abortController?: AbortController; } //# sourceMappingURL=FileUploader.types.d.ts.map