@agile-team/mach-report 2.0.0 → 2.2.0

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.
Files changed (87) hide show
  1. package/LICENSE +2 -4
  2. package/LICENSING.md +15 -0
  3. package/README.md +317 -76
  4. package/dist/ReportPreview-BWrQCj9M.js +1643 -0
  5. package/dist/ReportPreview-DY0PGGqF.cjs +6 -0
  6. package/dist/grid-geometry-DBH9ExuY.cjs +1 -0
  7. package/dist/grid-geometry-DONcjshk.js +130 -0
  8. package/dist/index.cjs +5 -5
  9. package/dist/index.d.cts +806 -13
  10. package/dist/index.d.ts +806 -13
  11. package/dist/index.js +1170 -653
  12. package/dist/page-window-index-CIuT4BAv.js +43 -0
  13. package/dist/page-window-index-DEjnM6IB.cjs +1 -0
  14. package/dist/pdf.cjs +48 -48
  15. package/dist/pdf.d.cts +159 -6
  16. package/dist/pdf.d.ts +159 -6
  17. package/dist/pdf.js +3542 -3466
  18. package/dist/plugin-BMoMUxrw.cjs +1 -0
  19. package/dist/plugin-CAcNe0FT.js +25 -0
  20. package/dist/report-params-B3Fia6JO.js +10 -0
  21. package/dist/report-params-D1gZ1DME.cjs +1 -0
  22. package/dist/sql.cjs +65 -64
  23. package/dist/sql.d.cts +109 -5
  24. package/dist/sql.d.ts +109 -5
  25. package/dist/sql.js +7947 -7922
  26. package/dist/style.css +1 -1
  27. package/dist/textwrap-DdaewxAd.js +117 -0
  28. package/dist/textwrap-DqiFwAV3.cjs +3 -0
  29. package/dist/vue/async.d.cts +820 -320
  30. package/dist/vue/async.d.ts +820 -320
  31. package/dist/vue/index.d.cts +1374 -14
  32. package/dist/vue/index.d.ts +1374 -14
  33. package/dist/vue-async.cjs +1 -1
  34. package/dist/vue-async.js +11 -12
  35. package/dist/vue.cjs +1 -1
  36. package/dist/vue.js +129 -49
  37. package/dist/xlsx.cjs +21 -21
  38. package/dist/xlsx.d.cts +2300 -5
  39. package/dist/xlsx.d.ts +2300 -5
  40. package/dist/xlsx.js +6390 -6347
  41. package/package.json +8 -3
  42. package/dist/ReportPreview-Cr0IH1Rz.cjs +0 -6
  43. package/dist/ReportPreview-DwknBgsJ.js +0 -1266
  44. package/dist/builder/template-builder.d.ts +0 -69
  45. package/dist/defaults.d.ts +0 -23
  46. package/dist/format.d.ts +0 -48
  47. package/dist/grid-geometry-BXpOxznT.cjs +0 -1
  48. package/dist/grid-geometry-Bs8QXz1X.js +0 -65
  49. package/dist/layout/paginate.d.ts +0 -97
  50. package/dist/layout/textwrap.d.ts +0 -36
  51. package/dist/pdf/font-loader.d.ts +0 -6
  52. package/dist/pdf/index.d.ts +0 -2
  53. package/dist/pdf/render-pdf.d.ts +0 -25
  54. package/dist/plugin-Cj3c2wJc.cjs +0 -1
  55. package/dist/plugin-DJf_6_fl.js +0 -18
  56. package/dist/render/canvas.d.ts +0 -76
  57. package/dist/render/dom.d.ts +0 -10
  58. package/dist/render/grid-geometry.d.ts +0 -41
  59. package/dist/render/style.d.ts +0 -33
  60. package/dist/render/window.d.ts +0 -23
  61. package/dist/schema/render-plan.d.ts +0 -88
  62. package/dist/schema/validate.d.ts +0 -15
  63. package/dist/sql/ast-check.d.ts +0 -14
  64. package/dist/sql/compile.d.ts +0 -31
  65. package/dist/sql/expr.d.ts +0 -21
  66. package/dist/sql/index.d.ts +0 -4
  67. package/dist/sql/tokenizer.d.ts +0 -25
  68. package/dist/style-CFZ-HE2s.cjs +0 -3
  69. package/dist/style-DnmtG7Gl.js +0 -180
  70. package/dist/units.d.ts +0 -11
  71. package/dist/vue/ReportParamPanel.d.ts +0 -19
  72. package/dist/vue/ReportPreview.d.ts +0 -200
  73. package/dist/vue/ReportToolbar.d.ts +0 -42
  74. package/dist/vue/adapters.d.ts +0 -34
  75. package/dist/vue/composables/useHighlight.d.ts +0 -8
  76. package/dist/vue/composables/usePageWindow.d.ts +0 -25
  77. package/dist/vue/composables/usePrintExport.d.ts +0 -40
  78. package/dist/vue/composables/useReportSearch.d.ts +0 -73
  79. package/dist/vue/composables/useZoom.d.ts +0 -15
  80. package/dist/vue/config.d.ts +0 -108
  81. package/dist/vue/controller.d.ts +0 -29
  82. package/dist/vue/errors.d.ts +0 -16
  83. package/dist/vue/injection-keys.d.ts +0 -14
  84. package/dist/vue/local-adapter.d.ts +0 -11
  85. package/dist/vue/pdf-exporter.d.ts +0 -13
  86. package/dist/vue/plugin.d.ts +0 -332
  87. package/dist/xlsx/render-xlsx.d.ts +0 -20
