UNPKG

@aplus-frontend/ui

Version:

32 lines (31 loc) 1.25 kB
import { accessCreate } from '@aplus-frontend/oss'; import { VNodeChild } from 'vue'; import { UploadFile, UploadChangeParam, UploadProps } from '@aplus-frontend/antdv'; export type ApUploadGetOssAccess = () => Promise<accessCreate>; type Parameters<T extends (...args: any) => any> = T extends (...args: infer P) => any ? P : never; export type ApUploadFile<T = any> = UploadFile<T> & { ossDestroy?: () => any; [key: string | number | symbol]: any; }; export type ApUploadCustomRequest = (option: Omit<Parameters<Exclude<UploadProps['customRequest'], undefined>>[0], 'file'> & { file?: ApUploadFile; }, props?: { dirName?: string; }) => void; export type ApUploadBaseProps<T = any> = { dirName: string; getOssAccess?: ApUploadGetOssAccess; fileList?: ApUploadFile<T>[]; onChange?: (info?: UploadChangeParam<ApUploadFile<T>>) => void; maxSize?: number; accept?: string; beforeUpload?: (file: ApUploadFile<T>, fileList: ApUploadFile<T>[]) => boolean | Promise<boolean>; customRequest?: ApUploadCustomRequest; maxSizeErrorMsg?: string; acceptErrorMsg?: string; }; export type ApUploadSingleProps<T = any> = ApUploadBaseProps<T> & { title?: VNodeChild; subTitle?: VNodeChild; }; export {};