/**
 * This file is part of the NocoBase (R) project.
 * Copyright (c) 2020-2024 NocoBase Co., Ltd.
 * Authors: NocoBase Team.
 *
 * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
 * For more information, please refer to: https://www.nocobase.com/agreement.
 */
import { UploadFile } from 'antd/es/upload/interface';
import React from 'react';
import type { IUploadProps, UploadProps } from './type';
export declare const FILE_SIZE_LIMIT_DEFAULT: number;
export interface FileModel {
    id: number;
    filename: string;
    path: string;
    title: string;
    url: string;
    extname: string;
    size: number;
    mimetype: string;
}
export interface PreviewerProps {
    index: number;
    list: FileModel[];
    onSwitchIndex(index: any): void;
}
export interface AttachmentFileType {
    match(file: any): boolean;
    getThumbnailURL?(file: any): string;
    ThumbnailPreviewer?: React.ComponentType<{
        file: FileModel;
    }>;
    Previewer?: React.ComponentType<PreviewerProps>;
}
export declare class AttachmentFileTypes {
    types: AttachmentFileType[];
    add(type: AttachmentFileType): void;
    getTypeByFile(file: any): Omit<AttachmentFileType, 'match'>;
}
/**
 * @experimental
 */
export declare const attachmentFileTypes: AttachmentFileTypes;
export declare function matchMimetype(file: FileModel | UploadFile<any>, type: string): any;
export declare function getThumbnailPlaceholderURL(file: any, options?: any): any;
export declare function getResponseMessage({ error, response }: UploadFile<any>): any;
export declare function normalizeFile(file: UploadFile & Record<string, any>): {
    title: string;
    response: any;
    uid: string;
    size?: number;
    name: string;
    fileName?: string;
    lastModified?: number;
    lastModifiedDate?: Date;
    url?: string;
    status?: import("antd/es/upload/interface").UploadFileStatus;
    percent?: number;
    thumbUrl?: string;
    crossOrigin?: "" | "anonymous" | "use-credentials";
    originFileObj?: import("antd/es/upload/interface").RcFile;
    error?: any;
    linkProps?: any;
    type?: string;
    xhr?: any;
    preview?: string;
    "aria-label"?: string;
    "aria-labelledby"?: string;
};
export declare function useUploadProps<T extends IUploadProps = UploadProps>(props: T): {
    customRequest({ action, data, file, filename, headers, onError, onProgress, onSuccess, withCredentials }: {
        action: any;
        data: any;
        file: any;
        filename: any;
        headers: any;
        onError: any;
        onProgress: any;
        onSuccess: any;
        withCredentials: any;
    }): {
        abort(): void;
    };
} & T;
export declare function toValueItem(data: any): any;
export declare const toItem: (file: any) => any;
export declare const toFileList: (fileList: any) => any[];
export declare function validate(file: any, rules: Record<string, any>): string;
export declare function useBeforeUpload(rules: any): (file: any, fileList: any) => false | Promise<any>;
