import { UploadConfig } from '../config-provider/type';
import { TNode } from '../common';
export interface TdUploadProps {
    accept?: string;
    action?: string;
    allowUploadDuplicateFile?: boolean;
    autoUpload?: boolean;
    beforeUpload?: (file: File | UploadFile) => boolean | Promise<boolean>;
    data?: Record<string, any> | ((file: File) => Record<string, any>);
    default?: string | TNode;
    disabled?: boolean;
    draggable?: boolean;
    fileListDisplay?: TNode;
    files?: Array<UploadFile>;
    defaultFiles?: Array<UploadFile>;
    format?: (file: File) => UploadFile;
    formatResponse?: (response: any, context: FormatResponseContext) => ResponseType;
    headers?: {
        [key: string]: string;
    };
    isBatchUpload?: boolean;
    locale?: UploadConfig;
    max?: number;
    method?: 'POST' | 'GET' | 'PUT' | 'OPTION' | 'PATCH' | 'post' | 'get' | 'put' | 'option' | 'patch';
    multiple?: boolean;
    name?: string;
    placeholder?: string;
    requestMethod?: (files: UploadFile | UploadFile[]) => Promise<RequestMethodResponse>;
    showUploadProgress?: boolean;
    sizeLimit?: number | SizeLimitObj;
    theme?: 'custom' | 'file' | 'file-input' | 'file-flow' | 'image' | 'image-flow';
    tips?: string;
    trigger?: string | TNode<TriggerContext>;
    uploadAllFilesInOneRequest?: boolean;
    useMockProgress?: boolean;
    withCredentials?: boolean;
    onCancelUpload?: () => void;
    onChange?: (value: Array<UploadFile>, context: UploadChangeContext) => void;
    onDragenter?: (context: {
        e: DragEvent;
    }) => void;
    onDragleave?: (context: {
        e: DragEvent;
    }) => void;
    onDrop?: (context: {
        e: DragEvent;
    }) => void;
    onFail?: (options: {
        e: ProgressEvent;
        file: UploadFile;
    }) => void;
    onPreview?: (options: {
        file: UploadFile;
        e: MouseEvent;
    }) => void;
    onProgress?: (options: ProgressContext) => void;
    onRemove?: (context: UploadRemoveContext) => void;
    onSelectChange?: (files: Array<UploadFile>) => void;
    onSuccess?: (context: SuccessContext) => void;
}
export interface UploadFile {
    lastModified?: number;
    name?: string;
    percent?: number;
    raw?: File;
    response?: object;
    size?: number;
    status?: 'success' | 'fail' | 'progress' | 'waiting';
    type?: string;
    url?: string;
}
export declare type ResponseType = {
    error?: string;
    url?: string;
} & Record<string, any>;
export interface FormatResponseContext {
    file: UploadFile;
    currentFiles?: UploadFile[];
}
export interface RequestMethodResponse {
    status: 'success' | 'fail';
    error?: string;
    response: {
        url?: string;
        [key: string]: any;
    };
}
export interface SizeLimitObj {
    size: number;
    unit: SizeUnit;
    message?: string;
}
export declare type SizeUnitArray = ['B', 'KB', 'MB', 'GB'];
export declare type SizeUnit = SizeUnitArray[number];
export interface TriggerContext {
    dragActive?: boolean;
    uploadingFile?: UploadFile | Array<UploadFile>;
}
export interface UploadChangeContext {
    e?: MouseEvent | ProgressEvent;
    response?: any;
    trigger: string;
    index?: number;
    file?: UploadFile;
}
export interface ProgressContext {
    e?: ProgressEvent;
    file: UploadFile;
    percent: number;
    type: UploadProgressType;
}
export declare type UploadProgressType = 'real' | 'mock';
export interface UploadRemoveContext {
    index?: number;
    file?: UploadFile;
    e: MouseEvent;
}
export interface SuccessContext {
    e?: ProgressEvent;
    file?: UploadFile;
    fileList?: UploadFile[];
    response: any;
}
