UNPKG

epn-ui

Version:

Дизайн система кабинета ВМ

50 lines (49 loc) 1.69 kB
/// <reference types="react" /> import type { UploadFile } from 'antd/es/upload/interface'; import type { UploadProps } from 'antd/es/upload'; export interface UploadCustomRequest<T> { onProgress?: (event: { percent: number; }) => void; onError?: (event: Error, body?: T) => void; onSuccess?: (body: T, xhr?: XMLHttpRequest) => void; data: T; filename: string; file: File; withCredentials: boolean; action: string; headers: { [key: string]: string; }; } interface UploadCommonProps { accept?: UploadProps['accept']; maxCount?: UploadProps['maxCount']; multiple?: UploadProps['multiple']; action?: UploadProps['action']; disabled?: UploadProps['disabled']; className?: UploadProps['className']; fileListDir?: 'vertical' | 'horizontal'; children: React.ReactNode; onChange?: UploadProps['onChange']; customRequest?: UploadProps['customRequest']; beforeUpload?: UploadProps['beforeUpload']; onDrop?: UploadProps['onDrop']; } declare type UploadRenderProps = { showUploadList?: true; renderItem: (originNode: React.ReactNode, file: UploadFile, fileList: UploadFile[], actions: { download: () => void; preview: () => void; remove: () => void; }) => React.ReactNode; } | { showUploadList?: false; renderItem?: (originNode: React.ReactNode, file: UploadFile, fileList: UploadFile[], actions: { download: () => void; preview: () => void; remove: () => void; }) => React.ReactNode; }; export declare type BaseUploadProps = UploadCommonProps & UploadRenderProps; export {};