foucui 2.3.5 → 2.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -33,3 +33,26 @@ export declare function downloadFilledExcel(options: FillExcelTemplateOptions &
33
33
  /** 生成一份固定版式模板:标题 / {{title}} {{date}} {{dept}} / 表头,数据从 A6 起填 */
34
34
  export declare function createExcelTemplate(options?: CreateExcelTemplateOptions): Promise<Uint8Array>;
35
35
  export declare function downloadExcelTemplate(options?: CreateExcelTemplateOptions): Promise<void>;
36
+ export type ExcelImportTableMapping = {
37
+ sheet?: string | number;
38
+ /** 数据起始单元格,如 A6;若 headerRow 为 true,则 start 是表头行 */
39
+ start: string;
40
+ columns: string[];
41
+ /** start 是表头行时,数据从下一行开始 */
42
+ headerRow?: boolean;
43
+ /** 最多读多少行,默认读到连续空行为止 */
44
+ maxRows?: number;
45
+ };
46
+ export type ImportFromExcelTemplateOptions = {
47
+ file: ArrayBuffer | Uint8Array | Blob | File;
48
+ /** 按单元格地址读元数据,如 { title: 'B2', date: 'B3' } */
49
+ fields?: Record<string, string>;
50
+ tables?: ExcelImportTableMapping[];
51
+ };
52
+ export type ImportFromExcelTemplateResult = {
53
+ data: Record<string, string>;
54
+ rows: Record<string, string>[];
55
+ tables: Record<string, string>[][];
56
+ };
57
+ /** 按用户模板映射,从填好的 Excel 读回元数据与表格行 */
58
+ export declare function importFromExcelTemplate(options: ImportFromExcelTemplateOptions): Promise<ImportFromExcelTemplateResult>;