UNPKG

sailboat-design

Version:
46 lines (45 loc) 1.27 kB
/// <reference types="react" /> import { ThemeProps } from '../Icon/icon'; export declare type UploadFileStatus = 'ready' | 'uploading' | 'success' | 'error'; export interface UploadFile { uid: string; size: number; name: string; status?: UploadFileStatus; percent: number; raw?: File; response?: any; error?: any; } export interface UploadProps { children?: React.ReactNode; action: string; beforeUpload?: (file: File) => boolean | Promise<File>; onProgress?: (percentage: number, file: UploadFile) => void; onSuccess?: (data: any, file: UploadFile) => void; onError?: (err: any, file: UploadFile) => void; onChange?: (file: UploadFile) => void; onRemove?: (file: UploadFile) => void; onPreview?: (file: UploadFile) => void; theme?: ThemeProps; headers?: { [key: string]: any; }; name?: string; data?: { [key: string]: any; }; withCredentials?: boolean; accept?: string; multiple?: boolean; dragger?: boolean; } export declare const Upload: { (props: UploadProps): JSX.Element; defaultProps: { name: string; btnText: string; theme: string; }; }; export default Upload;