import React from 'react'; export interface ImportProps { action: string; data?: any; type: string; title?: string; accept?: string; footer?: React.ReactNode; onSuccess?: () => void; condition?: { [key: string]: any; }; } export interface ImportMethods { show(): void; } export declare type ProgressDesc = { status: 'cancelled' | 'fail' | 'executing'; message?: string; progress: number; taskResult?: any; } | { status: 'success'; message?: string; progress: number; taskResult?: { summary: string; }; }; export interface ImporterOptions { /** * 获取上传地址 */ getAction: () => string; /** * 上传响应中获取taskId */ handleStart?: (response: any, data: any) => Promise; /** * 获取导入进度 */ getProgress: (taskId: string) => Promise; } /** * 创建一个导入器 */ export default function createImporter(options: ImporterOptions): { Import: React.MemoExoticComponent>>; useImport: (hooksOptions: { accept?: string | undefined; type: string; template?: React.ReactNode; data?: any; onSuccess?: (() => void) | undefined; condition?: any; }) => { open: () => void; props: { accept?: string | undefined; type: string; data?: any; onSuccess?: (() => void) | undefined; condition?: any; ref: React.RefObject; action: string; footer: false | {} | "" | 0 | null | undefined; }; }; };