/** * 列表数据 */ export interface ItemType { uid: string | number; url?: string; name?: string; status?: StatusType; progress?: number; file?: File; } /** * 上传状态 */ export type StatusType = 'uploading' | 'done' | 'exception' | null; /** * 上传文件之前的钩子类型 */ export type BeforeUploadType = (file: File) => boolean | undefined | Promise; /** * 删除文件之前的钩子类型 */ export type BeforeRemoveType = (item: ItemType) => boolean | undefined | Promise; /** * 自定义上传方法类型 */ export type UploadHandlerType = (file: File) => void; /** * 自定义删除方法类型 */ export type RemoveHandlerType = (item: ItemType) => void; /** * 国际化语言文件类型 */ export interface UploadLocal { uploading: string; exception: string; retry: string; }