import React from 'react'; import { FileSaverOptions } from 'file-saver'; import './index.less'; /** * @param fieldKey websocket传输信息下载url的key 默认fileUrl * @param fileName 下载文件名 默认为url 最后一个‘/’后的名 * @param fileSaverOptions */ interface DownloadProps { fieldKey?: string; fileName?: string; fileSaverOptions?: FileSaverOptions; } interface Props { handleMessage?: (messageData: any) => void | boolean; /** 当回调返回true时代表websocket任务完成 */ percentKey?: string; /** 在websocket 信息中进程属性的key 默认为 process */ downloadInfo?: { url: string | null; timeLine?: any; createDate?: string; lastUpdateDate?: string; timeFormat?: string; /** 默认时间解析格式 YYYY-MM-DD HH:mm:ss */ children?: React.ReactElement; } | null; renderEndProgress?: (messageData: any) => React.ReactElement | React.ReactElement[] | null | string; visible?: boolean; /** 可控类型 控制进度条是否显示 */ messageKey: string; className?: string; predefineProgressTextConfig?: 'export' | 'import' | 'none'; /** 预定义配置 ws进行时的下方提示文字的配置 默认export */ autoDownload?: boolean | DownloadProps; /** 完成后是否自动下载 */ downloadProps?: DownloadProps; /** 下载文件配置,当存在自动下载配置时,以自动下载配置为最高优先级 */ onFinish?: (messageData: any) => void; /** websocket任务完成后回调 */ onStart?: (messageData: any) => void; /** websocket任务开始时回调 */ downloadBtn?: boolean; } declare function onHumanizeDuration(createDate?: string, lastUpdateDate?: string, timeFormat?: string): string | null; declare const _default: React.FunctionComponent; export default _default; export { onHumanizeDuration as calculateHumanizeDuration };