import { ColumnProps, CrudExpose, PageQuery, UserPageQuery } from "../../d"; import { CsvParams, ExcelParams, ExportColumn, ExportUtil, ImportUtil } from "./lib/d"; export declare function loadFsExportUtil(): Promise; export declare function loadFsImportUtil(): Promise; export type DataFormatterContext = { row: any; /** * 原始行数据 */ originalRow: R; key: string; col: ColumnProps; exportCol: ExportColumn; }; export type ColumnBuilderContext = { col: ExportColumn; }; /** * 导出配置 */ export type ExportProps = { /** * 服务端导出,自己实现 */ server?: (pageQuery: UserPageQuery) => Promise; /** * 仅导出显示的列 */ onlyShow?: boolean; /** * 列过滤器 * @param col */ columnFilter?: (col: ColumnProps) => boolean; /** * 列配置构建器 */ columnBuilder?: (context: ColumnBuilderContext) => void; /** * 数据mapping */ dataFormatter?: (context: DataFormatterContext) => void; /** * 导出文件类型 */ fileType?: "csv" | "excel"; /** * 数据来源 * local: 本地当前页数据(默认) * search: 搜索数据 */ dataFrom?: "local" | "search"; /** * 查询参数 */ searchParams?: PageQuery; /** * 配置了dict的字段是否自动根据value获取label * 默认值:true */ autoUseDictLabel?: boolean; /** * 数据分隔符 */ separator?: string; /** * 数据是否加引号 */ quoted?: boolean; } & CsvParams & ExcelParams; export declare function exportTable(crudExpose: CrudExpose, opts?: ExportProps): Promise; export type ImportProps = { file: File; append?: boolean; }; export declare function importTable(crudExpose: CrudExpose, opts: ImportProps): Promise;