import { File, Sheet } from 'better-xlsx'; import { IStyle, IExcelColumn, ITbodyConfig } from '../app'; export declare class Excel { file: File; sheet: Sheet | undefined; defaultTheadCellStyle: IStyle; defaultTbodyCellStyle: IStyle; columns: IExcelColumn[] | undefined; constructor(); /** * 添加工作表 * @param name 工作表名称 */ addSheet(name: string): this; /** * 添加表格配置 * @param columns antd table columns * @param rowHeight 行高(单位: CM) */ addColumns(columns: IExcelColumn[], rowHeight?: number): this; /** * 添加数据 * @param dataSource 数据 * @param config 表格体配置 * @param rowHeight 行高(单位: CM) */ addDataSource(dataSource: any[], config?: ITbodyConfig, rowHeight?: number): this; /** * 更改默认的表格头单元格样式属性,不包含表格体 * @param style 单元格样式属性 */ setTHeadStyle(style: IStyle): this; /** * 更改默认的单元格样式属性,不包含表格头 * @param style 单元格样式属性 */ setTBodyStyle(style: IStyle): this; /** * 另存为 * @param name 名称 * @param type 保存类型 'blob' | 'base64' * @param compress 是否压缩 boolean */ saveAs(name: string, type?: 'blob', compress?: boolean): Promise | undefined; }