import { TNode } from '../common';
export interface TdUploadProps {
    accept?: string;
    action?: string;
    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;
    files?: Array<UploadFile>;
    defaultFiles?: Array<UploadFile>;
    format?: (file: File) => UploadFile;
    formatResponse?: (response: any, context: FormatResponseContext) => ResponseType;
    headers?: {
        [key: string]: string;
    };
    max?: number;
    method?: 'POST' | 'GET' | 'PUT' | 'OPTION';
    multiple?: boolean;
    name?: string;
    placeholder?: string;
    requestMethod?: (files: UploadFile) => Promise<RequestMethodResponse>;
    showUploadProgress?: boolean;
    sizeLimit?: number | SizeLimitObj;
    theme?: 'custom' | 'file' | 'file-input' | 'file-flow' | 'image' | 'image-flow';
    tips?: string;
    trigger?: string | TNode<TriggerContext>;
    useMockProgress?: boolean;
    withCredentials?: boolean;
    onCancelUpload?: () => void;
    onChange?: (value: Array<UploadFile>, context: UploadChangeContext) => void;
    onDragenter?: (context: {
        e: DragEvent;
    }) => void;
    onDragleave?: (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;
    onSuccess?: (context: SuccessContext) => void;
}
export interface UploadFile extends File {
    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;
}
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 SizeUnit = 'B' | 'KB' | 'MB' | 'GB';
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;
}