package/dist/xlsx.d.cts CHANGED
@@ -1,5 +1,2300 @@
1
- /**
2
- * Excel 导出子路径入口(@agile-team/mach-report/xlsx):
3
- * RenderPlan → xlsx 工作簿(exceljs 内联,零运行时依赖声明不变)。
4
- */
5
- export * from './xlsx/render-xlsx';
1
+ /// <reference types="node" />
2
+ import { EventEmitter } from 'events';
3
+ import { Stream } from 'stream';
4
+
5
+ declare interface AboveAverageRuleType extends ConditionalFormattingBaseRule {
6
+ type: 'aboveAverage';
7
+ aboveAverage: boolean;
8
+ }
9
+
10
+ declare interface Address {
11
+ sheetName?: string;
12
+ address: string;
13
+ col: string;
14
+ row: string;
15
+ $col$row: string;
16
+ }
17
+
18
+ declare interface AddWorksheetOptions {
19
+ properties: Partial<WorksheetProperties>;
20
+ pageSetup: Partial<PageSetup>;
21
+ headerFooter: Partial<HeaderFooter>;
22
+ views: Array<Partial<WorksheetView>>;
23
+ state: WorksheetState;
24
+ }
25
+
26
+ declare interface Alignment {
27
+ horizontal: 'left' | 'center' | 'right' | 'fill' | 'justify' | 'centerContinuous' | 'distributed';
28
+ vertical: 'top' | 'middle' | 'bottom' | 'distributed' | 'justify';
29
+ wrapText: boolean;
30
+ shrinkToFit: boolean;
31
+ indent: number;
32
+ readingOrder: 'rtl' | 'ltr';
33
+ textRotation: number | 'vertical';
34
+ }
35
+
36
+ declare class Anchor implements IAnchor {
37
+ col: number;
38
+ nativeCol: number;
39
+ nativeColOff: number;
40
+ nativeRow: number;
41
+ nativeRowOff: number;
42
+ row: number;
43
+
44
+ private readonly colWidth: number;
45
+ private readonly rowHeight: number;
46
+ worksheet: Worksheet;
47
+
48
+ constructor(model?: IAnchor | object);
49
+ }
50
+
51
+ declare type AutoFilter = string | {
52
+ from: string | { row: number; column: number };
53
+ to: string | { row: number; column: number };
54
+ };
55
+
56
+ declare interface Border {
57
+ style: BorderStyle;
58
+ color: Partial<Color>;
59
+ }
60
+
61
+ declare interface BorderDiagonal extends Border {
62
+ up: boolean;
63
+ down: boolean;
64
+ }
65
+
66
+ declare interface Borders {
67
+ top: Partial<Border>;
68
+ left: Partial<Border>;
69
+ bottom: Partial<Border>;
70
+ right: Partial<Border>;
71
+ diagonal: Partial<BorderDiagonal>;
72
+ }
73
+
74
+ declare type BorderStyle =
75
+ | 'thin' | 'dotted' | 'hair' | 'medium' | 'double' | 'thick' | 'dashed' | 'dashDot'
76
+ | 'dashDotDot' | 'slantDashDot' | 'mediumDashed' | 'mediumDashDotDot' | 'mediumDashDot';
77
+
78
+ declare interface Buffer_2 extends ArrayBuffer { }
79
+
80
+ declare interface CalculationProperties {
81
+ /**
82
+ * Whether the application shall perform a full recalculation when the workbook is opened
83
+ */
84
+ fullCalcOnLoad: boolean
85
+ }
86
+
87
+ declare interface Cell extends Style, Address {
88
+ readonly worksheet: Worksheet;
89
+ readonly workbook: Workbook;
90
+
91
+ readonly effectiveType: ValueType;
92
+ readonly isMerged: boolean;
93
+ readonly master: Cell;
94
+ readonly isHyperlink: boolean;
95
+ readonly hyperlink: string; // todo
96
+ readonly text: string;
97
+ readonly fullAddress: {
98
+ sheetName: string;
99
+ address: string;
100
+ row: number;
101
+ col: number;
102
+ };
103
+ model: CellModel;
104
+ /**
105
+ * Assign (or get) a name for a cell (will overwrite any other names that cell had)
106
+ */
107
+ name: string;
108
+
109
+ /**
110
+ * Assign (or get) an array of names for a cell (cells can have more than one name)
111
+ */
112
+ names: string[];
113
+
114
+ /**
115
+ * Cells can define what values are valid or not and provide
116
+ * prompting to the user to help guide them.
117
+ */
118
+ dataValidation: DataValidation;
119
+
120
+ /**
121
+ * Value of the cell
122
+ */
123
+ value: CellValue;
124
+
125
+ /**
126
+ * comment of the cell
127
+ */
128
+ note: string | Comment_2;
129
+
130
+ /**
131
+ * convenience getter to access the formula
132
+ */
133
+ readonly formula: string;
134
+
135
+ /**
136
+ * convenience getter to access the formula result
137
+ */
138
+ readonly result: number | string | Date;
139
+
140
+ /**
141
+ * The type of the cell's value
142
+ */
143
+ readonly type: ValueType;
144
+
145
+ /**
146
+ * The type of the cell's formula
147
+ */
148
+ readonly formulaType: FormulaType;
149
+
150
+ /**
151
+ * The styles of the cell
152
+ */
153
+ style: Partial<Style>;
154
+
155
+ addName(name: string): void;
156
+
157
+ /**
158
+ * Remove a name from a cell
159
+ */
160
+ removeName(name: string): void;
161
+ removeAllNames(): void;
162
+
163
+ destroy(): void;
164
+ toCsvString(): string;
165
+ release(): void;
166
+ addMergeRef(): void;
167
+ releaseMergeRef(): void;
168
+ merge(master: Cell, ignoreStyle?: boolean): void;
169
+ unmerge(): void;
170
+ isMergedTo(master: Cell): boolean;
171
+ toString(): string;
172
+ }
173
+
174
+ declare interface CellErrorValue {
175
+ error: '#N/A' | '#REF!' | '#NAME?' | '#DIV/0!' | '#NULL!' | '#VALUE!' | '#NUM!';
176
+ }
177
+
178
+ declare interface CellFormulaValue {
179
+ formula: string;
180
+ result?: number | string | boolean | Date | CellErrorValue;
181
+ date1904?: boolean;
182
+ }
183
+
184
+ declare interface CellHyperlinkValue {
185
+ text: string;
186
+ hyperlink: string;
187
+ tooltip?: string;
188
+ }
189
+
190
+ declare type CellIsOperators = 'equal' | 'greaterThan' | 'lessThan' | 'between';
191
+
192
+ declare interface CellIsRuleType extends ConditionalFormattingBaseRule {
193
+ type: 'cellIs';
194
+ formulae?: any[];
195
+ operator?: CellIsOperators;
196
+ }
197
+
198
+ declare interface CellMatrix {
199
+ addCell(addressStr: string): void;
200
+ getCell(addressStr: string): Cell;
201
+ findCell(addressStr: string): Cell | undefined;
202
+ findCellAt(sheetName: string, rowNumber: number, colNumber: number): Cell | undefined;
203
+ addCellEx(address: string | Location_2): void;
204
+ getCellEx(address: string | Location_2): Cell;
205
+ findCellEx(address: string | Location_2, create: boolean): Cell | undefined;
206
+ getCellAt(sheetName: string, rowNumber: number, colNumber: number): Cell;
207
+ removeCellEx(address: string | Location_2): void;
208
+ forEach(callback: (cell: Cell) => void): void;
209
+ map<T>(callback: (cell: Cell) => T): T[];
210
+ findSheet(address: string | Location_2, create: boolean): Cell[] | undefined;
211
+ findSheetRow(sheet: Cell[][], address: string | Location_2, create: boolean): Row | undefined;
212
+ findRowCell(row: any[], address: Address, create: boolean): Cell | undefined;
213
+ }
214
+
215
+ declare interface CellModel {
216
+ address: Address;
217
+ style: Style;
218
+ type: ValueType;
219
+ text?: string;
220
+ hyperlink?: string;
221
+ value?: CellValue;
222
+ master: string;
223
+ formula?: string;
224
+ sharedFormula?: string;
225
+ result?: string | number | any;
226
+ comment: Comment_2;
227
+ }
228
+
229
+ declare interface CellRichTextValue {
230
+ richText: RichText[];
231
+ }
232
+
233
+ declare interface CellSharedFormulaValue {
234
+ sharedFormula: string;
235
+ readonly formula?: string;
236
+ result?: number | string | boolean | Date | CellErrorValue;
237
+ date1904?: boolean;
238
+ }
239
+
240
+ declare type CellValue =
241
+ | null | number | string | boolean | Date | undefined
242
+ | CellErrorValue
243
+ | CellRichTextValue | CellHyperlinkValue
244
+ | CellFormulaValue | CellSharedFormulaValue;
245
+
246
+ declare type CfvoTypes = 'percentile' | 'percent' | 'num' | 'min' | 'max' | 'formula' | 'autoMin' | 'autoMax';
247
+
248
+ declare interface Color {
249
+ /**
250
+ * Hex string for alpha-red-green-blue e.g. FF00FF00
251
+ */
252
+ argb: string;
253
+
254
+ /**
255
+ * Choose a theme by index
256
+ */
257
+ theme: number;
258
+ }
259
+
260
+ declare interface ColorScaleRuleType extends ConditionalFormattingBaseRule {
261
+ type: 'colorScale';
262
+ cfvo?: Cvfo[];
263
+ color?: Partial<Color>[];
264
+ }
265
+
266
+ declare interface Column {
267
+ /**
268
+ * Can be a string to set one row high header or an array to set multi-row high header
269
+ */
270
+ header?: string | string[];
271
+
272
+ /**
273
+ * The name of the properties associated with this column in each row
274
+ */
275
+ key?: string;
276
+
277
+ /**
278
+ * The width of the column
279
+ */
280
+ width?: number;
281
+
282
+ /**
283
+ * Set an outline level for columns
284
+ */
285
+ outlineLevel: number;
286
+
287
+ /**
288
+ * Hides the column
289
+ */
290
+ hidden: boolean;
291
+
292
+ /**
293
+ * Styles applied to the column
294
+ */
295
+ style: Partial<Style>;
296
+
297
+ /**
298
+ * The cell values in the column
299
+ */
300
+ values: ReadonlyArray<CellValue>;
301
+
302
+ /**
303
+ * Column letter key
304
+ */
305
+ readonly letter: string;
306
+ readonly number: number;
307
+ readonly worksheet: Worksheet;
308
+ readonly isCustomWidth: boolean;
309
+ readonly headers: string[];
310
+ readonly isDefault: boolean;
311
+ readonly headerCount: number;
312
+
313
+ /**
314
+ * Below properties read from style
315
+ */
316
+ border?: Partial<Borders>;
317
+ fill?: Fill;
318
+ numFmt?: string;
319
+ font?: Partial<Font>;
320
+ alignment?: Partial<Alignment>;
321
+ protection?: Partial<Protection>;
322
+
323
+ toString(): string
324
+ equivalentTo(other: Column): boolean
325
+
326
+ /**
327
+ * indicate the collapsed state based on outlineLevel
328
+ */
329
+ readonly collapsed: boolean;
330
+
331
+ /**
332
+ * Iterate over all current cells in this column
333
+ */
334
+ eachCell(callback: (cell: Cell, rowNumber: number) => void): void;
335
+
336
+ /**
337
+ * Iterate over all current cells in this column including empty cells
338
+ */
339
+ eachCell(opt: { includeEmpty: boolean }, callback: (cell: Cell, rowNumber: number) => void): void;
340
+
341
+ defn: any; //todo
342
+ }
343
+
344
+ declare interface Comment_2 {
345
+ texts?: RichText[];
346
+ margins?: Partial<CommentMargins>;
347
+ protection?: Partial<CommentProtection>;
348
+ editAs?: CommentEditAs;
349
+ }
350
+
351
+ declare type CommentEditAs = 'twoCells' | 'oneCells' | 'absolute';
352
+
353
+ declare interface CommentMargins {
354
+ insetmode: 'auto' | 'custom';
355
+ inset: Number[];
356
+ }
357
+
358
+ declare interface CommentProtection {
359
+ locked: 'True' | 'False';
360
+ lockText: 'True' | 'False';
361
+ }
362
+
363
+ declare type ComponentKind = "text" | "image" | "barcode" | "qrcode" | "chart" | "line" | "rect" | "ellipse";
364
+
365
+ declare interface ComponentStyle {
366
+ fontSizePx?: number;
367
+ fontSize?: number;
368
+ fontFamily?: string;
369
+ bold?: boolean;
370
+ italic?: boolean;
371
+ underline?: boolean;
372
+ color?: string;
373
+ backgroundColor?: string;
374
+ align?: "left" | "center" | "right" | "justify";
375
+ verticalAlign?: "top" | "middle" | "bottom";
376
+ lineColor?: string;
377
+ borderColor?: string;
378
+ lineWidthPt?: number;
379
+ borderTop?: boolean;
380
+ borderRight?: boolean;
381
+ borderBottom?: boolean;
382
+ borderLeft?: boolean;
383
+ lineHeight?: number;
384
+ letterSpacing?: number;
385
+ opacity?: number;
386
+ rotateDeg?: number;
387
+ }
388
+
389
+ declare interface ConditionalFormattingBaseRule {
390
+ priority: number;
391
+ style?: Partial<Style>;
392
+ }
393
+
394
+ declare interface ConditionalFormattingOptions {
395
+ ref: string;
396
+ rules: ConditionalFormattingRule[];
397
+ }
398
+
399
+ declare type ConditionalFormattingRule = ExpressionRuleType | CellIsRuleType | Top10RuleType | AboveAverageRuleType | ColorScaleRuleType | IconSetRuleType
400
+ | ContainsTextRuleType | TimePeriodRuleType | DataBarRuleType;
401
+
402
+ declare namespace config {
403
+ function setValue(key: 'promise', promise: any): void;
404
+ }
405
+
406
+ declare type ContainsTextOperators = 'containsText' | 'containsBlanks' | 'notContainsBlanks' | 'containsErrors' | 'notContainsErrors';
407
+
408
+ declare interface ContainsTextRuleType extends ConditionalFormattingBaseRule {
409
+ type: 'containsText';
410
+ operator?: ContainsTextOperators;
411
+ text?: string;
412
+ }
413
+
414
+ declare interface Csv {
415
+ /**
416
+ * read from a file
417
+ */
418
+ readFile(path: string, options?: Partial<CsvReadOptions>): Promise<Worksheet>;
419
+
420
+ /**
421
+ * read from a stream
422
+ */
423
+ read(stream: Stream, options?: Partial<CsvReadOptions>): Promise<Worksheet>;
424
+
425
+ /**
426
+ * Create input stream for reading
427
+ */
428
+ createInputStream(options?: Partial<CsvReadOptions>): EventEmitter;
429
+
430
+ /**
431
+ * write to a buffer
432
+ */
433
+ writeBuffer(options?: Partial<CsvWriteOptions>): Promise<Buffer_2>;
434
+
435
+ /**
436
+ * write to a file
437
+ */
438
+ writeFile(path: string, options?: Partial<CsvWriteOptions>): Promise<void>;
439
+
440
+ /**
441
+ * write to a stream
442
+ */
443
+ write(stream: Stream, options?: Partial<CsvWriteOptions>): Promise<void>;
444
+ }
445
+
446
+ declare interface CsvReadOptions {
447
+ dateFormats: string[];
448
+ map(value: any, index: number): any;
449
+ sheetName: string;
450
+ parserOptions: Partial<FastCsvParserOptionsArgs>;
451
+ }
452
+
453
+ declare interface CsvWriteOptions {
454
+ dateFormat: string;
455
+ dateUTC: boolean;
456
+ sheetName: string;
457
+ sheetId: number;
458
+ encoding: string;
459
+ map(value: any, index: number): any;
460
+ includeEmptyRows: boolean;
461
+ formatterOptions: Partial<FastCsvFormatterOptionsArgs>;
462
+ }
463
+
464
+ declare interface Cvfo {
465
+ type: CfvoTypes;
466
+ value?: number;
467
+ }
468
+
469
+ declare interface DataBarRuleType extends ConditionalFormattingBaseRule {
470
+ type: 'dataBar';
471
+ gradient?: boolean;
472
+ minLength?: number;
473
+ maxLength?: number;
474
+ showValue?: boolean;
475
+ border?: boolean;
476
+ negativeBarColorSameAsPositive?: boolean;
477
+ negativeBarBorderColorSameAsPositive?: boolean;
478
+ axisPosition?: 'auto' | 'middle' | 'none';
479
+ direction?: 'context' | 'leftToRight' | 'rightToLeft';
480
+ cfvo?: Cvfo[];
481
+ }
482
+
483
+ declare interface DataValidation {
484
+ type: 'list' | 'whole' | 'decimal' | 'date' | 'textLength' | 'custom';
485
+ formulae: any[];
486
+ allowBlank?: boolean;
487
+ operator?: DataValidationOperator;
488
+ error?: string;
489
+ errorTitle?: string;
490
+ errorStyle?: string;
491
+ prompt?: string;
492
+ promptTitle?: string;
493
+ showErrorMessage?: boolean;
494
+ showInputMessage?: boolean;
495
+ }
496
+
497
+ declare type DataValidationOperator =
498
+ | 'between' | 'notBetween' | 'equal' | 'notEqual' | 'greaterThan' | 'lessThan'
499
+ | 'greaterThanOrEqual' | 'lessThanOrEqual';
500
+
501
+ declare interface DefinedNames {
502
+ getMatrix(name: string): CellMatrix;
503
+ // add a name to a cell. locStr in the form SheetName!$col$row or SheetName!$c1$r1:$c2:$r2
504
+ add(locStr: string, name?: string): void;
505
+ addEx(location: string | Location_2, name: string): Cell;
506
+
507
+ remove(locStr: string | Location_2, name: string): void;
508
+ removeEx(location: string | Location_2, name: string): void;
509
+ removeAllNames(location: string | Location_2): void;
510
+
511
+ forEach(callback: (name: string, cell: Cell) => void): void;
512
+
513
+ // get all the names of a cell
514
+ getNames(addressStr: string): string[];
515
+ getNamesEx(address: string): string[];
516
+
517
+ getRanges(name: string, matrix?: CellMatrix): DefinedNamesRanges;
518
+
519
+ model: DefinedNamesModel;
520
+ }
521
+
522
+ declare type DefinedNamesModel = DefinedNamesRanges[];
523
+
524
+ declare interface DefinedNamesRanges {
525
+ name: string;
526
+ ranges: string[];
527
+ }
528
+
529
+ declare enum DocumentType_2 {
530
+ Xlsx = 1
531
+ }
532
+
533
+ declare enum ErrorValue {
534
+ NotApplicable = '#N/A',
535
+ Ref = '#REF!',
536
+ Name = '#NAME?',
537
+ DivZero = '#DIV/0!',
538
+ Null = '#NULL!',
539
+ Value = '#VALUE!',
540
+ Num = '#NUM!',
541
+ }
542
+
543
+ declare namespace ExcelJS {
544
+ export {
545
+ Buffer_2 as Buffer,
546
+ RelationshipType,
547
+ DocumentType_2 as DocumentType,
548
+ PaperSize,
549
+ WorksheetViewCommon,
550
+ WorksheetViewNormal,
551
+ WorksheetViewFrozen,
552
+ WorksheetViewSplit,
553
+ WorksheetView,
554
+ WorkbookView,
555
+ FillPatterns,
556
+ FillPattern,
557
+ GradientStop,
558
+ FillGradientAngle,
559
+ FillGradientPath,
560
+ Fill,
561
+ Font,
562
+ BorderStyle,
563
+ Color,
564
+ Border,
565
+ BorderDiagonal,
566
+ Borders,
567
+ Margins,
568
+ ReadingOrder,
569
+ Alignment,
570
+ Protection,
571
+ Style,
572
+ DataValidationOperator,
573
+ DataValidation,
574
+ ErrorValue,
575
+ CellErrorValue,
576
+ RichText,
577
+ CellRichTextValue,
578
+ CellHyperlinkValue,
579
+ CellFormulaValue,
580
+ CellSharedFormulaValue,
581
+ ValueType,
582
+ FormulaType,
583
+ CellValue,
584
+ CommentMargins,
585
+ CommentProtection,
586
+ CommentEditAs,
587
+ Comment_2 as Comment,
588
+ CellModel,
589
+ Cell,
590
+ RowModel,
591
+ Row,
592
+ Column,
593
+ PageSetup,
594
+ HeaderFooter,
595
+ AutoFilter,
596
+ WorksheetProtection,
597
+ Image_2 as Image,
598
+ IAnchor,
599
+ Anchor,
600
+ ImageRange,
601
+ ImagePosition,
602
+ ImageHyperlinkValue,
603
+ Range_2 as Range,
604
+ RowBreak,
605
+ WorksheetModel,
606
+ WorksheetState,
607
+ CellIsOperators,
608
+ ContainsTextOperators,
609
+ TimePeriodTypes,
610
+ IconSetTypes,
611
+ CfvoTypes,
612
+ Cvfo,
613
+ ConditionalFormattingBaseRule,
614
+ ExpressionRuleType,
615
+ CellIsRuleType,
616
+ Top10RuleType,
617
+ AboveAverageRuleType,
618
+ ColorScaleRuleType,
619
+ IconSetRuleType,
620
+ ContainsTextRuleType,
621
+ TimePeriodRuleType,
622
+ DataBarRuleType,
623
+ ConditionalFormattingRule,
624
+ RowValues,
625
+ ConditionalFormattingOptions,
626
+ Worksheet,
627
+ CalculationProperties,
628
+ WorksheetProperties,
629
+ AddWorksheetOptions,
630
+ WorkbookProperties,
631
+ JSZipGeneratorOptions,
632
+ XlsxReadOptions,
633
+ XlsxWriteOptions,
634
+ Xlsx,
635
+ HeaderArray,
636
+ HeaderTransformFunction,
637
+ FastCsvParserOptionsArgs,
638
+ QuoteColumnMap,
639
+ QuoteColumns,
640
+ RowMap,
641
+ RowHashArray,
642
+ RowArray,
643
+ Rows,
644
+ RowTransformCallback,
645
+ RowTransformFunction,
646
+ FastCsvFormatterOptionsArgs,
647
+ CsvReadOptions,
648
+ CsvWriteOptions,
649
+ Csv,
650
+ Media,
651
+ Address,
652
+ Location_2 as Location,
653
+ CellMatrix,
654
+ DefinedNamesRanges,
655
+ DefinedNamesModel,
656
+ DefinedNames,
657
+ WorkbookModel,
658
+ Workbook,
659
+ TableStyleProperties,
660
+ TableColumnProperties,
661
+ TableProperties,
662
+ TableColumn,
663
+ Table,
664
+ config,
665
+ stream
666
+ }
667
+ }
668
+
669
+ declare interface ExpressionRuleType extends ConditionalFormattingBaseRule {
670
+ type: 'expression';
671
+ formulae?: any[];
672
+ }
673
+
674
+ declare interface FastCsvFormatterOptionsArgs {
675
+ objectMode: boolean;
676
+ delimiter: string;
677
+ rowDelimiter: string;
678
+ quote: string | boolean;
679
+ escape: string;
680
+ quoteColumns: QuoteColumns;
681
+ quoteHeaders: QuoteColumns;
682
+ headers: null | boolean | string[];
683
+ includeEndRowDelimiter: boolean;
684
+ writeBOM: boolean;
685
+ transform: RowTransformFunction;
686
+ alwaysWriteHeaders: boolean;
687
+ }
688
+
689
+ declare interface FastCsvParserOptionsArgs {
690
+ objectMode: boolean;
691
+ delimiter: string;
692
+ quote: string | null;
693
+ escape: string;
694
+ headers: boolean | HeaderTransformFunction | HeaderArray;
695
+ renameHeaders: boolean;
696
+ ignoreEmpty: boolean;
697
+ comment: string;
698
+ strictColumnHandling: boolean;
699
+ discardUnmappedColumns: boolean;
700
+ trim: boolean;
701
+ ltrim: boolean;
702
+ rtrim: boolean;
703
+ encoding: string;
704
+ maxRows: number;
705
+ skipLines: number;
706
+ skipRows: number;
707
+ }
708
+
709
+ declare type Fill = FillPattern | FillGradientAngle | FillGradientPath;
710
+
711
+ declare interface FillGradientAngle {
712
+ type: 'gradient';
713
+ gradient: 'angle';
714
+
715
+ /**
716
+ * For 'angle' gradient, specifies the direction of the gradient. 0 is from the left to the right.
717
+ * Values from 1 - 359 rotates the direction clockwise
718
+ */
719
+ degree: number;
720
+
721
+ /**
722
+ * Specifies the gradient colour sequence. Is an array of objects containing position and
723
+ * color starting with position 0 and ending with position 1.
724
+ * Intermediary positions may be used to specify other colours on the path.
725
+ */
726
+ stops: GradientStop[];
727
+ }
728
+
729
+ declare interface FillGradientPath {
730
+ type: 'gradient';
731
+ gradient: 'path';
732
+
733
+ /**
734
+ * For 'path' gradient. Specifies the relative coordinates for the start of the path.
735
+ * 'left' and 'top' values range from 0 to 1
736
+ */
737
+ center: { left: number; top: number };
738
+
739
+ /**
740
+ * Specifies the gradient colour sequence. Is an array of objects containing position and
741
+ * color starting with position 0 and ending with position 1.
742
+ * Intermediary positions may be used to specify other colours on the path.
743
+ */
744
+ stops: GradientStop[];
745
+ }
746
+
747
+ declare interface FillPattern {
748
+ type: 'pattern';
749
+ pattern: FillPatterns;
750
+ fgColor?: Partial<Color>;
751
+ bgColor?: Partial<Color>;
752
+ }
753
+
754
+ declare type FillPatterns =
755
+ | 'none' | 'solid'
756
+ | 'darkVertical' | 'darkHorizontal' | 'darkGrid' | 'darkTrellis' | 'darkDown' | 'darkUp'
757
+ | 'lightVertical' | 'lightHorizontal' | 'lightGrid' | 'lightTrellis' | 'lightDown' | 'lightUp'
758
+ | 'darkGray' | 'mediumGray' | 'lightGray' | 'gray125' | 'gray0625';
759
+
760
+ declare interface Font {
761
+ name: string;
762
+ size: number;
763
+ family: number;
764
+ scheme: 'minor' | 'major' | 'none';
765
+ charset: number;
766
+ color: Partial<Color>;
767
+ bold: boolean;
768
+ italic: boolean;
769
+ underline: boolean | 'none' | 'single' | 'double' | 'singleAccounting' | 'doubleAccounting';
770
+ vertAlign: 'superscript' | 'subscript';
771
+ strike: boolean;
772
+ outline: boolean;
773
+ }
774
+
775
+ declare enum FormulaType {
776
+ None = 0,
777
+ Master = 1,
778
+ Shared = 2
779
+ }
780
+
781
+ declare interface GradientStop {
782
+ position: number;
783
+ color: Partial<Color>;
784
+ }
785
+
786
+ declare interface GridCell {
787
+ text?: string;
788
+ rawText?: string;
789
+ /** 原始值,仅供 Excel raw 模式消费;不参与预览、分页与 PDF 绘制。 */
790
+ value?: string | number | boolean | null;
791
+ /** Excel 数字格式(例如 #,##0.00 / 0.00%),不改变 text。 */
792
+ numberFormat?: string;
793
+ children?: PlanComponent[];
794
+ colSpan?: number;
795
+ rowSpan?: number;
796
+ style?: ComponentStyle;
797
+ }
798
+
799
+ declare type HeaderArray = (string | undefined | null)[];
800
+
801
+ declare interface HeaderFooter {
802
+ /**
803
+ * Set the value of differentFirst as true, which indicates that headers/footers for first page are different from the other pages, `false` by default
804
+ */
805
+ differentFirst: boolean,
806
+ /**
807
+ * Set the value of differentOddEven as true, which indicates that headers/footers for odd and even pages are different, `false` by default
808
+ */
809
+ differentOddEven: boolean,
810
+ /**
811
+ * Set header string for odd pages, could format the string and `null` by default
812
+ */
813
+ oddHeader: string,
814
+ /**
815
+ * Set footer string for odd pages, could format the string and `null` by default
816
+ */
817
+ oddFooter: string,
818
+ /**
819
+ * Set header string for even pages, could format the string and `null` by default
820
+ */
821
+ evenHeader: string,
822
+ /**
823
+ * Set footer string for even pages, could format the string and `null` by default
824
+ */
825
+ evenFooter: string,
826
+ /**
827
+ * Set header string for the first page, could format the string and `null` by default
828
+ */
829
+ firstHeader: string,
830
+ /**
831
+ * Set footer string for the first page, could format the string and `null` by default
832
+ */
833
+ firstFooter: string
834
+ }
835
+
836
+ declare type HeaderTransformFunction = (headers: HeaderArray) => HeaderArray;
837
+
838
+ declare interface IAnchor {
839
+ col: number;
840
+ row: number;
841
+ nativeCol: number;
842
+ nativeRow: number;
843
+ nativeColOff: number;
844
+ nativeRowOff: number;
845
+ }
846
+
847
+ declare interface IconSetRuleType extends ConditionalFormattingBaseRule {
848
+ type: 'iconSet';
849
+ showValue?: boolean;
850
+ reverse?: boolean;
851
+ custom?: boolean;
852
+ iconSet?: IconSetTypes;
853
+ cfvo?: Cvfo[];
854
+ }
855
+
856
+ declare type IconSetTypes = '5Arrows' | '5ArrowsGray' | '5Boxes' | '5Quarters' | '5Rating' | '4Arrows' | '4ArrowsGray'
857
+ | '4Rating' | '4RedToBlack' | '4TrafficLights' | 'NoIcons' | '3Arrows' | '3ArrowsGray' | '3Flags' | '3Signs'
858
+ | '3Stars' | '3Symbols' | '3Symbols2' | '3TrafficLights1' | '3TrafficLights2' | '3Triangles';
859
+
860
+ declare interface Image_2 {
861
+ extension: 'jpeg' | 'png' | 'gif';
862
+ base64?: string;
863
+ filename?: string;
864
+ buffer?: Buffer_2;
865
+ }
866
+
867
+ declare interface ImageHyperlinkValue {
868
+ hyperlink: string;
869
+ tooltip?: string;
870
+ }
871
+
872
+ declare interface ImagePosition {
873
+ tl: { col: number; row: number };
874
+ ext: { width: number; height: number };
875
+ }
876
+
877
+ declare interface ImageRange {
878
+ tl: Anchor;
879
+ br: Anchor;
880
+ }
881
+
882
+ declare interface JSZipGeneratorOptions {
883
+ /**
884
+ * @default DEFLATE
885
+ */
886
+ compression: 'STORE' | 'DEFLATE';
887
+ compressionOptions: null | {
888
+ /**
889
+ * @default 6
890
+ */
891
+ level: number;
892
+ };
893
+ }
894
+
895
+ declare interface Location_2 {
896
+ top: number;
897
+ left: number;
898
+ bottom: number;
899
+ right: number;
900
+ }
901
+
902
+ declare interface Margins {
903
+ top: number;
904
+ left: number;
905
+ bottom: number;
906
+ right: number;
907
+ header: number;
908
+ footer: number;
909
+ }
910
+
911
+ declare interface Media {
912
+ type: string; // image,background
913
+ name: string;
914
+ extension: string;
915
+ buffer: Buffer_2;
916
+ }
917
+
918
+ declare interface PageSetup {
919
+ /**
920
+ * Whitespace on the borders of the page. Units are inches.
921
+ */
922
+ margins: Margins;
923
+
924
+ /**
925
+ * Orientation of the page - i.e. taller (`'portrait'`) or wider (`'landscape'`).
926
+ *
927
+ * `'portrait'` by default
928
+ */
929
+ orientation: 'portrait' | 'landscape';
930
+
931
+ /**
932
+ * Horizontal Dots per Inch. Default value is 4294967295
933
+ */
934
+ horizontalDpi: number;
935
+
936
+ /**
937
+ * Vertical Dots per Inch. Default value is 4294967295
938
+ */
939
+ verticalDpi: number;
940
+
941
+ /**
942
+ * Whether to use fitToWidth and fitToHeight or scale settings.
943
+ *
944
+ * Default is based on presence of these settings in the pageSetup object - if both are present,
945
+ * scale wins (i.e. default will be false)
946
+ */
947
+ fitToPage: boolean;
948
+
949
+ /**
950
+ * How many pages wide the sheet should print on to. Active when fitToPage is true
951
+ *
952
+ * Default is 1
953
+ */
954
+ fitToWidth: number;
955
+
956
+ /**
957
+ * How many pages high the sheet should print on to. Active when fitToPage is true
958
+ *
959
+ * Default is 1
960
+ */
961
+ fitToHeight: number;
962
+
963
+ /**
964
+ * Percentage value to increase or reduce the size of the print. Active when fitToPage is false
965
+ *
966
+ * Default is 100
967
+ */
968
+ scale: number;
969
+
970
+ /**
971
+ * Which order to print the pages.
972
+ *
973
+ * Default is `downThenOver`
974
+ */
975
+ pageOrder: 'downThenOver' | 'overThenDown';
976
+
977
+ /**
978
+ * Print without colour
979
+ *
980
+ * false by default
981
+ */
982
+ blackAndWhite: boolean;
983
+
984
+ /**
985
+ * Print with less quality (and ink)
986
+ *
987
+ * false by default
988
+ */
989
+ draft: boolean;
990
+
991
+ /**
992
+ * Where to place comments
993
+ *
994
+ * Default is `None`
995
+ */
996
+ cellComments: 'atEnd' | 'asDisplayed' | 'None';
997
+
998
+ /**
999
+ * Where to show errors
1000
+ *
1001
+ * Default is `displayed`
1002
+ */
1003
+ errors: 'dash' | 'blank' | 'NA' | 'displayed';
1004
+
1005
+ /**
1006
+ * What paper size to use (see below)
1007
+ *
1008
+ * | Name | Value |
1009
+ * | ----------------------------- | --------- |
1010
+ * | Letter | `undefined` |
1011
+ * | Legal | `5` |
1012
+ * | Executive | `7` |
1013
+ * | A4 | `9` |
1014
+ * | A5 | `11` |
1015
+ * | B5 (JIS) | `13` |
1016
+ * | Envelope #10 | `20` |
1017
+ * | Envelope DL | `27` |
1018
+ * | Envelope C5 | `28` |
1019
+ * | Envelope B5 | `34` |
1020
+ * | Envelope Monarch | `37` |
1021
+ * | Double Japan Postcard Rotated | `82` |
1022
+ * | 16K 197x273 mm | `119` |
1023
+ */
1024
+ paperSize: PaperSize;
1025
+
1026
+ /**
1027
+ * Whether to show the row numbers and column letters, `false` by default
1028
+ */
1029
+ showRowColHeaders: boolean;
1030
+
1031
+ /**
1032
+ * Whether to show grid lines, `false` by default
1033
+ */
1034
+ showGridLines: boolean;
1035
+
1036
+ /**
1037
+ * Which number to use for the first page
1038
+ */
1039
+ firstPageNumber: number;
1040
+
1041
+ /**
1042
+ * Whether to center the sheet data horizontally, `false` by default
1043
+ */
1044
+ horizontalCentered: boolean;
1045
+
1046
+ /**
1047
+ * Whether to center the sheet data vertically, `false` by default
1048
+ */
1049
+ verticalCentered: boolean;
1050
+
1051
+ /**
1052
+ * Set Print Area for a sheet, e.g. `'A1:G20'`
1053
+ */
1054
+ printArea: string;
1055
+
1056
+ /**
1057
+ * Repeat specific rows on every printed page, e.g. `'1:3'`
1058
+ */
1059
+ printTitlesRow: string;
1060
+
1061
+ /**
1062
+ * Repeat specific columns on every printed page, e.g. `'A:C'`
1063
+ */
1064
+ printTitlesColumn: string;
1065
+ }
1066
+
1067
+ declare const enum PaperSize {
1068
+ Legal = 5,
1069
+ Executive = 7,
1070
+ A4 = 9,
1071
+ A5 = 11,
1072
+ B5 = 13,
1073
+ Envelope_10 = 20,
1074
+ Envelope_DL = 27,
1075
+ Envelope_C5 = 28,
1076
+ Envelope_B5 = 34,
1077
+ Envelope_Monarch = 37,
1078
+ Double_Japan_Postcard_Rotated = 82,
1079
+ K16_197x273_mm = 119,
1080
+ }
1081
+
1082
+ declare interface PlanComponent {
1083
+ kind: ComponentKind;
1084
+ leftMm: number;
1085
+ topMm: number;
1086
+ widthMm: number;
1087
+ heightMm: number;
1088
+ nid?: string;
1089
+ rkey?: string;
1090
+ text?: string;
1091
+ rawText?: string;
1092
+ lines?: string[];
1093
+ richParagraphs?: RichParagraph[];
1094
+ imageData?: string;
1095
+ grid?: PlanGrid;
1096
+ style?: ComponentStyle;
1097
+ meta?: Record<string, unknown>;
1098
+ /** MachReport 扩展字段:未知 kind 的兜底渲染标记 */
1099
+ fallbackText?: string;
1100
+ }
1101
+
1102
+ declare interface PlanGrid {
1103
+ /** 行内允许 null 空位;渲染器按空单元格处理 */
1104
+ cells: (GridCell | null)[][];
1105
+ colWidthsMm?: number[];
1106
+ rowHeightsMm?: number[];
1107
+ gapMm?: number;
1108
+ }
1109
+
1110
+ declare interface PlanPage {
1111
+ pageWidthMm: number;
1112
+ pageHeightMm: number;
1113
+ marginTopMm?: number;
1114
+ marginBottomMm?: number;
1115
+ marginLeftMm?: number;
1116
+ marginRightMm?: number;
1117
+ components: PlanComponent[];
1118
+ }
1119
+
1120
+ declare interface Protection {
1121
+ locked: boolean;
1122
+ hidden: boolean;
1123
+ }
1124
+
1125
+ declare interface QuoteColumnMap {
1126
+ [s: string]: boolean;
1127
+ }
1128
+
1129
+ declare type QuoteColumns = boolean | boolean[] | QuoteColumnMap;
1130
+
1131
+ declare interface Range_2 extends Location_2 {
1132
+ sheetName: string;
1133
+
1134
+ tl: string;
1135
+ $t$l: string;
1136
+
1137
+ br: string;
1138
+ $b$r: string;
1139
+
1140
+ range: string;
1141
+ $range: string;
1142
+
1143
+ shortRange: string;
1144
+ $shortRange: string;
1145
+
1146
+ count: number;
1147
+
1148
+ decode(): void;
1149
+ decode(v: Range_2): void;
1150
+ decode(v: string): void;
1151
+ decode(v: Location_2): void;
1152
+ decode(top: number, left: number, bottom: number, right: number, sheetName?: string): void;
1153
+ decode(tl: string, br: string, sheetName?: string): void;
1154
+ decode(v: [string, string]): void;
1155
+ decode(v: [string, string, string]): void;
1156
+ decode(v: [number, number, number, number]): void;
1157
+ decode(v: [number, number, number, number, string]): void;
1158
+
1159
+ expand(top: number, left: number, bottom: number, right: number): void;
1160
+
1161
+ expandRow(row: Row): void;
1162
+
1163
+ expandToAddress(addressStr: string): void;
1164
+
1165
+ toString(): string;
1166
+
1167
+ intersects(other: Range_2): boolean;
1168
+
1169
+ contains(addressStr: string): boolean;
1170
+
1171
+ containsEx(address: Partial<{
1172
+ sheetName: string;
1173
+ row: number;
1174
+ col: number;
1175
+ }>): boolean;
1176
+ }
1177
+
1178
+ declare enum ReadingOrder {
1179
+ LeftToRight = 1,
1180
+ RightToLeft = 2,
1181
+ }
1182
+
1183
+ declare enum RelationshipType {
1184
+ None = 0,
1185
+ OfficeDocument = 1,
1186
+ Worksheet = 2,
1187
+ CalcChain = 3,
1188
+ SharedStrings = 4,
1189
+ Styles = 5,
1190
+ Theme = 6,
1191
+ Hyperlink = 7
1192
+ }
1193
+
1194
+ declare interface RenderPlan {
1195
+ schemaVersion: string;
1196
+ pages: PlanPage[];
1197
+ }
1198
+
1199
+ export declare function renderPlanToXlsx(plan: RenderPlan, options?: XlsxRenderOptions): Promise<XlsxRenderResult>;
1200
+
1201
+ declare interface RichParagraph {
1202
+ segments: RichSegment[];
1203
+ align?: ComponentStyle["align"];
1204
+ lineHeight?: number;
1205
+ spaceBeforeMm?: number;
1206
+ spaceAfterMm?: number;
1207
+ indentMm?: number;
1208
+ }
1209
+
1210
+ declare interface RichSegment {
1211
+ kind?: "text" | "field";
1212
+ text?: string;
1213
+ field?: string;
1214
+ style?: ComponentStyle;
1215
+ }
1216
+
1217
+ declare interface RichText {
1218
+ text: string;
1219
+ font?: Partial<Font>;
1220
+ }
1221
+
1222
+ declare interface Row extends Style {
1223
+ readonly worksheet: Worksheet;
1224
+ readonly hasValues: boolean;
1225
+ readonly dimensions: number;
1226
+ model: Partial<RowModel> | null;
1227
+ /**
1228
+ * Set a specific row height
1229
+ */
1230
+ height: number;
1231
+
1232
+ /**
1233
+ * Make row hidden
1234
+ */
1235
+ hidden: boolean;
1236
+
1237
+ /**
1238
+ * Get a row as a sparse array
1239
+ */
1240
+ // readonly values: CellValue[];
1241
+ values: CellValue[] | { [key: string]: CellValue };
1242
+
1243
+ /**
1244
+ * Set an outline level for rows
1245
+ */
1246
+ outlineLevel?: number;
1247
+
1248
+ /**
1249
+ * The row number
1250
+ */
1251
+ readonly number: number;
1252
+
1253
+ /**
1254
+ * Indicate the collapsed state based on outlineLevel
1255
+ */
1256
+ readonly collapsed: boolean;
1257
+
1258
+ /**
1259
+ * Number of cells including empty ones
1260
+ */
1261
+ readonly cellCount: number;
1262
+
1263
+ /**
1264
+ * Number of non-empty cells
1265
+ */
1266
+ readonly actualCellCount: number;
1267
+
1268
+ /**
1269
+ * Get cell by number, column letter or column key
1270
+ */
1271
+ getCell(indexOrKey: number | string): Cell;
1272
+
1273
+ findCell(colNumber: number): Cell | undefined;
1274
+
1275
+ getCellEx(address: Address): Cell;
1276
+
1277
+ /**
1278
+ * Iterate over all non-null cells in a row
1279
+ */
1280
+ eachCell(callback: (cell: Cell, colNumber: number) => void): void;
1281
+
1282
+ /**
1283
+ * Iterate over all cells in a row (including empty cells)
1284
+ */
1285
+ eachCell(opt: { includeEmpty: boolean }, callback: (cell: Cell, colNumber: number) => void): void;
1286
+
1287
+ /**
1288
+ * Cut one or more cells (cells to the right are shifted left)
1289
+ *
1290
+ * Note: this operation will not affect other rows
1291
+ */
1292
+ splice(start: number, count: number, ...insert: any[]): void;
1293
+
1294
+ /**
1295
+ * Commit a completed row to stream
1296
+ */
1297
+ commit(): void;
1298
+ destroy(): void;
1299
+ addPageBreak(lft?: number, rght?: number): void;
1300
+ }
1301
+
1302
+ declare type RowArray = string[];
1303
+
1304
+ declare interface RowBreak {
1305
+ id: number;
1306
+ max: number;
1307
+ min: number;
1308
+ man: number;
1309
+ }
1310
+
1311
+ declare type RowHashArray = [string, any][];
1312
+
1313
+ declare interface RowMap {
1314
+ [key: string]: any;
1315
+ }
1316
+
1317
+ declare interface RowModel {
1318
+ cells: CellModel[];
1319
+ number: number;
1320
+ min: number;
1321
+ max: number;
1322
+ height: number;
1323
+ style: Partial<Style>;
1324
+ hidden: boolean;
1325
+ outlineLevel: number;
1326
+ collapsed: boolean;
1327
+ }
1328
+
1329
+ declare type Rows = RowArray | RowMap | RowHashArray;
1330
+
1331
+ declare type RowTransformCallback = (error?: Error | null, row?: Rows) => void;
1332
+
1333
+ declare interface RowTransformFunction {
1334
+ (row: Rows, callback: RowTransformCallback): void;
1335
+ (row: Rows): Rows;
1336
+ }
1337
+
1338
+ declare type RowValues = CellValue[] | { [key: string]: CellValue } | undefined | null;
1339
+
1340
+ declare namespace stream {
1341
+ namespace xlsx {
1342
+ interface WorkbookWriterOptions {
1343
+ /**
1344
+ * Specifies a writable stream to write the XLSX workbook to.
1345
+ */
1346
+ stream: Stream;
1347
+
1348
+ /**
1349
+ * If stream not specified, this field specifies the path to a file to write the XLSX workbook to.
1350
+ */
1351
+ filename: string;
1352
+
1353
+ /**
1354
+ * Specifies whether to use shared strings in the workbook. Default is false
1355
+ */
1356
+ useSharedStrings: boolean;
1357
+
1358
+ /**
1359
+ * Specifies whether to add style information to the workbook.
1360
+ * Styles can add some performance overhead. Default is false
1361
+ */
1362
+ useStyles: boolean;
1363
+ }
1364
+
1365
+ interface ArchiverZipOptions {
1366
+ comment: string;
1367
+ forceLocalTime: boolean;
1368
+ forceZip64: boolean;
1369
+ store: boolean;
1370
+ zlib: Partial<ZlibOptions>;
1371
+ }
1372
+
1373
+ interface ZlibOptions {
1374
+ /**
1375
+ * @default constants.Z_NO_FLUSH
1376
+ */
1377
+ flush: number;
1378
+ /**
1379
+ * @default constants.Z_FINISH
1380
+ */
1381
+ finishFlush: number;
1382
+ /**
1383
+ * @default 16*1024
1384
+ */
1385
+ chunkSize: number;
1386
+ windowBits: number;
1387
+ level: number; // compression only
1388
+ memLevel: number; // compression only
1389
+ strategy: number; // compression only
1390
+ dictionary: Buffer_2 | NodeJS.TypedArray | DataView | ArrayBuffer; // deflate/inflate only, empty dictionary by default
1391
+ }
1392
+
1393
+ interface WorkbookStreamWriterOptions extends WorkbookWriterOptions {
1394
+
1395
+ /**
1396
+ * Specifies whether to add style information to the workbook.
1397
+ * Styles can add some performance overhead. Default is false
1398
+ */
1399
+ zip: Partial<ArchiverZipOptions>;
1400
+ }
1401
+
1402
+ class WorkbookWriter extends Workbook {
1403
+ constructor(options: Partial<WorkbookStreamWriterOptions>);
1404
+ // commit all worksheets, then add suplimentary files
1405
+ commit(): Promise<void>;
1406
+ addStyles(): Promise<void>;
1407
+ addThemes(): Promise<void>;
1408
+ addOfficeRels(): Promise<void>;
1409
+ addContentTypes(): Promise<void>;
1410
+ addApp(): Promise<void>;
1411
+ addCore(): Promise<void>;
1412
+ addSharedStrings(): Promise<void>;
1413
+ addWorkbookRels(): Promise<void>;
1414
+ addWorkbook(): Promise<void>;
1415
+ }
1416
+
1417
+
1418
+ interface WorkbookStreamReaderOptions {
1419
+ /**
1420
+ * @default 'emit'
1421
+ */
1422
+ worksheets?: 'emit' | 'ignore';
1423
+ /**
1424
+ * @default 'cache'
1425
+ */
1426
+ sharedStrings?: 'cache' | 'emit' | 'ignore';
1427
+ /**
1428
+ * @default 'ignore'
1429
+ */
1430
+ hyperlinks?: 'cache' | 'emit' | 'ignore';
1431
+ /**
1432
+ * @default 'ignore'
1433
+ */
1434
+ styles?: 'cache' | 'ignore';
1435
+ /**
1436
+ * @default 'ignore'
1437
+ */
1438
+ entries?: 'emit' | 'ignore';
1439
+ }
1440
+
1441
+ class WorkbookReader extends Workbook {
1442
+ constructor(input: string | Stream, options: Partial<WorkbookStreamReaderOptions>);
1443
+ read(): Promise<void>;
1444
+ [Symbol.asyncIterator](): AsyncGenerator<WorksheetReader>;
1445
+ parse(): AsyncIterator<any>;
1446
+ }
1447
+
1448
+ interface WorksheetReaderOptions {
1449
+ workbook: Workbook;
1450
+ id: number;
1451
+ entry: Stream;
1452
+ options: WorkbookStreamReaderOptions;
1453
+ }
1454
+
1455
+ class WorksheetReader {
1456
+ constructor(options: WorksheetReaderOptions);
1457
+ read(): Promise<void>;
1458
+ [Symbol.asyncIterator](): AsyncGenerator<Row>;
1459
+ parse(): AsyncIterator<Array<any>>;
1460
+ dimensions(): number;
1461
+ columns(): number;
1462
+ getColumn(c: number): Column;
1463
+ }
1464
+ }
1465
+ }
1466
+
1467
+ declare interface Style {
1468
+ numFmt: string;
1469
+ font: Partial<Font>;
1470
+ alignment: Partial<Alignment>;
1471
+ protection: Partial<Protection>;
1472
+ border: Partial<Borders>;
1473
+ fill: Fill;
1474
+ }
1475
+
1476
+ declare interface Table extends Required<TableProperties> {
1477
+ /**
1478
+ * Commit changes
1479
+ */
1480
+ commit: () => void
1481
+ /**
1482
+ * Remove a rows of data
1483
+ */
1484
+ removeRows: (rowIndex: number, count: number) => void
1485
+ /**
1486
+ * Add a row of data, either insert at rowNumber or append
1487
+ */
1488
+ addRow: (values: any[], rowNumber?: number) => void
1489
+ /**
1490
+ * Get column
1491
+ */
1492
+ getColumn: (colIndex: number) => TableColumn
1493
+ /**
1494
+ * Add a new column, including column defn and values
1495
+ * inserts at colNumber or adds to the right
1496
+ */
1497
+ addColumn: (column: TableColumnProperties, values: any[], colIndex: number) => void
1498
+ /**
1499
+ * Remove a column with data
1500
+ */
1501
+ removeColumns: (colIndex: number, count: number) => void
1502
+ }
1503
+
1504
+ declare type TableColumn = Required<TableColumnProperties>
1505
+
1506
+ declare interface TableColumnProperties {
1507
+ /**
1508
+ * The name of the column, also used in the header
1509
+ */
1510
+ name: string;
1511
+ /**
1512
+ * Switches the filter control in the header
1513
+ * @default false
1514
+ */
1515
+ filterButton?: boolean;
1516
+ /**
1517
+ * Label to describe the totals row (first column)
1518
+ * @default 'Total'
1519
+ */
1520
+ totalsRowLabel?: string;
1521
+ /**
1522
+ * Name of the totals function
1523
+ * @default 'none'
1524
+ */
1525
+ totalsRowFunction?: 'none' | 'average' | 'countNums' | 'count' | 'max' | 'min' | 'stdDev' | 'var' | 'sum' | 'custom';
1526
+ /**
1527
+ * Optional formula for custom functions
1528
+ */
1529
+ totalsRowFormula?: string;
1530
+ }
1531
+
1532
+ declare interface TableProperties {
1533
+ /**
1534
+ * The name of the table
1535
+ */
1536
+ name: string;
1537
+ /**
1538
+ * The display name of the table
1539
+ */
1540
+ displayName?: string;
1541
+ /**
1542
+ * Top left cell of the table
1543
+ */
1544
+ ref: string;
1545
+ /**
1546
+ * Show headers at top of table
1547
+ * @default true
1548
+ */
1549
+ headerRow?: boolean;
1550
+ /**
1551
+ * Show totals at bottom of table
1552
+ * @default false
1553
+ */
1554
+ totalsRow?: boolean;
1555
+ /**
1556
+ * Extra style properties
1557
+ * @default {}
1558
+ */
1559
+ style?: TableStyleProperties;
1560
+ /**
1561
+ * Column definitions
1562
+ */
1563
+ columns: TableColumnProperties[]
1564
+ /**
1565
+ * Rows of data
1566
+ */
1567
+ rows: any[][]
1568
+ }
1569
+
1570
+ declare interface TableStyleProperties {
1571
+ /**
1572
+ * The colour theme of the table
1573
+ * @default 'TableStyleMedium2'
1574
+ */
1575
+ theme?: 'TableStyleDark1' | 'TableStyleDark10' | 'TableStyleDark11' | 'TableStyleDark2' | 'TableStyleDark3' | 'TableStyleDark4' | 'TableStyleDark5' | 'TableStyleDark6' | 'TableStyleDark7' | 'TableStyleDark8' | 'TableStyleDark9' | 'TableStyleLight1' | 'TableStyleLight10' | 'TableStyleLight11' | 'TableStyleLight12' | 'TableStyleLight13' | 'TableStyleLight14' | 'TableStyleLight15' | 'TableStyleLight16' | 'TableStyleLight17' | 'TableStyleLight18' | 'TableStyleLight19' | 'TableStyleLight2' | 'TableStyleLight20' | 'TableStyleLight21' | 'TableStyleLight3' | 'TableStyleLight4' | 'TableStyleLight5' | 'TableStyleLight6' | 'TableStyleLight7' | 'TableStyleLight8' | 'TableStyleLight9' | 'TableStyleMedium1' | 'TableStyleMedium10' | 'TableStyleMedium11' | 'TableStyleMedium12' | 'TableStyleMedium13' | 'TableStyleMedium14' | 'TableStyleMedium15' | 'TableStyleMedium16' | 'TableStyleMedium17' | 'TableStyleMedium18' | 'TableStyleMedium19' | 'TableStyleMedium2' | 'TableStyleMedium20' | 'TableStyleMedium21' | 'TableStyleMedium22' | 'TableStyleMedium23' | 'TableStyleMedium24' | 'TableStyleMedium25' | 'TableStyleMedium26' | 'TableStyleMedium27' | 'TableStyleMedium28' | 'TableStyleMedium3' | 'TableStyleMedium4' | 'TableStyleMedium5' | 'TableStyleMedium6' | 'TableStyleMedium7' | 'TableStyleMedium8' | 'TableStyleMedium9';
1576
+ /**
1577
+ * Highlight the first column (bold)
1578
+ * @default false
1579
+ */
1580
+ showFirstColumn?: boolean;
1581
+ /**
1582
+ * Highlight the last column (bold)
1583
+ * @default false
1584
+ */
1585
+ showLastColumn?: boolean;
1586
+ /**
1587
+ * Alternate rows shown with background colour
1588
+ * @default false
1589
+ */
1590
+ showRowStripes?: boolean;
1591
+ /**
1592
+ * Alternate rows shown with background colour
1593
+ * @default false
1594
+ */
1595
+ showColumnStripes?: boolean;
1596
+ }
1597
+
1598
+ declare interface TimePeriodRuleType extends ConditionalFormattingBaseRule {
1599
+ type: 'timePeriod';
1600
+ timePeriod?: TimePeriodTypes;
1601
+ }
1602
+
1603
+ declare type TimePeriodTypes = 'lastWeek' | 'thisWeek' | 'nextWeek' | 'yesterday' | 'today' | 'tomorrow' | 'last7Days' | 'lastMonth'
1604
+ | 'thisMonth' | 'nextMonth';
1605
+
1606
+ declare interface Top10RuleType extends ConditionalFormattingBaseRule {
1607
+ type: 'top10';
1608
+ rank: number;
1609
+ percent: boolean;
1610
+ bottom: boolean;
1611
+ }
1612
+
1613
+ declare enum ValueType {
1614
+ Null = 0,
1615
+ Merge = 1,
1616
+ Number = 2,
1617
+ String = 3,
1618
+ Date = 4,
1619
+ Hyperlink = 5,
1620
+ Formula = 6,
1621
+ SharedString = 7,
1622
+ RichText = 8,
1623
+ Boolean = 9,
1624
+ Error = 10
1625
+ }
1626
+
1627
+ declare class Workbook {
1628
+ category: string;
1629
+ company: string;
1630
+ creator: string;
1631
+ description: string;
1632
+ keywords: string;
1633
+ lastModifiedBy: string;
1634
+ created: Date;
1635
+ manager: string;
1636
+ modified: Date;
1637
+ lastPrinted: Date;
1638
+ properties: WorkbookProperties;
1639
+ subject: string;
1640
+ title: string;
1641
+
1642
+ /**
1643
+ * Workbook calculation Properties
1644
+ */
1645
+ calcProperties: CalculationProperties;
1646
+
1647
+ /**
1648
+ * xlsx file format operations
1649
+ */
1650
+ readonly xlsx: Xlsx;
1651
+
1652
+ /**
1653
+ * csv file format operations
1654
+ */
1655
+ readonly csv: Csv;
1656
+
1657
+ readonly nextId: number;
1658
+
1659
+ readonly definedNames: DefinedNames;
1660
+
1661
+ model: WorkbookModel;
1662
+
1663
+ /**
1664
+ * The Workbook views controls how many separate windows Excel will open when viewing the workbook.
1665
+ */
1666
+ views: WorkbookView[];
1667
+
1668
+ /**
1669
+ * return a clone of worksheets in order
1670
+ */
1671
+ worksheets: Worksheet[];
1672
+
1673
+ /**
1674
+ * Add a new worksheet and return a reference to it
1675
+ */
1676
+ addWorksheet(name?: string, options?: Partial<AddWorksheetOptions>): Worksheet;
1677
+
1678
+ removeWorksheetEx(worksheet: Worksheet): void;
1679
+ removeWorksheet(indexOrName: number | string): void;
1680
+
1681
+ /**
1682
+ * fetch sheet by name or id
1683
+ */
1684
+ getWorksheet(indexOrName?: number | string): Worksheet | undefined;
1685
+
1686
+ /**
1687
+ * Iterate over all sheets.
1688
+ *
1689
+ * Note: `workbook.worksheets.forEach` will still work but this is better.
1690
+ */
1691
+ eachSheet(callback: (worksheet: Worksheet, id: number) => void): void;
1692
+
1693
+ clearThemes(): void;
1694
+
1695
+ /**
1696
+ * Add Image to Workbook and return the id
1697
+ */
1698
+ addImage(img: Image_2): number;
1699
+
1700
+ getImage(id: number): Image_2;
1701
+ }
1702
+
1703
+ declare interface WorkbookModel {
1704
+ creator: string;
1705
+ lastModifiedBy: string;
1706
+ lastPrinted: Date;
1707
+ created: Date;
1708
+ modified: Date;
1709
+ properties: WorkbookProperties;
1710
+ worksheets: Worksheet[];
1711
+ sheets: WorksheetModel[];
1712
+ definedNames: DefinedNamesModel;
1713
+ views: WorkbookView[];
1714
+ company: string;
1715
+ manager: string;
1716
+ title: string;
1717
+ subject: string;
1718
+ keywords: string;
1719
+ category: string;
1720
+ description: string;
1721
+ language: string;
1722
+ revision: Date;
1723
+ contentStatus: string;
1724
+ themes: string[];
1725
+ media: Media[];
1726
+ }
1727
+
1728
+ declare interface WorkbookProperties {
1729
+ /**
1730
+ * Set workbook dates to 1904 date system
1731
+ */
1732
+ date1904: boolean;
1733
+ }
1734
+
1735
+ declare interface WorkbookView {
1736
+ x: number;
1737
+ y: number;
1738
+ width: number;
1739
+ height: number;
1740
+ firstSheet: number;
1741
+ activeTab: number;
1742
+ visibility: string;
1743
+ }
1744
+
1745
+ declare interface Worksheet {
1746
+ readonly id: number;
1747
+ name: string;
1748
+ readonly workbook: Workbook;
1749
+ readonly hasMerges: boolean;
1750
+
1751
+ readonly dimensions: Range_2;
1752
+ /**
1753
+ * Contains information related to how a worksheet is printed
1754
+ */
1755
+ pageSetup: Partial<PageSetup>;
1756
+
1757
+ /**
1758
+ * Worksheet Header and Footer
1759
+ */
1760
+ headerFooter: Partial<HeaderFooter>;
1761
+
1762
+ /**
1763
+ * Worksheet State
1764
+ */
1765
+ state: WorksheetState;
1766
+
1767
+ /**
1768
+ * Worksheet Properties
1769
+ */
1770
+ properties: WorksheetProperties;
1771
+
1772
+ /**
1773
+ * Open panes representing the sheet
1774
+ */
1775
+ views: Array<Partial<WorksheetView>>;
1776
+
1777
+ /**
1778
+ * Apply an auto filter to your worksheet.
1779
+ */
1780
+ autoFilter?: AutoFilter;
1781
+
1782
+ destroy(): void;
1783
+
1784
+ /**
1785
+ * A count of the number of rows that have values. If a mid-document row is empty, it will not be included in the count.
1786
+ */
1787
+ readonly actualRowCount: number;
1788
+
1789
+ /**
1790
+ * The total column size of the document. Equal to the maximum cell count from all of the rows
1791
+ */
1792
+ readonly columnCount: number;
1793
+
1794
+ /**
1795
+ * Get the last column in a worksheet
1796
+ */
1797
+ readonly lastColumn: Column | undefined;
1798
+
1799
+ /**
1800
+ * A count of the number of columns that have values.
1801
+ */
1802
+ readonly actualColumnCount: number;
1803
+
1804
+ getColumnKey(key: string): Column;
1805
+
1806
+ setColumnKey(key: string, value: Column): void;
1807
+
1808
+ deleteColumnKey(key: string): void;
1809
+
1810
+ eachColumnKey(callback: (col: Column, index: number) => void): void;
1811
+
1812
+ /**
1813
+ * Access an individual columns by key, letter and 1-based column number
1814
+ */
1815
+ getColumn(indexOrKey: number | string): Column;
1816
+
1817
+ /**
1818
+ * Cut one or more columns (columns to the right are shifted left)
1819
+ * and optionally insert more
1820
+ *
1821
+ * If column properties have been definde, they will be cut or moved accordingly
1822
+ *
1823
+ * Known Issue: If a splice causes any merged cells to move, the results may be unpredictable
1824
+ *
1825
+ * Also: If the worksheet has more rows than values in the colulmn inserts,
1826
+ * the rows will still be shifted as if the values existed
1827
+ */
1828
+ spliceColumns(start: number, count: number, ...insert: any[][]): void;
1829
+
1830
+ /**
1831
+ * Add column headers and define column keys and widths.
1832
+ *
1833
+ * Note: these column structures are a workbook-building convenience only,
1834
+ * apart from the column width, they will not be fully persisted.
1835
+ */
1836
+ columns: Array<Partial<Column>>;
1837
+
1838
+ /**
1839
+ * The total row size of the document. Equal to the row number of the last row that has values.
1840
+ */
1841
+ readonly rowCount: number;
1842
+
1843
+ /**
1844
+ * Get the last editable row in a worksheet (or undefined if there are none)
1845
+ */
1846
+ readonly lastRow: Row | undefined;
1847
+
1848
+ /**
1849
+ * Tries to find and return row for row no, else undefined
1850
+ *
1851
+ * @param row The 1-index row number
1852
+ */
1853
+ findRow(row: number): Row | undefined;
1854
+
1855
+ /**
1856
+ * Tries to find and return rows for row no start and length, else undefined
1857
+ *
1858
+ * @param start The 1-index starting row number
1859
+ * @param length The length of the expected array
1860
+ */
1861
+ findRows(start: number, length: number): Row[] | undefined;
1862
+
1863
+ /**
1864
+ * Cut one or more rows (rows below are shifted up)
1865
+ * and optionally insert more
1866
+ *
1867
+ * Known Issue: If a splice causes any merged cells to move, the results may be unpredictable
1868
+ */
1869
+ spliceRows(start: number, count: number, ...insert: any[][]): void;
1870
+
1871
+ /**
1872
+ * Add a couple of Rows by key-value, after the last current row, using the column keys,
1873
+ * or add a row by contiguous Array (assign to columns A, B & C)
1874
+ */
1875
+ addRow(data: any[] | any, style?: string): Row;
1876
+
1877
+ /**
1878
+ * Add multiple rows by providing an array of arrays or key-value pairs
1879
+ */
1880
+ addRows(rows: any[], style?: string): Row[];
1881
+
1882
+ /**
1883
+ * Insert a Row by key-value, at the position (shifiting down all rows from position),
1884
+ * using the column keys, or add a row by contiguous Array (assign to columns A, B & C)
1885
+ */
1886
+ insertRow(pos: number, value: any[] | any, style?: string): Row;
1887
+
1888
+ /**
1889
+ * Insert multiple rows at position (shifiting down all rows from position)
1890
+ * by providing an array of arrays or key-value pairs
1891
+ */
1892
+ insertRows(pos: number, values: any[], style?: string): Row[];
1893
+
1894
+ /**
1895
+ * Duplicate rows and insert new rows
1896
+ */
1897
+ duplicateRow(rowNum: number, count: number, insert: boolean): void;
1898
+
1899
+ /**
1900
+ * Get or create row by 1-based index
1901
+ */
1902
+ getRow(index: number): Row;
1903
+
1904
+ /**
1905
+ * Get or create rows by 1-based index
1906
+ */
1907
+ getRows(start: number, length: number): Row[] | undefined;
1908
+
1909
+ /**
1910
+ * Iterate over all rows that have values in a worksheet
1911
+ */
1912
+ eachRow(callback: (row: Row, rowNumber: number) => void): void;
1913
+
1914
+ /**
1915
+ * Iterate over all rows (including empty rows) in a worksheet
1916
+ */
1917
+ eachRow(opt: { includeEmpty: boolean }, callback: (row: Row, rowNumber: number) => void): void;
1918
+
1919
+ /**
1920
+ * return all rows as sparse array
1921
+ */
1922
+ getSheetValues(): RowValues[];
1923
+
1924
+ /**
1925
+ * returns the cell at [r,c] or address given by r. If not found, return undefined
1926
+ */
1927
+ findCell(r: number | string, c: number | string): Cell | undefined;
1928
+
1929
+ /**
1930
+ * Get or create cell
1931
+ */
1932
+ getCell(r: number | string, c?: number | string): Cell;
1933
+
1934
+ /**
1935
+ * Merge cells, either:
1936
+ *
1937
+ * tlbr string, e.g. `'A4:B5'`
1938
+ *
1939
+ * tl string, br string, e.g. `'G10', 'H11'`
1940
+ *
1941
+ * t, l, b, r numbers, e.g. `10,11,12,13`
1942
+ */
1943
+ mergeCells(): void;
1944
+ mergeCells(v: Range_2): void;
1945
+ mergeCells(v: string): void;
1946
+ mergeCells(v: Location_2): void;
1947
+ mergeCells(top: number, left: number, bottom: number, right: number, sheetName?: string): void;
1948
+ mergeCells(tl: string, br: string, sheetName?: string): void;
1949
+ mergeCells(v: [string, string]): void;
1950
+ mergeCells(v: [string, string, string]): void;
1951
+ mergeCells(v: [number, number, number, number]): void;
1952
+ mergeCells(v: [number, number, number, number, string]): void;
1953
+ mergeCellsWithoutStyle(): void;
1954
+ mergeCellsWithoutStyle(v: Range_2): void;
1955
+ mergeCellsWithoutStyle(v: string): void;
1956
+ mergeCellsWithoutStyle(v: Location_2): void;
1957
+ mergeCellsWithoutStyle(top: number, left: number, bottom: number, right: number, sheetName?: string): void;
1958
+ mergeCellsWithoutStyle(tl: string, br: string, sheetName?: string): void;
1959
+ mergeCellsWithoutStyle(v: [string, string]): void;
1960
+ mergeCellsWithoutStyle(v: [string, string, string]): void;
1961
+ mergeCellsWithoutStyle(v: [number, number, number, number]): void;
1962
+ mergeCellsWithoutStyle(v: [number, number, number, number, string]): void;
1963
+
1964
+ /**
1965
+ * unmerging the cells breaks the style links
1966
+ */
1967
+ unMergeCells(): void;
1968
+ unMergeCells(v: Range_2): void;
1969
+ unMergeCells(v: string): void;
1970
+ unMergeCells(v: Location_2): void;
1971
+ unMergeCells(top: number, left: number, bottom: number, right: number, sheetName?: string): void;
1972
+ unMergeCells(tl: string, br: string, sheetName?: string): void;
1973
+ unMergeCells(v: [string, string]): void;
1974
+ unMergeCells(v: [string, string, string]): void;
1975
+ unMergeCells(v: [number, number, number, number]): void;
1976
+ unMergeCells(v: [number, number, number, number, string]): void;
1977
+
1978
+ fillFormula(range: Range_2 | string | Location_2, formula: string, results?: ((r: number, c: number) => string | number) | number[] | number[][]): void;
1979
+
1980
+ /**
1981
+ * Using the image id from `Workbook.addImage`, set the background to the worksheet
1982
+ */
1983
+ addBackgroundImage(imageId: number): void;
1984
+
1985
+ getBackgroundImageId(): string;
1986
+
1987
+ /**
1988
+ * Using the image id from `Workbook.addImage`,
1989
+ * embed an image within the worksheet to cover a range
1990
+ */
1991
+ addImage(imageId: number, range: string | { editAs?: string; } & ImageRange & { hyperlinks?: ImageHyperlinkValue } | { editAs?: string; } & ImagePosition & { hyperlinks?: ImageHyperlinkValue }): void;
1992
+
1993
+ getImages(): Array<{
1994
+ type: 'image',
1995
+ imageId: string;
1996
+ range: ImageRange;
1997
+ }>;
1998
+
1999
+ commit(): void;
2000
+
2001
+ model: WorksheetModel;
2002
+
2003
+ /**
2004
+ * Worksheet protection
2005
+ */
2006
+ protect(password: string, options: Partial<WorksheetProtection>): Promise<void>;
2007
+ unprotect(): void;
2008
+
2009
+ /**
2010
+ * Add a new table and return a reference to it
2011
+ */
2012
+ addTable(tableProperties: TableProperties): Table;
2013
+ /**
2014
+ * fetch table by name or id
2015
+ */
2016
+ getTable(name: string): Table;
2017
+ /**
2018
+ * delete table by name or id
2019
+ */
2020
+ removeTable(name: string): void;
2021
+ /**
2022
+ * fetch table
2023
+ */
2024
+ getTables(): [Table, void][];
2025
+ /**
2026
+ * add conditionalFormattingOptions
2027
+ */
2028
+ addConditionalFormatting(cf: ConditionalFormattingOptions): void;
2029
+
2030
+ /**
2031
+ * delete conditionalFormattingOptions
2032
+ */
2033
+ removeConditionalFormatting(filter: any): void;
2034
+ }
2035
+
2036
+ declare interface WorksheetModel {
2037
+ id: number;
2038
+ name: string;
2039
+ // dataValidations: this.dataValidations.model,
2040
+ properties: WorksheetProperties;
2041
+ pageSetup: Partial<PageSetup>;
2042
+ headerFooter: Partial<HeaderFooter>;
2043
+ rowBreaks: RowBreak[];
2044
+ views: WorksheetView[];
2045
+ autoFilter: AutoFilter;
2046
+ media: Media[];
2047
+ merges: Range_2['range'][];
2048
+ }
2049
+
2050
+ declare interface WorksheetProperties {
2051
+ /**
2052
+ * Color of the tab
2053
+ */
2054
+ tabColor: Partial<Color>;
2055
+
2056
+ /**
2057
+ * The worksheet column outline level (default: 0)
2058
+ */
2059
+ outlineLevelCol: number;
2060
+
2061
+ /**
2062
+ * The worksheet row outline level (default: 0)
2063
+ */
2064
+ outlineLevelRow: number;
2065
+
2066
+ /**
2067
+ * The outline properties which controls how it will summarize rows and columns
2068
+ */
2069
+ outlineProperties: {
2070
+ summaryBelow: boolean,
2071
+ summaryRight: boolean,
2072
+ };
2073
+ /**
2074
+ * Default row height (default: 15)
2075
+ */
2076
+ defaultRowHeight: number;
2077
+
2078
+ /**
2079
+ * Default column width (optional)
2080
+ */
2081
+ defaultColWidth?: number;
2082
+
2083
+ /**
2084
+ * default: 55
2085
+ */
2086
+ dyDescent: number;
2087
+ showGridLines: boolean;
2088
+ }
2089
+
2090
+ declare interface WorksheetProtection {
2091
+ objects: boolean;
2092
+ scenarios: boolean;
2093
+ selectLockedCells: boolean;
2094
+ selectUnlockedCells: boolean;
2095
+ formatCells: boolean;
2096
+ formatColumns: boolean;
2097
+ formatRows: boolean;
2098
+ insertColumns: boolean;
2099
+ insertRows: boolean;
2100
+ insertHyperlinks: boolean;
2101
+ deleteColumns: boolean;
2102
+ deleteRows: boolean;
2103
+ sort: boolean;
2104
+ autoFilter: boolean;
2105
+ pivotTables: boolean;
2106
+ spinCount: number;
2107
+ }
2108
+
2109
+ declare type WorksheetState = 'visible' | 'hidden' | 'veryHidden';
2110
+
2111
+ declare type WorksheetView =
2112
+ & WorksheetViewCommon
2113
+ & (WorksheetViewNormal | WorksheetViewFrozen | WorksheetViewSplit);
2114
+
2115
+ declare interface WorksheetViewCommon {
2116
+ /**
2117
+ * Sets the worksheet view's orientation to right-to-left, `false` by default
2118
+ */
2119
+ rightToLeft: boolean;
2120
+
2121
+ /**
2122
+ * The currently selected cell
2123
+ */
2124
+ activeCell: string;
2125
+
2126
+ /**
2127
+ * Shows or hides the ruler in Page Layout, `true` by default
2128
+ */
2129
+ showRuler: boolean;
2130
+
2131
+ /**
2132
+ * Shows or hides the row and column headers (e.g. A1, B1 at the top and 1,2,3 on the left,
2133
+ * `true` by default
2134
+ */
2135
+ showRowColHeaders: boolean;
2136
+
2137
+ /**
2138
+ * Shows or hides the gridlines (shown for cells where borders have not been defined),
2139
+ * `true` by default
2140
+ */
2141
+ showGridLines: boolean;
2142
+
2143
+ /**
2144
+ * Percentage zoom to use for the view, `100` by default
2145
+ */
2146
+ zoomScale: number;
2147
+
2148
+ /**
2149
+ * Normal zoom for the view, `100` by default
2150
+ */
2151
+ zoomScaleNormal: number;
2152
+ }
2153
+
2154
+ declare interface WorksheetViewFrozen {
2155
+ /**
2156
+ * Where a number of rows and columns to the top and left are frozen in place.
2157
+ * Only the bottom left section will scroll
2158
+ */
2159
+ state: 'frozen';
2160
+
2161
+ /**
2162
+ * Presentation style
2163
+ */
2164
+ style?: 'pageBreakPreview';
2165
+
2166
+ /**
2167
+ * How many columns to freeze. To freeze rows only, set this to 0 or undefined
2168
+ */
2169
+ xSplit?: number;
2170
+
2171
+ /**
2172
+ * How many rows to freeze. To freeze columns only, set this to 0 or undefined
2173
+ */
2174
+ ySplit?: number;
2175
+
2176
+ /**
2177
+ * Which cell will be top-left in the bottom-right pane. Note: cannot be a frozen cell.
2178
+ * Defaults to first unfrozen cell
2179
+ */
2180
+ topLeftCell?: string;
2181
+ }
2182
+
2183
+ declare interface WorksheetViewNormal {
2184
+ /**
2185
+ * Controls the view state
2186
+ */
2187
+ state: 'normal';
2188
+
2189
+ /**
2190
+ * Presentation style
2191
+ */
2192
+ style: 'pageBreakPreview' | 'pageLayout';
2193
+ }
2194
+
2195
+ declare interface WorksheetViewSplit {
2196
+ /**
2197
+ * Where the view is split into 4 sections, each semi-independently scrollable.
2198
+ */
2199
+ state: 'split';
2200
+
2201
+ /**
2202
+ * Presentation style
2203
+ */
2204
+ style?: 'pageBreakPreview' | 'pageLayout';
2205
+
2206
+ /**
2207
+ * How many points from the left to place the splitter.
2208
+ * To split vertically, set this to 0 or undefined
2209
+ */
2210
+ xSplit?: number;
2211
+
2212
+ /**
2213
+ * How many points from the top to place the splitter.
2214
+ * To split horizontally, set this to 0 or undefined
2215
+ */
2216
+ ySplit?: number;
2217
+
2218
+ /**
2219
+ * Which cell will be top-left in the bottom-right pane
2220
+ */
2221
+ topLeftCell?: string;
2222
+
2223
+ /**
2224
+ * Which pane will be active
2225
+ */
2226
+ activePane?: 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight';
2227
+ }
2228
+
2229
+ declare interface Xlsx {
2230
+ /**
2231
+ * read from a file
2232
+ */
2233
+ readFile(path: string, options?: Partial<XlsxReadOptions>): Promise<Workbook>;
2234
+
2235
+ /**
2236
+ * read from a stream
2237
+ * @param stream
2238
+ */
2239
+ read(stream: Stream, options?: Partial<XlsxReadOptions>): Promise<Workbook>;
2240
+
2241
+ /**
2242
+ * load from an array buffer
2243
+ * @param buffer
2244
+ */
2245
+ load(buffer: Buffer_2, options?: Partial<XlsxReadOptions>): Promise<Workbook>;
2246
+
2247
+ /**
2248
+ * write to a buffer
2249
+ */
2250
+ writeBuffer(options?: Partial<XlsxWriteOptions>): Promise<Buffer_2>;
2251
+
2252
+ /**
2253
+ * write to a file
2254
+ */
2255
+ writeFile(path: string, options?: Partial<XlsxWriteOptions>): Promise<void>;
2256
+
2257
+ /**
2258
+ * write to a stream
2259
+ */
2260
+ write(stream: Stream, options?: Partial<XlsxWriteOptions>): Promise<void>;
2261
+ }
2262
+
2263
+ declare interface XlsxReadOptions {
2264
+ /**
2265
+ * The list of XML node names to ignore while parsing an XLSX file
2266
+ */
2267
+ ignoreNodes: string[];
2268
+ }
2269
+
2270
+ /**
2271
+ * RenderPlan → xlsx 导出(B 端第二出口,对齐家族 @agile-team/mach-table-xlsx 路线):
2272
+ * - 网格组件 → 真表格:列宽(mm→Excel 宽度)、行高(mm→pt)、colSpan/rowSpan 合并、
2273
+ * 加粗/对齐/底色/字号直译(resolveGridLayout 复用单真相源几何)
2274
+ * - 文本组件 → 合并标题行(顺序流式输出,保字号/加粗/对齐;非像素级定位,
2275
+ * 目标是"财务能直接用的对账表"而非复刻版面)
2276
+ * - 未支持组件、富文本专有内容与单元格嵌套组件跳过并计入 warnings
2277
+ */
2278
+ export declare interface XlsxRenderOptions {
2279
+ /** 工作表命名(默认 "Sheet1" 起序) */
2280
+ sheetName?: (pageIndex: number) => string;
2281
+ /** 默认 text 保留显示文本;raw 使用列表自动保留的原始数值、布尔、文本与空值。 */
2282
+ valueMode?: "text" | "raw";
2283
+ /** 默认 auto 按计划识别 A3/A4/A5;自定义尺寸回退 A4 并返回告警。 */
2284
+ paperSize?: "auto" | "a3" | "a4" | "a5";
2285
+ }
2286
+
2287
+ export declare interface XlsxRenderResult {
2288
+ workbook: ExcelJS.Workbook;
2289
+ buffer: ExcelJS.Buffer;
2290
+ warnings: string[];
2291
+ }
2292
+
2293
+ declare interface XlsxWriteOptions extends stream.xlsx.WorkbookWriterOptions {
2294
+ /**
2295
+ * The option passed to JsZip#generateAsync(options)
2296
+ */
2297
+ zip: Partial<JSZipGeneratorOptions>;
2298
+ }
2299
+
2300
+ export { }