@nocobase/plugin-action-import 2.1.0-alpha.23 → 2.1.0-alpha.25

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.
@@ -14,9 +14,9 @@ export const SSF: any;
14
14
  // export { CFB };
15
15
  export const CFB: any;
16
16
 
17
- /** Set internal `fs` instance */
17
+ /** ESM ONLY! Set internal `fs` instance */
18
18
  export function set_fs(fs: any): void;
19
- /** Set internal codepage tables */
19
+ /** ESM ONLY! Set internal codepage tables */
20
20
  export function set_cptable(cptable: any): void;
21
21
 
22
22
  /** NODE ONLY! Attempts to read filename and parse */
@@ -139,37 +139,12 @@ export interface DateNFOption {
139
139
  dateNF?: NumberFormat;
140
140
  }
141
141
 
142
- export interface UTCOption {
143
- /**
144
- * For plaintext formats, interpret ambiguous datetimes in UTC
145
- * If explicitly set to `false`, dates will be parsed in local time.
146
- *
147
- * The `true` option is consistent with spreadsheet application export.
148
- *
149
- * @default true
150
- */
151
- UTC?: boolean;
152
- }
153
-
154
- export interface DenseOption {
155
- /** If true, generate dense-mode worksheets */
156
- dense?: boolean;
157
- }
158
-
159
142
  /** Options for read and readFile */
