import { ComponentPropsWithoutRef } from 'react'; import { DragEvents } from '../../hooks/useDrag/interface'; export interface UploadFileRequestConfig { endpoint: string; timeout?: number; responseType?: XMLHttpRequestResponseType; withCredentials?: boolean; headers?: { [key: string]: any; }; params?: { [key: string]: any; }; formDataFileKey?: string; formDataParams?: { key: string; value: string | Blob; fileName?: string; }[]; auth?: { username: string; password: string; }; } export interface UploadParameters { file: File; fieldName: string; requestConfig: UploadFileRequestConfig; onProgress?: (progress: number, success?: boolean, response?: any) => void; onFail?: () => void; } export declare type FileItem = { file: File; fileName: string; fileSize: string; id: string; uploadLoaded?: string; uploadPercentage?: string; uploadCompleted?: boolean; uploadError?: boolean; uploadResponse?: any; }; export declare type FileItemProps = { removeFile(id: string): void; disabled?: boolean; readOnly?: boolean; } & FileItem; export declare type UploadCardRef = { submit(config?: UploadFileRequestConfig): Promise; removeFile(id: string): void; removeAll(): void; addFiles(file: File | File[]): void; files: FileItem[]; }; declare type CustomButtonProps = { isDragging?: boolean; openFileDialog: () => void; files: FileItem[]; isSubmitting?: boolean; }; export declare type FileActionType = 'ADD_INITIAL_FILES' | 'ADD' | 'REMOVE' | 'REPLACE' | 'UPDATE' | 'RESET'; export declare type UploadCardOnChangeValue = { files: FileItem[]; type: FileActionType; payload?: FileItem | FileItem[]; }; declare type NativeInputFileProps = ComponentPropsWithoutRef<'input'>; export interface UploadCardProps extends Omit { name?: string; accept: string[]; compact?: boolean; maxSize?: number; disabled?: boolean; readOnly?: boolean; singleFile?: boolean; acceptLabel?: string; buttonText?: string; initialFiles?: File | File[]; uploadConfig?: UploadFileRequestConfig; onChange?: (value: UploadCardOnChangeValue) => void; onUnsupportedFile?: (files: File[]) => void; onMaxSizeExceed?: (files: File[]) => void; customButton?: (p: CustomButtonProps) => React.ReactNode; } export declare type VariantProps = { removeFile: (id: string) => void; openFileDialogButton: React.ReactNode; events?: DragEvents; inputFile: React.ReactNode; } & UploadCardProps & CustomButtonProps; export declare type VariantPropsStyle = { active?: boolean; disabled?: boolean; readOnly?: boolean; }; export interface useFileStateOptions { accept: UploadCardProps['accept']; maxSize?: UploadCardProps['maxSize']; singleFile?: UploadCardProps['singleFile']; onChange?: UploadCardProps['onChange']; onMaxSizeExceed?: UploadCardProps['onMaxSizeExceed']; onUnsupportedFile?: UploadCardProps['onUnsupportedFile']; } export declare type FilterFilesReturnType = { fileList: File[]; maxSizeExceededFiles: File[]; unSupportedFiles: File[]; }; export {};