import React from 'react'; import { ExportScope } from './index'; export interface ExportMethods { show(): void; } export { ExportScope }; export interface ExportProps { onStart: (scope: ExportScope) => Promise; title?: string; onSuccess?: () => {}; showScope?: boolean; initialScope?: ExportScope; allText?: string; footer?: React.ReactNode; currentText?: string; fileName?: string; } /** * 进度描述对象 */ export declare type ProgressDesc = { message?: string; progress: number; status: 'cancelled' | 'fail' | 'executing'; taskResult?: any; } | { status: 'success'; message?: string; progress: number; taskResult: { fileId: string; }; }; export interface ExporterOptions { /** * 请求导出,返回一个taskId */ handleStart: (params: any) => Promise; /** * 获取进度 */ getProgress: (taskId: string) => Promise; /** * 获取下载链接 */ getDownloadUrl: (fileId: string, fileName?: string) => string; } /** * 创建导出器 */ export default function createExporter(options: ExporterOptions): { Export: React.MemoExoticComponent>>; useExport: (hooksOptions: { type: string; condition?: ((scope: ExportScope) => T) | undefined; data?: any; } & Pick) => { open: () => void; props: { footer?: React.ReactNode; title?: string | undefined; onSuccess?: (() => {}) | undefined; showScope?: boolean | undefined; initialScope?: ExportScope | undefined; allText?: string | undefined; currentText?: string | undefined; fileName?: string | undefined; ref: React.RefObject; onStart: (scope: ExportScope) => Promise; }; }; };