160
- export interface ParsingOptions extends UTCOption, CommonOptions, DenseOption {
143
+ export interface ParsingOptions extends CommonOptions {
161
144
  /** Input data encoding */
162
145
  type?: 'base64' | 'binary' | 'buffer' | 'file' | 'array' | 'string';
163
146
 
164
- /**
165
- * Default codepage for legacy files
166
- *
167
- * This requires encoding support to be loaded. It is automatically loaded
168
- * in `xlsx.full.min.js` and in CommonJS / Extendscript, but an extra step
169
- * is required in React / Angular / Webpack ESM deployments.
170
- *
171
- * Check the relevant guide https://docs.sheetjs.com/docs/getting-started/
172
- */
147
+ /** Default codepage */
173
148
  codepage?: number;
174
149
 
175
150
  /**
@@ -238,24 +213,24 @@ export interface ParsingOptions extends UTCOption, CommonOptions, DenseOption {
238
213
  /** If true, plaintext parsing will not parse values */
239
214
  raw?: boolean;
240
215
 
241
- /** If true, ignore "dimensions" records and guess range using every cell */
242
- nodim?: boolean;
243
-
244
216
  /** If true, preserve _xlfn. prefixes in formula function names */
245
217
  xlfn?: boolean;
246
218
 
247
- /**
248
- * For single-sheet formats (including CSV), override the worksheet name
249
- * @default "Sheet1"
250
- */
251
- sheet?: string;
219
+ dense?: boolean;
252
220
 
253
221
  PRN?: boolean;
254
222
  }
255
223
 
224
+ export interface SheetOption {
225
+ /**
226
+ * Name of Worksheet (for single-sheet formats)
227
+ * @default ''
228
+ */
229
+ sheet?: string;
230
+ }
256
231
 
257
232
  /** Options for write and writeFile */
258
- export interface WritingOptions extends CommonOptions {
233
+ export interface WritingOptions extends CommonOptions, SheetOption {
259
234
  /** Output data encoding */
260
235
  type?: 'base64' | 'binary' | 'buffer' | 'file' | 'array' | 'string';
261
236
 
@@ -277,9 +252,6 @@ export interface WritingOptions extends CommonOptions {
277
252
  */
278
253
  compression?: boolean;
279
254
 
280
- /** Overwride theme XML when exporting to XLSX/XLSM/XLSB */
281
- themeXLSX?: string;
282
-
283
255
  /**
284
256
  * Suppress "number stored as text" errors in generated files
285
257
  * @default true
@@ -289,34 +261,8 @@ export interface WritingOptions extends CommonOptions {
289
261
  /** Override workbook properties on save */
290
262
  Props?: Properties;
291
263
 
292
- /**
293
- * Desired codepage for legacy file formats
294
- *
295
- * This requires encoding support to be loaded. It is automatically loaded
296
- * in `xlsx.full.min.js` and in CommonJS / Extendscript, but an extra step
297
- * is required in React / Angular / Webpack / ESM deployments.
298
- *
299
- * Check the relevant guide https://docs.sheetjs.com/docs/getting-started/
300
- */
301
- codepage?: number;
302
-
303
264
  /** Base64 encoding of NUMBERS base for exports */
304
265
  numbers?: string;
305
-
306
- /**
307
- * For single-sheet formats, export the specified worksheet.
308
- *
309
- * The property must be a string (sheet name) or number (`SheetNames` index).
310
- *
311
- * If this option is omitted, the first worksheet will be exported.
312
- */
313
- sheet?: string | number;
314
-
315
- /** Field Separator ("delimiter") for CSV / Text output */
316
- FS?: string;
317
-
318
- /** Record Separator ("row separator") for CSV / Text output */
319
- RS?: string;
320
266
  }
321
267
 
322
268
  /** Workbook Object */
@@ -339,9 +285,6 @@ export interface WorkBook {
339
285
  Workbook?: WBProps;
340
286
 
341
287
  vbaraw?: any;
342
-
343
- /** Original file type (when parsed with `read` or `readFile`) */
344
- bookType?: BookType;
345
288
  }
346
289
 
347
290
  export interface SheetProps {
@@ -571,52 +514,20 @@ export type SheetKeys = string | MarginInfo | SheetType;
571
514
  /** General object representing a Sheet (worksheet or chartsheet) */
572
515
  export interface Sheet {
573
516
  /**
574
- * Sparse-mode store cells with keys corresponding to A1-style address
575
- * Dense-mode store cells in the '!data' key
517
+ * Indexing with a cell address string maps to a cell object
576
518
  * Special keys start with '!'
577
519
  */
578
- [cell: string]: CellObject | CellObject[][] | SheetKeys | any;
579
-
580
- /**
581
- * Dense-mode worksheets store data in an array of arrays
582
- *
583
- * Cells are accessed with sheet['!data'][R][C] (where R and C are 0-indexed)
584
- */
585
- '!data'?: CellObject[][];
520
+ [cell: string]: CellObject | SheetKeys | any;
586
521
 
587
522
  /** Sheet type */
588
523
  '!type'?: SheetType;
589
524
 
590
- /** Sheet Range (A1-style) */
525
+ /** Sheet Range */
591
526
  '!ref'?: string;
592
527
 
593
528
  /** Page Margins */
594
529
  '!margins'?: MarginInfo;
595
530
  }
596
- /** General object representing a dense Sheet (worksheet or chartsheet) */
597
- export interface DenseSheet extends Sheet {
598
- /**
599
- * Special keys start with '!'
600
- * Dense-mode worksheets store data in the '!data' key
601
- */
602
- [cell: string]: CellObject[][] | SheetKeys | any;
603
-
604
- /**
605
- * Dense-mode worksheets store data in an array of arrays
606
- *
607
- * Cells are accessed with sheet['!data'][R][C] (where R and C are 0-indexed)
608
- */
609
- '!data': CellObject[][];
610
- }
611
- /** General object representing a sparse Sheet (worksheet or chartsheet) */
612
- export interface SparseSheet extends Sheet {
613
- /**
614
- * Sparse-mode store cells with keys corresponding to A1-style address
615
- * Cells are accessed with sheet[addr]
616
- */
617
- '!data': never;
618
- }
619
-
620
531
 
621
532
  /** AutoFilter properties */
622
533
  export interface AutoFilterInfo {
@@ -649,15 +560,6 @@ export interface WorkSheet extends Sheet {
649
560
  /** AutoFilter info */
650
561
  '!autofilter'?: AutoFilterInfo;
651
562
  }
652
- /** Dense Worksheet Object */
653
- export interface DenseWorkSheet extends DenseSheet {
654
- /**
655
- * Dense-mode worksheets store data in an array of arrays
656
- *
657
- * Cells are accessed with sheet['!data'][R][C] (where R and C are 0-indexed)
658
- */
659
- '!data': CellObject[][];
660
- }
661
563
 
662
564
  /**
663
565
  * Worksheet Object with CellObject type
@@ -676,7 +578,7 @@ export type ExcelDataType = 'b' | 'n' | 'e' | 's' | 'd' | 'z';
676
578
  * Type of generated workbook
677
579
  * @default 'xlsx'
678
580
  */
679
- export type BookType = 'xlsx' | 'xlsm' | 'xlsb' | 'xls' | 'xla' | 'biff8' | 'biff5' | 'biff2' | 'xlml' | 'ods' | 'fods' | 'csv' | 'txt' | 'sylk' | 'slk' | 'html' | 'dif' | 'rtf' | 'prn' | 'eth' | 'dbf' | 'numbers';
581
+ export type BookType = 'xlsx' | 'xlsm' | 'xlsb' | 'xls' | 'xla' | 'biff8' | 'biff5' | 'biff2' | 'xlml' | 'ods' | 'fods' | 'csv' | 'txt' | 'sylk' | 'slk' | 'html' | 'dif' | 'rtf' | 'prn' | 'eth' | 'dbf';
680
582
 
681
583
  /** Comment element */
682
584
  export interface Comment {
@@ -725,9 +627,6 @@ export interface CellObject {
725
627
  /** Range of enclosing array if formula is array formula (if applicable) */
726
628
  F?: string;
727
629
 
728
- /** If true, cell is a dynamic array formula (for supported file formats) */
729
- D?: boolean;
730
-
731
630
  /** Rich text encoding (if applicable) */
732
631
  r?: any;
733
632
 
@@ -826,27 +725,9 @@ export interface Sheet2JSONOpts extends DateNFOption {
826
725
 
827
726
  /** if true, return raw numbers; if false, return formatted numbers */
828
727
  rawNumbers?: boolean;
829
-
830
- /**
831
- * If true, return dates whose UTC interpretation is correct
832
- * By default, return dates whose local interpretation is correct
833
- *
834
- * @default false
835
- */
836
- UTC?: boolean;
837
- }
838
-
839
- export interface UTCDateOption {
840
- /**
841
- * If true, dates are interpreted using the UTC methods
842
- * By default, dates are interpreted in the local timezone
843
- *
844
- * @default false
845
- */
846
- UTC?: boolean;
847
728
  }
848
729
 
849
- export interface AOA2SheetOpts extends CommonOptions, UTCDateOption, DateNFOption, DenseOption {
730
+ export interface AOA2SheetOpts extends CommonOptions, DateNFOption {
850
731
  /**
851
732
  * Create cell objects for stub cells
852
733
  * @default false
@@ -856,7 +737,7 @@ export interface AOA2SheetOpts extends CommonOptions, UTCDateOption, DateNFOptio
856
737
 
857
738
  export interface SheetAOAOpts extends AOA2SheetOpts, OriginOption {}
858
739
 
859
- export interface JSON2SheetOpts extends CommonOptions, UTCDateOption, DateNFOption, OriginOption, DenseOption {
740
+ export interface JSON2SheetOpts extends CommonOptions, DateNFOption {
860
741
  /** Use specified column order */
861
742
  header?: string[];
862
743
 
@@ -864,7 +745,9 @@ export interface JSON2SheetOpts extends CommonOptions, UTCDateOption, DateNFOpti
864
745
  skipHeader?: boolean;
865
746
  }
866
747
 
867
- export interface Table2SheetOpts extends CommonOptions, DateNFOption, OriginOption {
748
+ export interface SheetJSONOpts extends JSON2SheetOpts, OriginOption {}
749
+
750
+ export interface Table2SheetOpts extends CommonOptions, DateNFOption, OriginOption, SheetOption {
868
751
  /** If true, plaintext parsing will not parse values */
869
752
  raw?: boolean;
870
753
 
@@ -876,28 +759,6 @@ export interface Table2SheetOpts extends CommonOptions, DateNFOption, OriginOpti
876
759
 
877
760
  /** If true, hidden rows and cells will not be parsed */
878
761
  display?: boolean;
879
-
880
- /**
881
- * Override the worksheet name
882
- * @default "Sheet1"
883
- */
884
- sheet?: string;
885
-
886
- /**
887
- * If true, interpret date strings as if they are UTC.
888
- * By default, date strings are interpreted in the local timezone.
889
- *
890
- * @default false
891
- */
892
- UTC?: boolean;
893
- }
894
-
895
- export interface Table2BookOpts extends Table2SheetOpts {
896
- /**
897
- * Override the worksheet name
898
- * @default "Sheet1"
899
- */
900
- sheet?: string;
901
762
  }
902
763
 
903
764
  /** General utilities */
@@ -914,7 +775,7 @@ export interface XLSX$Utils {
914
775
 
915
776
  /** BROWSER ONLY! Converts a TABLE DOM element to a worksheet. */
916
777
  table_to_sheet(data: any, opts?: Table2SheetOpts): WorkSheet;
917
- table_to_book(data: any, opts?: Table2BookOpts): WorkBook;
778
+ table_to_book(data: any, opts?: Table2SheetOpts): WorkBook;
918
779
  sheet_add_dom(ws: WorkSheet, data: any, opts?: Table2SheetOpts): WorkSheet;
919
780
 
920
781
  /* --- Export Functions --- */
@@ -936,6 +797,15 @@ export interface XLSX$Utils {
936
797
  /** Generates a list of the formulae (with value fallbacks) */
937
798
  sheet_to_formulae(worksheet: WorkSheet): string[];
938
799
 
800
+ /** Generates DIF */
801
+ sheet_to_dif(worksheet: WorkSheet, options?: Sheet2HTMLOpts): string;
802
+
803
+ /** Generates SYLK (Symbolic Link) */
804
+ sheet_to_slk(worksheet: WorkSheet, options?: Sheet2HTMLOpts): string;
805
+
806
+ /** Generates ETH */
807
+ sheet_to_eth(worksheet: WorkSheet, options?: Sheet2HTMLOpts): string;
808
+
939
809
  /* --- Cell Address Utilities --- */
940
810
 
941
811
  /** Converts 0-indexed cell address to A1 form */
@@ -968,14 +838,11 @@ export interface XLSX$Utils {
968
838
 
969
839
  /* --- General Utilities --- */
970
840
 
971
- /** Create a new workbook */
972
- book_new(ws?: WorkSheet, wsname?: string): WorkBook;
973
-
974
- /** Create a new worksheet */
975
- sheet_new(opts?: DenseOption): WorkSheet;
841
+ /** Creates a new workbook */
842
+ book_new(): WorkBook;
976
843
 
977
- /** Append a worksheet to a workbook, returns new worksheet name */
978
- book_append_sheet(workbook: WorkBook, worksheet: WorkSheet, name?: string, roll?: boolean): string;
844
+ /** Append a worksheet to a workbook */
845
+ book_append_sheet(workbook: WorkBook, worksheet: WorkSheet, name?: string, roll?: boolean): void;
979
846
 
980
847
  /** Set sheet visibility (visible/hidden/very hidden) */
981
848
  book_set_sheet_visibility(workbook: WorkBook, sheet: number|string, visibility: number): void;
@@ -1000,8 +867,8 @@ export interface XLSX$Utils {
1000
867
  sheet_add_aoa(ws: WorkSheet, data: any[][], opts?: SheetAOAOpts): WorkSheet;
1001
868
 
1002
869
  /** Add an array of JS objects to a worksheet */
1003
- sheet_add_json(ws: WorkSheet, data: any[], opts?: JSON2SheetOpts): WorkSheet;
1004
- sheet_add_json<T>(ws: WorkSheet, data: T[], opts?: JSON2SheetOpts): WorkSheet;
870
+ sheet_add_json(ws: WorkSheet, data: any[], opts?: SheetJSONOpts): WorkSheet;
871
+ sheet_add_json<T>(ws: WorkSheet, data: T[], opts?: SheetJSONOpts): WorkSheet;
1005
872
 
1006
873
 
1007
874
  consts: XLSX$Consts;