import { ComponentSize } from '../../../xiaoye-primitives/index.js';
export type UploadStatus = "ready" | "uploading" | "success" | "fail";
export type Awaitable<T> = T | Promise<T>;
export type UploadListType = "text" | "picture" | "picture-card";
export interface UploadRawFile extends File {
    uid: string;
}
export interface UploadFileItem {
    uid: string;
    name: string;
    size: number;
    type?: string;
    status?: UploadStatus;
    percentage?: number;
    response?: unknown;
    url?: string;
    raw?: UploadRawFile;
}
export interface UploadProgressEvent extends ProgressEvent {
    percent: number;
}
export interface UploadRequestOptions {
    action: string;
    method: string;
    data: Record<string, unknown>;
    filename: string;
    file: UploadRawFile;
    headers: Record<string, string | number | boolean | null | undefined>;
    withCredentials: boolean;
    onProgress: (event: UploadProgressEvent) => void;
    onSuccess: (response: unknown) => void;
    onError: (error: Error) => void;
}
export interface UploadRemoveOptions {
    skipBeforeRemove?: boolean;
    emitRemove?: boolean;
}
export type UploadRequestHandler = (options: UploadRequestOptions) => XMLHttpRequest | Promise<unknown> | void;
export interface UploadProps {
    fileList?: UploadFileItem[];
    action?: string;
    headers?: Record<string, string | number | boolean | null | undefined>;
    method?: string;
    data?: Awaitable<Record<string, unknown>> | ((file: UploadRawFile) => Awaitable<Record<string, unknown>>);
    name?: string;
    accept?: string;
    multiple?: boolean;
    limit?: number;
    disabled?: boolean;
    drag?: boolean;
    directory?: boolean;
    paste?: boolean;
    tip?: string;
    size?: ComponentSize;
    autoUpload?: boolean;
    showFileList?: boolean;
    withCredentials?: boolean;
    listType?: UploadListType;
    beforeUpload?: (file: UploadRawFile) => Awaitable<boolean | void | null | undefined | File | Blob>;
    beforeRemove?: (file: UploadFileItem, files: UploadFileItem[]) => Awaitable<boolean>;
    onRemove?: (file: UploadFileItem, files: UploadFileItem[]) => void;
    onChange?: (file: UploadFileItem, files: UploadFileItem[]) => void;
    onPreview?: (file: UploadFileItem) => void;
    previewFile?: (file: UploadFileItem) => Awaitable<string | undefined>;
    onSuccess?: (response: unknown, file: UploadFileItem, files: UploadFileItem[]) => void;
    onProgress?: (event: UploadProgressEvent, file: UploadFileItem, files: UploadFileItem[]) => void;
    onError?: (error: Error, file: UploadFileItem, files: UploadFileItem[]) => void;
    onExceed?: (files: File[], filesList: UploadFileItem[]) => void;
    httpRequest?: UploadRequestHandler;
}
export type UploadInstance = any;
export declare function genFileId(): string;
export declare function ajaxUpload(options: UploadRequestOptions): XMLHttpRequest | Promise<unknown>;
