import { CdsProgress } from '../CdsProgress'; import { ComponentProps } from '../../utils'; import { ImgHTMLAttributes, VNode } from 'vue'; export declare namespace NUploader { type TBeforeUploadFileType = File | Blob | boolean | string; type TAction = string | ((file: IRcFile) => string | PromiseLike); type TUploadRequestMethod = 'POST' | 'PUT' | 'PATCH' | 'post' | 'put' | 'patch'; type TUploadRequestHeaders = Record; type TUploadFileStatus = 'error' | 'success' | 'done' | 'uploading' | 'removed'; type TUploadListType = 'text' | 'picture' | 'picture-card'; type TPreviewFileHandler = (file: IFileType | Blob) => PromiseLike; type TUploadListProgressProps = ComponentProps; type TItemRender = (options: { originNode: VNode; file?: IUploadFile; fileList?: IUploadFile[]; actions: { download?: () => void; preview?: () => void; remove?: () => void; }; }) => VNode; interface IRcFile extends File { uid: string; } interface IUploadRequestError extends Error { status?: number; method?: TUploadRequestMethod; url?: string; } interface IUploadProgressEvent extends Partial { percent?: number; } interface IUploadRequestOption { data?: Record | null; filename?: string; file: Exclude | IRcFile | null; withCredentials?: boolean; action?: string | null; headers?: TUploadRequestHeaders; method?: TUploadRequestMethod; onProgress?: (event: IUploadProgressEvent) => void; onError?: (event: IUploadRequestError | ProgressEvent, body?: T) => void; onSuccess?: (body: T, xhr?: XMLHttpRequest) => void; } interface IFileType extends IRcFile { readonly lastModifiedDate: Date; } interface IParsedFile { origin: IRcFile; action?: string | null; data?: Record | null; parsedFile: IRcFile | null; } interface IUploadFile { uid: string; size?: number; name: string; fileName?: string; lastModified?: number; lastModifiedDate?: Date; url?: string; status?: TUploadFileStatus; percent?: number; thumbUrl?: string; crossOrigin?: ImgHTMLAttributes['crossorigin']; originFileObj?: File; response?: T; error?: any; linkProps?: any; type?: string; xhr?: T; preview?: string; } interface IInternalUploadFile extends IUploadFile { originFileObj: IFileType; } interface IUploadChangeParam { file: T; fileList: T[]; event?: { percent: number; }; } interface TShowUploadList { showRemoveIcon?: boolean; showPreviewIcon?: boolean; showDownloadIcon?: boolean; } interface ILocale { uploading?: string; uploadFile?: string; downloadFile?: string; removeFile?: string; uploadError?: string; previewFile?: string; } }