UNPKG

magic-design

Version:
30 lines (29 loc) 852 B
export declare type FileStatus = 'init' | 'pending' | 'error' | 'done'; export declare type ListType = 'text' | 'img' | 'text-card' | 'img-card'; export interface FileItem { name: string; id?: string; file?: File; url?: string; status?: FileStatus; percent?: number; response?: any; } export interface RequestOption { action: string; } export interface UploadRequestOptions { method: string; url: string; fileItem: FileItem; name: string | ((fileItem: FileItem) => string); onSuccess?: Function; onError?: Function; onProgress?: Function; } export declare type UploadRequest = (options: UploadRequestOptions) => Promise<any>; export interface UploaderProvideContext { removeFileById: (id: string) => void; chooseFile: () => void; disabled: boolean; }