@jsfkit/types 1.4.1 → 2.0.0-rc1

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 (3) hide show
  1. package/README.md +33 -2
  2. package/dist/index.d.ts +2806 -193
  3. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -9,6 +9,8 @@
9
9
  * | `d` | Date | The {@link Cell.s | cell style} formats the integer cell value as a date |
10
10
  * | `s` | Text | |
11
11
  * | `z` | Empty | Cell is empty |
12
+ *
13
+ * @group Workbooks
12
14
  */
13
15
  type CellValueType = 'b' | 'e' | 'n' | 'd' | 's' | 'z';
14
16
 
@@ -16,6 +18,7 @@ type CellValueType = 'b' | 'e' | 'n' | 'd' | 's' | 'z';
16
18
  * A cell comment.
17
19
  *
18
20
  * @deprecated Use {@link Note | notes} and {@link ThreadedComment | threaded comments} instead.
21
+ * @group Workbooks
19
22
  */
20
23
  type Comment = {
21
24
  /** Author of the comment. */
@@ -33,6 +36,7 @@ type Comment = {
33
36
  * `XFD1048576` inclusive.
34
37
  *
35
38
  * @pattern ^[A-Z]{1,3}[0-9]{1,7}$
39
+ * @group Workbooks
36
40
  */
37
41
  type CellId = string;
38
42
 
@@ -42,12 +46,15 @@ type CellId = string;
42
46
  * The range consists of two {@link CellId | CellIds} separated by a colon (`:`) character.
43
47
  *
44
48
  * @pattern ^([A-Z]{1,3}[0-9]{1,7}):([A-Z]{1,3}[0-9]{1,7})$
49
+ * @group Workbooks
45
50
  */
46
51
  type CellRange = string;
47
52
 
48
53
  /**
49
54
  * Data table configuration, present on the master cell of a data table range.
50
55
  * Represents an Excel What-If Analysis data table.
56
+ *
57
+ * @group Workbooks
51
58
  */
52
59
  type DataTable = {
53
60
  /** Range of cells the data table manages (e.g., "D3:D5") */
@@ -64,11 +71,15 @@ type DataTable = {
64
71
 
65
72
  /**
66
73
  * A whole number without a fractional value.
74
+ *
75
+ * @group Workbooks
67
76
  */
68
77
  type integer = number;
69
78
 
70
79
  /**
71
80
  * A spreadsheet cell.
81
+ *
82
+ * @group Workbooks
72
83
  */
73
84
  type Cell = {
74
85
  /**
@@ -125,6 +136,8 @@ type Cell = {
125
136
  * "scope": "Sheet1",
126
137
  * "value": "Sheet1!B1:C1" }
127
138
  * ```
139
+ *
140
+ * @group Workbooks
128
141
  */
129
142
  type DefinedName = {
130
143
  /**
@@ -136,7 +149,7 @@ type DefinedName = {
136
149
  * A formula expression, a reference, or value. Whatever the value is will be evaluated by a
137
150
  * spreadsheet engine as if it were an expression.
138
151
  */
139
- value?: string;
152
+ value: string;
140
153
  /**
141
154
  * An optional worksheet name that defines the scope for this name. When this field is absent,
142
155
  * the defined name should be considered to be scoped to the workbook.
@@ -148,8 +161,34 @@ type DefinedName = {
148
161
  comment?: string;
149
162
  };
150
163
 
164
+ /**
165
+ * A defined name in an external workbook.
166
+ *
167
+ * @see {@link DefinedName}
168
+ * @group Workbooks
169
+ */
170
+ type ExternalDefinedName = {
171
+ /**
172
+ * A case-sensitive name. Names must start with a letter or `_`, and may only be made up of
173
+ * letters as well as `\`, `_`, `.`, or `?`. Names must be a valid A1 or R1C1 reference.
174
+ */
175
+ name: string;
176
+ /**
177
+ * A formula expression, a reference, or value. Whatever the value is will be evaluated by a
178
+ * spreadsheet engine as if it were an expression.
179
+ */
180
+ value?: string;
181
+ /**
182
+ * An optional worksheet name that defines the scope for this name. When this field is absent,
183
+ * the defined name should be considered to be scoped to the workbook.
184
+ */
185
+ scope?: string;
186
+ };
187
+
151
188
  /**
152
189
  * A simple container sheet for cell values within an external workbook.
190
+ *
191
+ * @group Workbooks
153
192
  */
154
193
  type ExternalWorksheet = {
155
194
  /**
@@ -172,6 +211,8 @@ type ExternalWorksheet = {
172
211
 
173
212
  /**
174
213
  * A cell from another workbook (i.e. another file) that is referenced in this workbook.
214
+ *
215
+ * @group Workbooks
175
216
  */
176
217
  type External = {
177
218
  /** Filename being referenced. */
@@ -184,7 +225,7 @@ type External = {
184
225
  */
185
226
  sheets: ExternalWorksheet[];
186
227
  /** Relevant defined names from an external workbook. */
187
- names: DefinedName[];
228
+ names: ExternalDefinedName[];
188
229
  /**
189
230
  * Indicates that the path to the external workbook file is unknown or missing.
190
231
  * In XLSX, this corresponds to the xlPathMissing relationship type.
@@ -196,6 +237,7 @@ type External = {
196
237
  * A numeric value measured in pixels.
197
238
  *
198
239
  * @min 0
240
+ * @group Workbooks
199
241
  */
200
242
  type PixelValue = number;
201
243
 
@@ -209,6 +251,8 @@ type PixelValue = number;
209
251
  * GridSize may have a style-index ({@link GridSize.s}) attribute like individual cells. The styling
210
252
  * information on the column should be used for all cells that are not present in the sheet's cell
211
253
  * collection.
254
+ *
255
+ * @group Workbooks
212
256
  */
213
257
  type GridSize = {
214
258
  /** A 1-based inclusive start index. */
@@ -216,7 +260,7 @@ type GridSize = {
216
260
  /** A 1-based inclusive end index. */
217
261
  end: integer;
218
262
  /** The size of the grid item in pixels. */
219
- size: PixelValue;
263
+ size?: PixelValue;
220
264
  /** An index to a style in the workbook styles. */
221
265
  s?: integer;
222
266
  };
@@ -226,6 +270,8 @@ type GridSize = {
226
270
  *
227
271
  * There is a maximum of one note per cell, and there is no way to reply to a note. For cell
228
272
  * annotations with replies, see {@link ThreadedComment} and {@link Worksheet.comments}.
273
+ *
274
+ * @group Workbooks
229
275
  */
230
276
  type Note = {
231
277
  /** Cell to which the note is attached (e.g. A1, E24). */
@@ -236,6 +282,509 @@ type Note = {
236
282
  text: string;
237
283
  };
238
284
 
285
+ /**
286
+ * Automatic colour choice. The application decides on what exact colour to use. Typically this
287
+ * means black for text, white for background.
288
+ *
289
+ * @group Colors
290
+ */
291
+ type AutoColor = {
292
+ type: 'auto';
293
+ };
294
+
295
+ /**
296
+ * Represents a single transformation that can be applied to a colour.
297
+ *
298
+ * Most transforms have a `type` that specifies the kind of transformation, and a `value` that
299
+ * provides the necessary parameter for that transformation. The exact meaning and valid range of
300
+ * `value` depends on the `type` of transform. The exception are a handful of whole-colour
301
+ * transformations that affect the entire colour; they have `type` but no `value.`
302
+ *
303
+ * The supported transform types include:
304
+ *
305
+ * - Tint and shade: blend the colour towards white (tint) or black (shade) by a specified
306
+ * percentage.
307
+ * - Alpha: adjust the opacity of the colour using various methods (absolute value, multiplicative,
308
+ * or additive).
309
+ * - Hue, saturation, and luminance: rotate a colour attribute of the colour by a specified amount
310
+ * (absolute, multiplicative, or additive).
311
+ * - Per-channel RGB adjustments: modify individual red, green, or blue channels (absolute,
312
+ * multiplicative, or additive).
313
+ * - Whole-colour operations: apply transformations that affect the entire colour (complement,
314
+ * invert, grayscale, gamma adjustments).
315
+ *
316
+ * @group Colors
317
+ */
318
+ type ColorTransform = {
319
+ /**
320
+ * Produces a lighter version of the input colour. A 10% tint is 10% of the input colour
321
+ * combined with 90% white. */
322
+ type: 'tint';
323
+ /**
324
+ * Percentage (clamped to 0-100).
325
+ * @min 0
326
+ * @max 100
327
+ */
328
+ value: number;
329
+ } | {
330
+ /**
331
+ * Produces a darker version of the input colour. A 10% shade is 10% of the input colour
332
+ * combined with 90% black.
333
+ */
334
+ type: 'shade';
335
+ /**
336
+ * Percentage (clamped to 0-100).
337
+ * @min 0
338
+ * @max 100
339
+ */
340
+ value: number;
341
+ } | {
342
+ /** Alters the input colour to have the specified opacity, but with its colour unchanged. */
343
+ type: 'alpha';
344
+ /**
345
+ * Percentage (clamped to 0-100).
346
+ * @min 0
347
+ * @max 100
348
+ */
349
+ value: number;
350
+ } | {
351
+ /**
352
+ * Produces a more or less opaque version of the input colour. An alpha modulate never increases
353
+ * the alpha beyond 100%. A 200% alpha modulate makes an input colour twice as opaque as before.
354
+ * A 50% alpha modulate makes an input colour half as opaque as before.
355
+ */
356
+ type: 'alphaMod';
357
+ /**
358
+ * Positive percentage.
359
+ * @min 0
360
+ */
361
+ value: number;
362
+ } | {
363
+ /**
364
+ * Produces a more or less opaque version of the input colour.
365
+ *
366
+ * Increases or decreases the input alpha percentage by the specified percentage offset. A 10%
367
+ * alpha offset increases a 50% opacity to 60%. A -10% alpha offset decreases a 50% opacity to
368
+ * 40%. The transformed alpha values are limited to a range of 0 to 100%. A 10% alpha offset
369
+ * increase to a 100% opaque object still results in 100% opacity.
370
+ */
371
+ type: 'alphaOff';
372
+ /**
373
+ * Percentage (clamped to -100 to 100).
374
+ * @min -100
375
+ * @max 100
376
+ */
377
+ value: number;
378
+ } | {
379
+ /**
380
+ * Alters the input colour so it has the specified hue, but with its saturation and luminance
381
+ * unchanged.
382
+ */
383
+ type: 'hue';
384
+ /**
385
+ * Degrees (clamped to 0-360).
386
+ * @min 0
387
+ * @max 360
388
+ */
389
+ value: number;
390
+ } | {
391
+ /**
392
+ * Modulates the input colour's hue by the given percentage. A 50% hue modulate decreases the
393
+ * angular hue value by half. A 200% hue modulate doubles the angular hue value.
394
+ */
395
+ type: 'hueMod';
396
+ /**
397
+ * Positive percentage.
398
+ * @min 0
399
+ */
400
+ value: number;
401
+ } | {
402
+ /**
403
+ * Produces the input colour with its hue shifted, but with its saturation and luminance
404
+ * unchanged.
405
+ */
406
+ type: 'hueOff';
407
+ /** Degrees. */
408
+ value: number;
409
+ } | {
410
+ /**
411
+ * Alters the input colour so it has the specified saturation, but with its hue and luminance
412
+ * unchanged.
413
+ */
414
+ type: 'sat';
415
+ /** Unbounded percentage. */
416
+ value: number;
417
+ } | {
418
+ /**
419
+ * Modulates the input colour's saturation by the given percentage.
420
+ *
421
+ * A 50% saturation modulate reduces the saturation by half. A 200% saturation modulate doubles
422
+ * the saturation.
423
+ */
424
+ type: 'satMod';
425
+ /** Unbounded percentage. */
426
+ value: number;
427
+ } | {
428
+ /**
429
+ * Produces the input colour with its saturation shifted, but with its hue and luminance
430
+ * unchanged. A 10% offset to 20% saturation yields 30% saturation.
431
+ */
432
+ type: 'satOff';
433
+ /** Unbounded percentage. */
434
+ value: number;
435
+ } | {
436
+ /**
437
+ * Alters the input colour so it has the specified luminance, but with its hue and saturation
438
+ * unchanged.
439
+ */
440
+ type: 'lum';
441
+ /** Unbounded percentage. */
442
+ value: number;
443
+ } | {
444
+ /**
445
+ * Alters the input colour's luminance modulated by the given percentage.
446
+ *
447
+ * A 50% luminance modulate reduces the luminance by half. A 200% luminance modulate doubles the
448
+ * luminance.
449
+ */
450
+ type: 'lumMod';
451
+ /** Unbounded percentage. */
452
+ value: number;
453
+ } | {
454
+ /**
455
+ * Produces the input colour with its luminance shifted, but with its hue and saturation
456
+ * unchanged.
457
+ */
458
+ type: 'lumOff';
459
+ /** Unbounded percentage. */
460
+ value: number;
461
+ } | {
462
+ /**
463
+ * Produces the input colour with the specified red component. The green and blue colour
464
+ * components unchanged.
465
+ */
466
+ type: 'red';
467
+ /** Unbounded percentage. */
468
+ value: number;
469
+ } | {
470
+ /**
471
+ * Alters the input colour so its red component is modulated by the given percentage. A 50% red
472
+ * modulate reduces the red component by half. A 200% red modulate doubles the red component.
473
+ */
474
+ type: 'redMod';
475
+ /** Unbounded percentage. */
476
+ value: number;
477
+ } | {
478
+ /**
479
+ * Alters the input colour so its red component is shifted. Its green and blue colour components
480
+ * unchanged.
481
+ */
482
+ type: 'redOff';
483
+ /** Unbounded percentage. */
484
+ value: number;
485
+ } | {
486
+ /**
487
+ * Provides the input colour with the specified green component. Its red and blue colour
488
+ * components unchanged.
489
+ */
490
+ type: 'green';
491
+ /** Unbounded percentage. */
492
+ value: number;
493
+ } | {
494
+ /**
495
+ * Modulates the input colour's green component by the given percentage.
496
+ *
497
+ * A 50% green modulate reduces the green component by half. A 200% green modulate doubles the
498
+ * green component.
499
+ */
500
+ type: 'greenMod';
501
+ /** Unbounded percentage. */
502
+ value: number;
503
+ } | {
504
+ /**
505
+ * Alters the input colour so its green component is shifted. Its red and blue colour components
506
+ * unchanged.
507
+ */
508
+ type: 'greenOff';
509
+ /** Unbounded percentage. */
510
+ value: number;
511
+ } | {
512
+ /**
513
+ * Provides the input colour with the specified blue component. Its red and green colour
514
+ * components unchanged.
515
+ */
516
+ type: 'blue';
517
+ /** Unbounded percentage. */
518
+ value: number;
519
+ } | {
520
+ /**
521
+ * Modulates the input colour's blue component by the given percentage.
522
+ *
523
+ * A 50% blue modulate reduces the blue component by half. A 200% blue modulate doubles the blue
524
+ * component.
525
+ */
526
+ type: 'blueMod';
527
+ /** Unbounded percentage. */
528
+ value: number;
529
+ } | {
530
+ /**
531
+ * Alters the input colour so its blue component is shifted, but with its red and green colour
532
+ * components unchanged.
533
+ */
534
+ type: 'blueOff';
535
+ /** Unbounded percentage. */
536
+ value: number;
537
+ } | {
538
+ /**
539
+ * Specifies that the colour rendered should be the complement of the input colour with the
540
+ * complement being defined as such.
541
+ */
542
+ type: 'comp';
543
+ } | {
544
+ /**
545
+ * Specifies the inverse of the input colour. For example, the inverse of red (1, 0, 0) is cyan
546
+ * (0, 1, 1 ).
547
+ */
548
+ type: 'inv';
549
+ } | {
550
+ /**
551
+ * Specifies a grey scale of the input colour, taking into relative intensities of the red,
552
+ * green, and blue primaries.
553
+ */
554
+ type: 'gray';
555
+ } | {
556
+ /**
557
+ * Specifies that the output colour rendered by the generating application should be the sRGB
558
+ * gamma shift of the input colour.
559
+ */
560
+ type: 'gamma';
561
+ } | {
562
+ /**
563
+ * Specifies that the output colour rendered by the generating application should be the inverse
564
+ * sRGB gamma shift of the input colour.
565
+ */
566
+ type: 'invGamma';
567
+ };
568
+
569
+ /**
570
+ * Hue / saturation / lightness.
571
+ *
572
+ * Hue, saturation and lightness follow CSS Color Level 4 conventions, but using the range (0-100)
573
+ * rather than (0-1).
574
+ *
575
+ * @group Colors
576
+ */
577
+ type HslColor = {
578
+ type: 'hsl';
579
+ /**
580
+ * Degrees (0-360). Must be positive.
581
+ * @min 0
582
+ * @max 360
583
+ */
584
+ hue: number;
585
+ /** Percentage. */
586
+ saturation: number;
587
+ /** Percentage. */
588
+ lightness: number;
589
+ };
590
+
591
+ /**
592
+ * A legacy colour indexing scheme, still occasionally required for backwards compatibility.
593
+ *
594
+ * An enumerated set of RGB colours values that correspond to a zero-based index.
595
+ *
596
+ * The table below lists the mapping from indexed colour value to RGB value. Note that indexes 8-15
597
+ * are copies of indexes 0-7. All colours are fully opaque.
598
+ *
599
+ * | Index | RGB hex colour |
600
+ * |------:|------------------:|
601
+ * | 0 | #000000 |
602
+ * | 1 | #FFFFFF |
603
+ * | 2 | #FF0000 |
604
+ * | 3 | #00FF00 |
605
+ * | 4 | #0000FF |
606
+ * | 5 | #FFFF00 |
607
+ * | 6 | #FF00FF |
608
+ * | 7 | #00FFFF |
609
+ * | 8 | #000000 |
610
+ * | 9 | #FFFFFF |
611
+ * | 10 | #FF0000 |
612
+ * | 11 | #00FF00 |
613
+ * | 12 | #0000FF |
614
+ * | 13 | #FFFF00 |
615
+ * | 14 | #FF00FF |
616
+ * | 15 | #00FFFF |
617
+ * | 16 | #800000 |
618
+ * | 17 | #008000 |
619
+ * | 18 | #000080 |
620
+ * | 19 | #808000 |
621
+ * | 20 | #800080 |
622
+ * | 21 | #008080 |
623
+ * | 22 | #C0C0C0 |
624
+ * | 23 | #808080 |
625
+ * | 24 | #9999FF |
626
+ * | 25 | #993366 |
627
+ * | 26 | #FFFFCC |
628
+ * | 27 | #CCFFFF |
629
+ * | 28 | #660066 |
630
+ * | 29 | #FF8080 |
631
+ * | 30 | #0066CC |
632
+ * | 31 | #CCCCFF |
633
+ * | 32 | #000080 |
634
+ * | 33 | #FF00FF |
635
+ * | 34 | #FFFF00 |
636
+ * | 35 | #00FFFF |
637
+ * | 36 | #800080 |
638
+ * | 37 | #800000 |
639
+ * | 38 | #008080 |
640
+ * | 39 | #0000FF |
641
+ * | 40 | #00CCFF |
642
+ * | 41 | #CCFFFF |
643
+ * | 42 | #CCFFCC |
644
+ * | 43 | #FFFF99 |
645
+ * | 44 | #99CCFF |
646
+ * | 45 | #FF99CC |
647
+ * | 46 | #CC99FF |
648
+ * | 47 | #FFCC99 |
649
+ * | 48 | #3366FF |
650
+ * | 49 | #33CCCC |
651
+ * | 50 | #99CC00 |
652
+ * | 51 | #FFCC00 |
653
+ * | 52 | #FF9900 |
654
+ * | 53 | #FF6600 |
655
+ * | 54 | #666699 |
656
+ * | 55 | #969696 |
657
+ * | 56 | #003366 |
658
+ * | 57 | #339966 |
659
+ * | 58 | #003300 |
660
+ * | 59 | #333300 |
661
+ * | 60 | #993300 |
662
+ * | 61 | #993366 |
663
+ * | 62 | #333399 |
664
+ * | 63 | #333333 |
665
+ * | 64 | System foreground |
666
+ * | 65 | System background |
667
+ *
668
+ * @group Colors
669
+ */
670
+ type IndexedColor = {
671
+ type: 'indexed';
672
+ value: number;
673
+ };
674
+
675
+ /**
676
+ * A named colour from a predefined collection of colours.
677
+ *
678
+ * The preset colours are analogous to the extended colour keywords from CSS Colors Level 3,
679
+ * but using camel casing and abbreviated forms (e.g. `dkMagenta` vs `darkmagenta`).
680
+ *
681
+ * @group Colors
682
+ */
683
+ type PresetColor = {
684
+ type: 'preset';
685
+ /** Preset name, e.g. "aliceBlue", "coral". */
686
+ value: 'aliceBlue' | 'antiqueWhite' | 'aqua' | 'aquamarine' | 'azure' | 'beige' | 'bisque' | 'black' | 'blanchedAlmond' | 'blue' | 'blueViolet' | 'brown' | 'burlyWood' | 'cadetBlue' | 'chartreuse' | 'chocolate' | 'coral' | 'cornflowerBlue' | 'cornsilk' | 'crimson' | 'cyan' | 'dkBlue' | 'dkCyan' | 'dkGoldenrod' | 'dkGray' | 'dkGreen' | 'dkKhaki' | 'dkMagenta' | 'dkOliveGreen' | 'dkOrange' | 'dkOrchid' | 'dkRed' | 'dkSalmon' | 'dkSeaGreen' | 'dkSlateBlue' | 'dkSlateGray' | 'dkTurquoise' | 'dkViolet' | 'deepPink' | 'deepSkyBlue' | 'dimGray' | 'dodgerBlue' | 'firebrick' | 'floralWhite' | 'forestGreen' | 'fuchsia' | 'gainsboro' | 'ghostWhite' | 'gold' | 'goldenrod' | 'gray' | 'green' | 'greenYellow' | 'honeydew' | 'hotPink' | 'indianRed' | 'indigo' | 'ivory' | 'khaki' | 'lavender' | 'lavenderBlush' | 'lawnGreen' | 'lemonChiffon' | 'ltBlue' | 'ltCoral' | 'ltCyan' | 'ltGoldenrodYellow' | 'ltGray' | 'ltGreen' | 'ltPink' | 'ltSalmon' | 'ltSeaGreen' | 'ltSkyBlue' | 'ltSlateGray' | 'ltSteelBlue' | 'ltYellow' | 'lime' | 'limeGreen' | 'linen' | 'magenta' | 'maroon' | 'medAquamarine' | 'medBlue' | 'medOrchid' | 'medPurple' | 'medSeaGreen' | 'medSlateBlue' | 'medSpringGreen' | 'medTurquoise' | 'medVioletRed' | 'midnightBlue' | 'mintCream' | 'mistyRose' | 'moccasin' | 'navajoWhite' | 'navy' | 'oldLace' | 'olive' | 'oliveDrab' | 'orange' | 'orangeRed' | 'orchid' | 'paleGoldenrod' | 'paleGreen' | 'paleTurquoise' | 'paleVioletRed' | 'papayaWhip' | 'peachPuff' | 'peru' | 'pink' | 'plum' | 'powderBlue' | 'purple' | 'red' | 'rosyBrown' | 'royalBlue' | 'saddleBrown' | 'salmon' | 'sandyBrown' | 'seaGreen' | 'seaShell' | 'sienna' | 'silver' | 'skyBlue' | 'slateBlue' | 'slateGray' | 'snow' | 'springGreen' | 'steelBlue' | 'tan' | 'teal' | 'thistle' | 'tomato' | 'turquoise' | 'violet' | 'wheat' | 'white' | 'whiteSmoke' | 'yellow' | 'yellowGreen';
687
+ };
688
+
689
+ /**
690
+ * A colour in Microsoft's scRGB colour space.
691
+ *
692
+ * Equivalent to CSS `srgb-linear` colour space.
693
+ *
694
+ * @group Colors
695
+ */
696
+ type ScRgbColor = {
697
+ type: 'scrgb';
698
+ /** Red value as a percentage. Can be outside the range 0-100. */
699
+ red: number;
700
+ /** Green value as a percentage. Can be outside the range 0-100. */
701
+ green: number;
702
+ /** Blue value as a percentage. Can be outside the range 0-100. */
703
+ blue: number;
704
+ };
705
+
706
+ /**
707
+ * Standard sRGB colour space.
708
+ *
709
+ * @group Colors
710
+ */
711
+ type SrgbColor = {
712
+ type: 'srgb';
713
+ /**
714
+ * CSS-style hex, e.g. `FF0000`. Always six digits, always uppercase. No alpha channel.
715
+ * @pattern ^[A-F0-9]{6}$
716
+ */
717
+ value: string;
718
+ };
719
+
720
+ /**
721
+ * OS-defined system colour (e.g. window text, highlight).
722
+ *
723
+ * The value must be one of the pre-defined values. The colour matching each of these values should
724
+ * match the closest analogous colour in the OS in use.
725
+ *
726
+ * @group Colors
727
+ */
728
+ type SystemColor = {
729
+ type: 'system';
730
+ /** System colour name. */
731
+ value: 'scrollBar' | 'background' | 'activeCaption' | 'inactiveCaption' | 'menu' | 'window' | 'windowFrame' | 'menuText' | 'windowText' | 'captionText' | 'activeBorder' | 'inactiveBorder' | 'appWorkspace' | 'highlight' | 'highlightText' | 'btnFace' | 'btnShadow' | 'grayText' | 'btnText' | 'inactiveCaptionText' | 'btnHighlight' | '3dDkShadow' | '3dLight' | 'infoText' | 'infoBk' | 'hotLight' | 'gradientActiveCaption' | 'gradientInactiveCaption' | 'menuHighlight' | 'menuBar';
732
+ };
733
+
734
+ /** Reference to a theme colour. */
735
+ /**
736
+ * Reference to a theme colour.
737
+ *
738
+ * A theme colour is defined in the workbook's theme. Theme colours are used to ensure a consistent
739
+ * palette across a workbook.
740
+ *
741
+ * @group Colors
742
+ */
743
+ type SchemeColor = {
744
+ type: 'theme';
745
+ /**
746
+ * Theme colour name.
747
+ *
748
+ * Must be one of a limited set of values. The actual colour that matches the name is defined
749
+ * elsewhere in the theme.
750
+ */
751
+ value: 'bg1' | 'tx1' | 'bg2' | 'tx2' | 'accent1' | 'accent2' | 'accent3' | 'accent4' | 'accent5' | 'accent6' | 'hlink' | 'folHlink' | 'phClr' | 'dk1' | 'lt1' | 'dk2' | 'lt2';
752
+ };
753
+
754
+ /**
755
+ * A colour, which can be used is various parts of a workbook. The base colour can be transformed
756
+ * using a list of colour transformations.
757
+ *
758
+ * The base colour must be defined using one of the following colour models:
759
+ *
760
+ * - {@link SrgbColor}: Standard sRGB colour space, defined by a CSS-style hex string (e.g.
761
+ * `FF0000`).
762
+ * - {@link ScRgbColor}: A colour in Microsoft's scRGB colour space, defined by red, green, and blue
763
+ * values as percentages.
764
+ * - {@link HslColor}: A colour in HSL colour space, defined by hue, saturation, and lightness
765
+ * values.
766
+ * - {@link SystemColor}: An OS-defined system colour (e.g. window text, highlight), defined using
767
+ * one of an enumerated set of values.
768
+ * - {@link SchemeColor}: A reference to a theme colour.
769
+ * - {@link PresetColor}: A preset colour, similar to CSS's defined colours.
770
+ * - {@link AutoColor}: Colour choice left to the application.
771
+ * - {@link IndexedColor}: A legacy colour indexing scheme.
772
+ *
773
+ * @group Colors
774
+ */
775
+ type Color = (SrgbColor | ScRgbColor | HslColor | SystemColor | SchemeColor | PresetColor | AutoColor | IndexedColor) & {
776
+ /**
777
+ * Optional list of colour transformations to apply to the base colour.
778
+ *
779
+ * The transformations must be applied in order, and each transformation must be applied to the
780
+ * result of the previous one. There can be multiple transformations of the same type.
781
+ *
782
+ * The transformations are defined by {@link ColorTransform}, which includes operations such as
783
+ * tinting, shading, and saturation adjustments.
784
+ */
785
+ transforms?: ColorTransform[];
786
+ };
787
+
239
788
  /**
240
789
  * Base type for text runs that annotate ranges within threaded comment text.
241
790
  *
@@ -254,6 +803,7 @@ type Note = {
254
803
  *
255
804
  * @see {@link MentionTextRun} for mentions of people
256
805
  * @see {@link HyperlinkTextRun} for hyperlinks
806
+ * @group Workbooks
257
807
  */
258
808
  type TextRun = {
259
809
  /** Starting character position of the run in the text (zero-indexed). */
@@ -264,6 +814,8 @@ type TextRun = {
264
814
 
265
815
  /**
266
816
  * A {@link TextRun | text run} representing a hyperlink within a threaded comment's text.
817
+ *
818
+ * @group Workbooks
267
819
  */
268
820
  type HyperlinkTextRun = TextRun & {
269
821
  /** Discriminator to identify this as a hyperlink text run. */
@@ -274,6 +826,8 @@ type HyperlinkTextRun = TextRun & {
274
826
 
275
827
  /**
276
828
  * A {@link TextRun | text run} representing a mention of a person within a threaded comment's text.
829
+ *
830
+ * @group Workbooks
277
831
  */
278
832
  type MentionTextRun = TextRun & {
279
833
  /** Discriminator to identify this as a mention text run. */
@@ -290,6 +844,8 @@ type MentionTextRun = TextRun & {
290
844
 
291
845
  /**
292
846
  * An author of a threaded comment, or a person mentioned in a threaded comment.
847
+ *
848
+ * @group Workbooks
293
849
  */
294
850
  type Person = {
295
851
  /**
@@ -319,6 +875,8 @@ type Person = {
319
875
 
320
876
  /**
321
877
  * A threaded comment that is attached to an individual cell.
878
+ *
879
+ * @group Workbooks
322
880
  */
323
881
  type ThreadedComment = {
324
882
  /**
@@ -357,15 +915,18 @@ type ThreadedComment = {
357
915
 
358
916
  /**
359
917
  * Represents a one dimensional position or length in EMUs.
360
- * Same as {@link Coordinate} but value must be 0 or higher.
918
+ * Same as {@link EmuValue} but value must be 0 or higher.
361
919
  *
362
920
  * @min 0
363
921
  * @max 27273042316900
922
+ * @group Drawings
364
923
  */
365
924
  type PositiveCoordinate = number;
366
925
 
367
926
  /**
368
927
  * Describes the length and width properties for how far drawing element should extend, in EMUs.
928
+ *
929
+ * @group Drawings
369
930
  */
370
931
  type Extent = {
371
932
  /** Horizontal size (X-axis). */
@@ -397,13 +958,16 @@ type Extent = {
397
958
  *
398
959
  * @min -27273042329600
399
960
  * @max 27273042316900
961
+ * @group Drawings
400
962
  */
401
963
  type EmuValue = number;
402
964
 
403
965
  /**
404
966
  * 2D position in EMUs.
405
967
  *
406
- z * Represents a point in 2D space using absolute coordinates measured in EMUs.
968
+ * Represents a point in 2D space using absolute coordinates measured in EMUs.
969
+ *
970
+ * @group Drawings
407
971
  */
408
972
  type Point = {
409
973
  /** Horizontal position (X-axis). */
@@ -414,6 +978,8 @@ type Point = {
414
978
 
415
979
  /**
416
980
  * Specifies an absolute anchor placeholder for a group, a shape, or a drawing element.
981
+ *
982
+ * @group Drawings
417
983
  */
418
984
  type GraphicAnchorAbsolute = {
419
985
  /** Type discriminator for an absolute anchor. */
@@ -426,6 +992,8 @@ type GraphicAnchorAbsolute = {
426
992
 
427
993
  /**
428
994
  * Specifies a point in the cell grid.
995
+ *
996
+ * @group Drawings
429
997
  */
430
998
  type CellOffset = {
431
999
  /** The row in which the point occurs, 1 indexed. */
@@ -440,6 +1008,8 @@ type CellOffset = {
440
1008
 
441
1009
  /**
442
1010
  * Specifies a one cell anchor placeholder for a group, a shape, or a drawing element.
1011
+ *
1012
+ * @group Drawings
443
1013
  */
444
1014
  type GraphicAnchorOneCell = {
445
1015
  /** Type discriminator for a one-cell anchor. */
@@ -452,6 +1022,8 @@ type GraphicAnchorOneCell = {
452
1022
 
453
1023
  /**
454
1024
  * Specifies a two-cell anchor placeholder for a group, a shape, or a drawing element.
1025
+ *
1026
+ * @group Drawings
455
1027
  */
456
1028
  type GraphicAnchorTwoCell = {
457
1029
  /** Type discriminator for a two-cell anchor. */
@@ -464,11 +1036,15 @@ type GraphicAnchorTwoCell = {
464
1036
 
465
1037
  /**
466
1038
  * Specifies an anchor placeholder for a group, a shape, or a drawing element.
1039
+ *
1040
+ * @group Drawings
467
1041
  */
468
1042
  type GraphicAnchor = GraphicAnchorAbsolute | GraphicAnchorOneCell | GraphicAnchorTwoCell;
469
1043
 
470
1044
  /**
471
1045
  * Represents a percentage of a whole, usually [0-100].
1046
+ *
1047
+ * @group Drawings
472
1048
  */
473
1049
  type Percentage = number;
474
1050
 
@@ -477,6 +1053,8 @@ type Percentage = number;
477
1053
  *
478
1054
  * Defines a rectangle using relative offsets from each edge, expressed as percentages
479
1055
  * of the parent rectangle's dimensions.
1056
+ *
1057
+ * @group Drawings
480
1058
  */
481
1059
  type RelativeRect = {
482
1060
  /** Top edge offset as percentage from top. */
@@ -491,6 +1069,8 @@ type RelativeRect = {
491
1069
 
492
1070
  /**
493
1071
  * Specifies the direction(s) in which to flip a source image while tiling.
1072
+ *
1073
+ * @group Drawings
494
1074
  */
495
1075
  type FlipAxis = 'none' | 'x' | 'xy' | 'y';
496
1076
 
@@ -510,6 +1090,8 @@ type FlipAxis = 'none' | 'x' | 'xy' | 'y';
510
1090
  * | `t` | Top center |
511
1091
  * | `tl` | Top left |
512
1092
  * | `tr` | Top right |
1093
+ *
1094
+ * @group Drawings
513
1095
  */
514
1096
  type RectAlignment = 'b' | 'bl' | 'br' | 'ctr' | 'l' | 'r' | 't' | 'tl' | 'tr';
515
1097
 
@@ -518,6 +1100,8 @@ type RectAlignment = 'b' | 'bl' | 'br' | 'ctr' | 'l' | 'r' | 't' | 'tl' | 'tr';
518
1100
  *
519
1101
  * Defines how an image should be repeated (tiled) when used as a fill,
520
1102
  * including scaling, alignment, offset, and flip transformations.
1103
+ *
1104
+ * @group Drawings
521
1105
  */
522
1106
  type Tile = {
523
1107
  /** Additional horizontal offset after alignment, in EMUs. */
@@ -542,6 +1126,8 @@ type Tile = {
542
1126
  *
543
1127
  * Defines a fill using an embedded or linked image, with options for
544
1128
  * tiling, stretching, cropping, and transparency.
1129
+ *
1130
+ * @group Drawings
545
1131
  */
546
1132
  type BlipFill = {
547
1133
  /** Type discriminator for blip (image) fills. */
@@ -582,22 +1168,18 @@ type BlipFill = {
582
1168
  *
583
1169
  * Positive angles are clockwise (i.e., towards the positive y axis);
584
1170
  * negative angles are counter-clockwise (i.e., towards the negative y axis).
585
- */
586
- type DmlAngle = number;
587
-
588
- /**
589
- * A hex-encoded RGB or RGBA value that conforms to the CSS4 color specification (e.g. `"#3cb371"`).
590
1171
  *
591
- * @see {@link https://www.w3.org/TR/css-color-4/#hex-notation | CSS hexadecimal notation spec}
592
- * @pattern ^#([a-fA-F0-9]{3,4}|([a-fA-F0-9][a-fA-F0-9]){3,4})$
1172
+ * @group Drawings
593
1173
  */
594
- type Color = `#${string}`;
1174
+ type DmlAngle = number;
595
1175
 
596
1176
  /**
597
1177
  * Gradient color stop.
598
1178
  *
599
1179
  * Defines a color transition point within a gradient fill,
600
1180
  * specifying both the position and color at that point.
1181
+ *
1182
+ * @group Drawings
601
1183
  */
602
1184
  type GradientColorStop = {
603
1185
  /**
@@ -617,6 +1199,8 @@ type GradientColorStop = {
617
1199
  *
618
1200
  * Defines a gradient fill that transitions between colors along a straight line,
619
1201
  * with configurable angle, flip behavior, and color stops.
1202
+ *
1203
+ * @group Drawings
620
1204
  */
621
1205
  type GradientLinearFill = {
622
1206
  /** Type discriminator for linear gradient fills. */
@@ -640,6 +1224,8 @@ type GradientLinearFill = {
640
1224
  * - 'circle': Radial gradient emanating from center in a circular pattern.
641
1225
  * - 'rect': Gradient following rectangular boundaries from center outward.
642
1226
  * - 'shape': Gradient following the actual contour/outline of the shape.
1227
+ *
1228
+ * @group Drawings
643
1229
  */
644
1230
  type PathFillType = 'circle' | 'rect' | 'shape';
645
1231
 
@@ -648,6 +1234,8 @@ type PathFillType = 'circle' | 'rect' | 'shape';
648
1234
  *
649
1235
  * Defines a gradient fill that radiates from a center point or follows
650
1236
  * the shape's contour, creating circular, rectangular, or shape-based gradients.
1237
+ *
1238
+ * @group Drawings
651
1239
  */
652
1240
  type GradientPathFill = {
653
1241
  /** Type discriminator for path gradient fills. */
@@ -668,6 +1256,8 @@ type GradientPathFill = {
668
1256
  * Group fill.
669
1257
  *
670
1258
  * Declares that the element is part of a group and should inherit the fill properties of the group.
1259
+ *
1260
+ * @group Drawings
671
1261
  */
672
1262
  type GroupFill = {
673
1263
  /** Type discriminator for group fills. */
@@ -678,6 +1268,8 @@ type GroupFill = {
678
1268
  * No fill.
679
1269
  *
680
1270
  * Declares that the element should not be filled.
1271
+ *
1272
+ * @group Drawings
681
1273
  */
682
1274
  type NoFill = {
683
1275
  /** Type discriminator for none-fills. */
@@ -686,6 +1278,8 @@ type NoFill = {
686
1278
 
687
1279
  /**
688
1280
  * Pattern fill style presets.
1281
+ *
1282
+ * @group Drawings
689
1283
  */
690
1284
  type FillPatternStyle = 'pct5' | 'pct10' | 'pct20' | 'pct25' | 'pct30' | 'pct40' | 'pct50' | 'pct60' | 'pct70' | 'pct75' | 'pct80' | 'pct90' | 'ltHorz' | 'ltVert' | 'dkHorz' | 'dkVert' | 'narHorz' | 'narVert' | 'dashHorz' | 'dashVert' | 'ltDnDiag' | 'ltUpDiag' | 'dkDnDiag' | 'dkUpDiag' | 'wdDnDiag' | 'wdUpDiag' | 'dashDnDiag' | 'dashUpDiag' | 'smCheck' | 'lgCheck' | 'smGrid' | 'lgGrid' | 'dotGrid' | 'smConfetti' | 'lgConfetti' | 'horzBrick' | 'diagBrick' | 'solidDmnd' | 'openDmnd' | 'dotDmnd' | 'plaid' | 'sphere' | 'weave' | 'divot' | 'shingle' | 'wave' | 'trellis' | 'zigZag' | 'cross' | 'horz' | 'vert' | 'dnDiag' | 'upDiag' | 'diagCross';
691
1285
 
@@ -694,6 +1288,8 @@ type FillPatternStyle = 'pct5' | 'pct10' | 'pct20' | 'pct25' | 'pct30' | 'pct40'
694
1288
  *
695
1289
  * Defines a fill using a repeating pattern (dots, stripes, crosshatch, etc.)
696
1290
  * with configurable foreground and background colors.
1291
+ *
1292
+ * @group Drawings
697
1293
  */
698
1294
  type PatternFill = {
699
1295
  /** Type discriminator for pattern fills. */
@@ -710,6 +1306,8 @@ type PatternFill = {
710
1306
  * Solid color fill.
711
1307
  *
712
1308
  * Defines a fill using a single uniform color with no gradients, patterns, or images.
1309
+ *
1310
+ * @group Drawings
713
1311
  */
714
1312
  type SolidFill = {
715
1313
  /** Type discriminator for solid fills. */
@@ -718,10 +1316,17 @@ type SolidFill = {
718
1316
  bg?: Color;
719
1317
  };
720
1318
 
1319
+ /**
1320
+ * Union type representing all possible fill types for shapes.
1321
+ *
1322
+ * @group Drawings
1323
+ */
721
1324
  type Fill = PatternFill | SolidFill | GradientLinearFill | GradientPathFill | GroupFill | NoFill | BlipFill;
722
1325
 
723
1326
  /**
724
1327
  * A dash stop primitive consisting of a dash and a space.
1328
+ *
1329
+ * @group Drawings
725
1330
  */
726
1331
  type DashStop = {
727
1332
  /**
@@ -745,6 +1350,8 @@ type DashStop = {
745
1350
  * | `inside` | Stroke is drawn inside the path.
746
1351
  *
747
1352
  * These have been altered from DrawingML which used "ctr" for `center`, and "in" for `inside`.
1353
+ *
1354
+ * @group Drawings
748
1355
  */
749
1356
  type LineAlignment = 'center' | 'inside';
750
1357
 
@@ -759,6 +1366,8 @@ type LineAlignment = 'center' | 'inside';
759
1366
  *
760
1367
  * These have been altered from DrawingML which used "flat" for `butt`, "rnd" for `round`,
761
1368
  * and "sq" for `square`.
1369
+ *
1370
+ * @group Drawings
762
1371
  */
763
1372
  type LineCapType = 'butt' | 'rnd' | 'sq';
764
1373
 
@@ -772,19 +1381,29 @@ type LineCapType = 'butt' | 'rnd' | 'sq';
772
1381
  * | `thickThin` | Double lines: one thick, one thin
773
1382
  * | `thinThick` | Double lines: one thin, one thick
774
1383
  * | `tri` | Three lines: thin, thick, thin
1384
+ *
1385
+ * @group Drawings
775
1386
  */
776
1387
  type LineCompoundType = 'dbl' | 'sng' | 'thickThin' | 'thinThick' | 'tri';
777
1388
 
778
1389
  /**
779
1390
  * Line ending decoration size: Large, medium, small.
1391
+ *
1392
+ * @group Drawings
780
1393
  */
781
1394
  type LineEndSize = 'lg' | 'med' | 'sm';
782
1395
 
783
- /** Line ending shape type. */
1396
+ /**
1397
+ * Line ending shape type.
1398
+ *
1399
+ * @group Drawings
1400
+ */
784
1401
  type LineEndType = 'arrow' | 'diamond' | 'none' | 'oval' | 'stealth' | 'triangle';
785
1402
 
786
1403
  /**
787
1404
  * Defines a line ending decoration.
1405
+ *
1406
+ * @group Drawings
788
1407
  */
789
1408
  type LineEnd = {
790
1409
  /**
@@ -807,6 +1426,8 @@ type LineEnd = {
807
1426
  /**
808
1427
  * Defines the shape to be used at the corners of a stroked path.
809
1428
  * These are equivalent to their CSS/SVG linejoin value counterparts.
1429
+ *
1430
+ * @group Drawings
810
1431
  */
811
1432
  type LineJoinType = 'bevel' | 'round' | 'miter';
812
1433
 
@@ -826,6 +1447,8 @@ type LineJoinType = 'bevel' | 'round' | 'miter';
826
1447
  * | `sysDashDot` | Equivalent to SVG dashArray of `[3,1,1,1]`
827
1448
  * | `sysDashDotDot` | Equivalent to SVG dashArray of `[3,1,1,1,1,1,1]`
828
1449
  * | `sysDot` | Equivalent to SVG dashArray of `[1,1]`
1450
+ *
1451
+ * @group Drawings
829
1452
  */
830
1453
  type LineStyle = 'dash' | 'dashDot' | 'dot' | 'lgDash' | 'lgDashDot' | 'lgDashDotDot' | 'solid' | 'sysDash' | 'sysDashDot' | 'sysDashDotDot' | 'sysDot';
831
1454
 
@@ -834,6 +1457,8 @@ type LineStyle = 'dash' | 'dashDot' | 'dot' | 'lgDash' | 'lgDashDot' | 'lgDashDo
834
1457
  *
835
1458
  * Defines the visual appearance of lines and shape outlines, including
836
1459
  * stroke style, width, caps, joins, and decorative line ends (arrows).
1460
+ *
1461
+ * @group Drawings
837
1462
  */
838
1463
  type Line = {
839
1464
  /** Compound line type for creating multi-stroke effects. */
@@ -873,38 +1498,60 @@ type Line = {
873
1498
  tail?: LineEnd;
874
1499
  };
875
1500
 
876
- /** An identifier for a geometry guide */
1501
+ /**
1502
+ * An identifier for a geometry guide.
1503
+ *
1504
+ * @group Drawings
1505
+ */
877
1506
  type GeomGuideName = string;
878
1507
 
1508
+ /**
1509
+ * Defines the type of an adjust coordinate, which can be either an {@link EmuValue} or a
1510
+ * {@link GeomGuideName}.
1511
+ *
1512
+ * @group Drawings
1513
+ */
879
1514
  type AdjustCoordinate = EmuValue | GeomGuideName;
880
1515
 
881
1516
  /**
882
1517
  * A path command to draw an elliptical arc to an endpoint.
1518
+ *
1519
+ * @group Drawings
883
1520
  */
884
1521
  type ArcToCommand = ['A', AdjustCoordinate, AdjustCoordinate, AdjustCoordinate, AdjustCoordinate];
885
1522
 
886
1523
  /**
887
1524
  * A path command to close the current subpath by drawing a line to the starting point.
1525
+ *
1526
+ * @group Drawings
888
1527
  */
889
1528
  type CloseCommand = ['Z'];
890
1529
 
891
1530
  /**
892
1531
  * A path command to draw a cubic Bézier curve to an endpoint.
1532
+ *
1533
+ * @group Drawings
893
1534
  */
894
1535
  type CubicBezierToCommand = ['C', AdjustCoordinate, AdjustCoordinate, AdjustCoordinate, AdjustCoordinate, AdjustCoordinate, AdjustCoordinate];
895
1536
 
896
1537
  /**
897
1538
  * A path command to draw a line from the current position to a new one.
1539
+ *
1540
+ * @group Drawings
898
1541
  */
899
1542
  type LineToCommand = ['L', AdjustCoordinate, AdjustCoordinate];
900
1543
 
901
1544
  /**
902
1545
  * A path command to move pen to a new position without drawing.
1546
+ *
1547
+ * @group Drawings
903
1548
  */
904
1549
  type MoveToCommand = ['M', AdjustCoordinate, AdjustCoordinate];
905
1550
 
906
1551
  /**
907
1552
  * A path command to draw a quadratic Bézier curve to an endpoint.
1553
+ *
1554
+ * @group Drawings
908
1555
  */
909
1556
  type QuadraticBezierToCommand = ['Q', AdjustCoordinate, AdjustCoordinate, AdjustCoordinate, AdjustCoordinate];
910
1557
 
@@ -912,6 +1559,8 @@ type QuadraticBezierToCommand = ['Q', AdjustCoordinate, AdjustCoordinate, Adjust
912
1559
  * Path command for shape geometry.
913
1560
  *
914
1561
  * Defines a single drawing command in a shape path, using a subset of SVG path commands.
1562
+ *
1563
+ * @group Drawings
915
1564
  */
916
1565
  type PathCommand = ArcToCommand | CloseCommand | CubicBezierToCommand | LineToCommand | MoveToCommand | QuadraticBezierToCommand;
917
1566
 
@@ -926,6 +1575,8 @@ type PathCommand = ArcToCommand | CloseCommand | CubicBezierToCommand | LineToCo
926
1575
  * | `lightenLess` | slightly lighter shaded color applied to its fill.
927
1576
  * | `none` | should have no fill.
928
1577
  * | `norm` | should have a normally shaded color applied to its fill.
1578
+ *
1579
+ * @group Drawings
929
1580
  */
930
1581
  type PathFillMode = 'none' | 'norm' | 'lighten' | 'lightenLess' | 'darken' | 'darkenLess';
931
1582
 
@@ -934,6 +1585,8 @@ type PathFillMode = 'none' | 'norm' | 'lighten' | 'lightenLess' | 'darken' | 'da
934
1585
  *
935
1586
  * Defines a single path within a custom shape's geometry, including
936
1587
  * the path commands and rendering properties for that path.
1588
+ *
1589
+ * @group Drawings
937
1590
  */
938
1591
  type Path = {
939
1592
  /** Whether this path should be stroked (outlined). */
@@ -960,6 +1613,8 @@ type Path = {
960
1613
 
961
1614
  /**
962
1615
  * Defines an inset or internal margins for a text box within a shape.
1616
+ *
1617
+ * @group Drawings
963
1618
  */
964
1619
  type InsetRect = {
965
1620
  /**
@@ -984,7 +1639,11 @@ type InsetRect = {
984
1639
  r?: EmuValue;
985
1640
  };
986
1641
 
987
- /** A paragraph of text. */
1642
+ /**
1643
+ * A paragraph of text.
1644
+ *
1645
+ * @group Drawings
1646
+ */
988
1647
  type Paragraph = {
989
1648
  /** Text content. */
990
1649
  text: string;
@@ -1002,6 +1661,8 @@ type Paragraph = {
1002
1661
  * | `b` | Bottom aligned |
1003
1662
  * | `dist` | Distributed (evenly spaced lines) |
1004
1663
  * | `just` | Justified (stretched to fill container) |
1664
+ *
1665
+ * @group Drawings
1005
1666
  */
1006
1667
  type TextAnchoring = 't' | 'b' | 'ctr' | 'dist' | 'just';
1007
1668
 
@@ -1014,6 +1675,8 @@ type TextAnchoring = 't' | 'b' | 'ctr' | 'dist' | 'just';
1014
1675
  * |------------|-----------------------------------------------|
1015
1676
  * | `overflow` | Text extends beyond container bounds |
1016
1677
  * | `clip` | Text is clipped at container edge |
1678
+ *
1679
+ * @group Drawings
1017
1680
  */
1018
1681
  type TextHorzOverflow = 'overflow' | 'clip';
1019
1682
 
@@ -1029,6 +1692,8 @@ type TextHorzOverflow = 'overflow' | 'clip';
1029
1692
  * | `wordArtVertRtl` | Vertical WordArt should be shown from right to left.
1030
1693
  * | `eaVert` | Some fonts are rotated by 90° while some (East Asian) are shown vertically.
1031
1694
  * | `mongolianVert` | `eaVert` but the text flows top down then LEFT RIGHT, instead of RIGHT LEFT.
1695
+ *
1696
+ * @group Drawings
1032
1697
  */
1033
1698
  type TextVerticalType = 'horz' | 'vert' | 'vert270' | 'wordArtVert' | 'eaVert' | 'mongolianVert' | 'wordArtVertRtl';
1034
1699
 
@@ -1042,6 +1707,8 @@ type TextVerticalType = 'horz' | 'vert' | 'vert270' | 'wordArtVert' | 'eaVert' |
1042
1707
  * | `overflow` | Text extends beyond container bounds |
1043
1708
  * | `ellipsis` | Text is truncated with ellipsis indicator |
1044
1709
  * | `clip` | Text is clipped at container edge |
1710
+ *
1711
+ * @group Drawings
1045
1712
  */
1046
1713
  type TextVertOverflow = 'overflow' | 'ellipsis' | 'clip';
1047
1714
 
@@ -1054,6 +1721,8 @@ type TextVertOverflow = 'overflow' | 'ellipsis' | 'clip';
1054
1721
  * |----------|---------------------------------------------|
1055
1722
  * | `none` | No wrapping (text runs on a single line) |
1056
1723
  * | `square` | Wrap text at container boundaries |
1724
+ *
1725
+ * @group Drawings
1057
1726
  */
1058
1727
  type TextWrapping = 'none' | 'square';
1059
1728
 
@@ -1062,6 +1731,8 @@ type TextWrapping = 'none' | 'square';
1062
1731
  *
1063
1732
  * Defines the text content within a shape, including paragraphs and formatting properties
1064
1733
  * such as alignment, overflow behavior, columns, rotation, and insets.
1734
+ *
1735
+ * @group Drawings
1065
1736
  */
1066
1737
  type TextBody = {
1067
1738
  /**
@@ -1132,6 +1803,13 @@ type TextBody = {
1132
1803
  p: Paragraph[];
1133
1804
  };
1134
1805
 
1806
+ /**
1807
+ * Represents a point that can be adjusted in a shape. Each coordinate (x and y) can be defined as
1808
+ * an {@link AdjustCoordinate}, which allows for flexible positioning based on the shape's
1809
+ * dimensions and other factors.
1810
+ *
1811
+ * @group Drawings
1812
+ */
1135
1813
  type AdjustPoint = {
1136
1814
  x: AdjustCoordinate;
1137
1815
  y: AdjustCoordinate;
@@ -1142,6 +1820,8 @@ type AdjustPoint = {
1142
1820
  *
1143
1821
  * Defines an interactive handle that can be dragged to adjust shape geometry
1144
1822
  * using polar coordinates (angle and radius from a center point).
1823
+ *
1824
+ * @group Drawings
1145
1825
  */
1146
1826
  type AdjustValueHandlePolar = {
1147
1827
  /** Type discriminator for polar adjustment handles. */
@@ -1167,6 +1847,8 @@ type AdjustValueHandlePolar = {
1167
1847
  *
1168
1848
  * Defines an interactive handle that can be dragged to adjust shape geometry
1169
1849
  * using Cartesian coordinates (X and Y positions).
1850
+ *
1851
+ * @group Drawings
1170
1852
  */
1171
1853
  type AdjustValueHandleXY = {
1172
1854
  /** Type discriminator for XY adjustment handles. */
@@ -1203,12 +1885,16 @@ type AdjustValueHandleXY = {
1203
1885
  * | `invGray` (Inverse Gray) | Rendered with inverse gray coloring
1204
1886
  * | `ltGray` (Light Gray) | Rendered with light gray coloring
1205
1887
  * | `white` (White) | Rendered within white coloring
1888
+ *
1889
+ * @group Drawings
1206
1890
  */
1207
1891
  type BlackWhiteMode = 'clr' | 'auto' | 'gray' | 'ltGray' | 'invGray' | 'grayWhite' | 'blackGray' | 'blackWhite' | 'black' | 'white' | 'hidden';
1208
1892
 
1209
1893
  /**
1210
1894
  * Defines a connection point on a shape where other shapes can connect.
1211
1895
  * Connection points are used for connecting shapes with connectors/lines in diagrams.
1896
+ *
1897
+ * @group Drawings
1212
1898
  */
1213
1899
  type ConnectionPoint = {
1214
1900
  /** The position of the connection point on the shape */
@@ -1220,6 +1906,11 @@ type ConnectionPoint = {
1220
1906
  ang?: DmlAngle | GeomGuideName;
1221
1907
  };
1222
1908
 
1909
+ /**
1910
+ * Represents the index of a font style in a drawing.
1911
+ *
1912
+ * @group Drawings
1913
+ */
1223
1914
  type FontStyleIndex = 'major' | 'minor' | 'none';
1224
1915
 
1225
1916
  /**
@@ -1227,6 +1918,8 @@ type FontStyleIndex = 'major' | 'minor' | 'none';
1227
1918
  *
1228
1919
  * Defines a named calculation point that can be referenced in shape paths
1229
1920
  * and used to create parameterized, adjustable geometry.
1921
+ *
1922
+ * @group Drawings
1230
1923
  */
1231
1924
  type GuidePoint = {
1232
1925
  /**
@@ -1244,6 +1937,8 @@ type GuidePoint = {
1244
1937
  *
1245
1938
  * Defines the inset rectangle within a shape where text should be positioned,
1246
1939
  * specified using adjustable coordinates relative to the shape's geometry.
1940
+ *
1941
+ * @group Drawings
1247
1942
  */
1248
1943
  type ShapeRect = {
1249
1944
  /** Top edge inset from shape bounds. */
@@ -1258,6 +1953,8 @@ type ShapeRect = {
1258
1953
 
1259
1954
  /**
1260
1955
  * Transform directions to be applied to drawn graphic objects.
1956
+ *
1957
+ * @group Drawings
1261
1958
  */
1262
1959
  type Xfrm = {
1263
1960
  /**
@@ -1278,6 +1975,9 @@ type Xfrm = {
1278
1975
  ext?: Extent;
1279
1976
  };
1280
1977
 
1978
+ /**
1979
+ * @group Drawings
1980
+ */
1281
1981
  type ShapeStyle = {
1282
1982
  line?: {
1283
1983
  color: Color;
@@ -1302,6 +2002,8 @@ type ShapeStyle = {
1302
2002
  *
1303
2003
  * Defines the complete visual styling and custom geometry for a shape,
1304
2004
  * including fill, line, transformation, custom paths, and interactive handles.
2005
+ *
2006
+ * @group Drawings
1305
2007
  */
1306
2008
  type Shape = {
1307
2009
  /** 2D transformation (position, rotation, scale). */
@@ -1332,6 +2034,8 @@ type Shape = {
1332
2034
 
1333
2035
  /**
1334
2036
  * Bitmap graphic / Picture.
2037
+ *
2038
+ * @group Drawings
1335
2039
  */
1336
2040
  type GraphicBitmap = {
1337
2041
  /** Type discriminator for bitmap graphics. */
@@ -1370,6 +2074,8 @@ type GraphicBitmap = {
1370
2074
 
1371
2075
  /**
1372
2076
  * A chart or plot.
2077
+ *
2078
+ * @group Drawings
1373
2079
  */
1374
2080
  type GraphicChart = {
1375
2081
  /** Type discriminator for a chart. */
@@ -1389,6 +2095,8 @@ type GraphicChart = {
1389
2095
  *
1390
2096
  * Represents a connector or line shape that connects two other shapes,
1391
2097
  * typically used for creating diagrams, flowcharts, and organizational charts.
2098
+ *
2099
+ * @group Drawings
1392
2100
  */
1393
2101
  type GraphicConnectionShape = {
1394
2102
  /** Type discriminator for connection shapes. */
@@ -1407,6 +2115,8 @@ type GraphicConnectionShape = {
1407
2115
 
1408
2116
  /**
1409
2117
  * Transform directions to be applied to group objects.
2118
+ *
2119
+ * @group Drawings
1410
2120
  */
1411
2121
  type XfrmGroup = Xfrm & {
1412
2122
  /** Child offset - position of child elements within a group. */
@@ -1420,6 +2130,8 @@ type XfrmGroup = Xfrm & {
1420
2130
  *
1421
2131
  * Represents a collection of graphic objects grouped together as a single unit,
1422
2132
  * allowing them to be transformed, moved, and manipulated collectively.
2133
+ *
2134
+ * @group Drawings
1423
2135
  */
1424
2136
  type GraphicGroup = {
1425
2137
  /** Type discriminator for group shapes. */
@@ -1439,6 +2151,8 @@ type GraphicGroup = {
1439
2151
  *
1440
2152
  * Represents a standard geometric shape (rectangle, circle, arrow, etc.)
1441
2153
  * with customizable geometry, styling, and text content.
2154
+ *
2155
+ * @group Drawings
1442
2156
  */
1443
2157
  type GraphicShape = {
1444
2158
  /** Type discriminator for basic shapes. */
@@ -1455,7 +2169,11 @@ type GraphicShape = {
1455
2169
  text?: TextBody;
1456
2170
  };
1457
2171
 
1458
- /** A graphic element. */
2172
+ /**
2173
+ * A graphic element.
2174
+ *
2175
+ * @group Drawings
2176
+ */
1459
2177
  type Graphic = GraphicChart | GraphicBitmap | GraphicShape | GraphicConnectionShape | GraphicGroup;
1460
2178
 
1461
2179
  /**
@@ -1463,6 +2181,8 @@ type Graphic = GraphicChart | GraphicBitmap | GraphicShape | GraphicConnectionSh
1463
2181
  *
1464
2182
  * A drawing is a collection of any graphic objects that should be displayed in a worksheet as
1465
2183
  * well as information on how they are positioned within the cell-grid.
2184
+ *
2185
+ * @group Drawings
1466
2186
  */
1467
2187
  type Drawing = {
1468
2188
  /** Defines how the drawing is placed onto a worksheet's cell-grid. */
@@ -1474,6 +2194,8 @@ type Drawing = {
1474
2194
  /**
1475
2195
  * The style to use when drawing a cell border. If the worksheet's zoom factor is changed the width
1476
2196
  * of the border is expected to stay the same.
2197
+ *
2198
+ * @group Workbooks
1477
2199
  */
1478
2200
  type BorderStyle =
1479
2201
  /** No border is drawn.*/
@@ -1510,6 +2232,8 @@ type BorderStyle =
1510
2232
 
1511
2233
  /**
1512
2234
  * Specifies the horizontal alignment of content (text) within a container (cell).
2235
+ *
2236
+ * @group Workbooks
1513
2237
  */
1514
2238
  type HAlign =
1515
2239
  /**
@@ -1545,19 +2269,29 @@ type HAlign =
1545
2269
  /**
1546
2270
  * The style of fill pattern used for a cell background. If the worksheets zoom factor is changed
1547
2271
  * the pixel scale of the pattern is still expected to stay the same.
2272
+ *
2273
+ * @group Workbooks
1548
2274
  */
1549
2275
  type PatternStyle = 'none' | 'solid' | 'mediumGray' | 'darkGray' | 'lightGray' | 'darkHorizontal' | 'darkVertical' | 'darkDown' | 'darkUp' | 'darkGrid' | 'darkTrellis' | 'lightHorizontal' | 'lightVertical' | 'lightDown' | 'lightUp' | 'lightGrid' | 'lightTrellis' | 'gray125' | 'gray0625';
1550
2276
 
1551
2277
  /**
1552
2278
  * Which type of underline to use when rendering text.
2279
+ *
2280
+ * @group Workbooks
1553
2281
  */
1554
2282
  type Underline = 'none' | 'single' | 'singleAccounting' | 'double' | 'doubleAccounting';
1555
2283
 
1556
- /** Vertical alignment of a cell content. */
2284
+ /**
2285
+ * Vertical alignment of a cell content.
2286
+ *
2287
+ * @group Workbooks
2288
+ */
1557
2289
  type VAlign = 'bottom' | 'top' | 'center' | 'justify' | 'distributed';
1558
2290
 
1559
2291
  /**
1560
2292
  * Style rules that specify the visual presentation of a cell.
2293
+ *
2294
+ * @group Workbooks
1561
2295
  */
1562
2296
  type Style = {
1563
2297
  /**
@@ -1566,6 +2300,24 @@ type Style = {
1566
2300
  * @default "Calibri"
1567
2301
  */
1568
2302
  fontFamily?: string;
2303
+ /**
2304
+ * Identifies the font scheme, if any, to which this style's font belongs.
2305
+ *
2306
+ * When set, the {@link Style.fontFamily} property is ignored and the font is instead resolved by
2307
+ * the workbook theme. `"major"` maps to the theme's heading font and `"minor"` to the body font.
2308
+ * The actual typeface is determined by the theme's {@link ThemeFontCollection} at render time.
2309
+ *
2310
+ * When the theme changes, an application is expected to update the fonts associated with a scheme
2311
+ * automatically.
2312
+ *
2313
+ * It is an error to set this when a workbook has no theme.
2314
+ *
2315
+ * @see {@link Workbook.theme}
2316
+ * @see {@link Theme.fontScheme}
2317
+ * @see {@link ThemeFontScheme}
2318
+ * @see {@link ThemeFontCollection}
2319
+ */
2320
+ fontScheme?: 'major' | 'minor';
1569
2321
  /**
1570
2322
  * The font size in pixels.
1571
2323
  *
@@ -1680,19 +2432,29 @@ type Style = {
1680
2432
  /**
1681
2433
  * The degrees to which the cell text should be rotated. Values range from 0 to 180, and 255 to
1682
2434
  * indicate vertical text. The origin of the rotation is the first letter of the text.
2435
+ *
2436
+ * @min 0
2437
+ * @max 255
2438
+ * @defaultValue 0
1683
2439
  */
1684
- textRotation?: boolean;
2440
+ textRotation?: integer;
1685
2441
  /**
1686
2442
  * Formatting directions for rendering the cell's value to text.
1687
2443
  */
1688
2444
  numberFormat?: string;
1689
2445
  };
1690
2446
 
1691
- /** Describes the type of values found in the cells of a table column. */
2447
+ /**
2448
+ * Describes the type of values found in the cells of a table column.
2449
+ *
2450
+ * @group Workbooks
2451
+ */
1692
2452
  type TableColumnDataType = 'text' | 'number' | 'boolean' | 'datetime' | 'unknown';
1693
2453
 
1694
2454
  /**
1695
2455
  * Describes a column within a table.
2456
+ *
2457
+ * @group Workbooks
1696
2458
  */
1697
2459
  type TableColumn = {
1698
2460
  /**
@@ -1714,12 +2476,18 @@ type TableColumn = {
1714
2476
  formula?: string;
1715
2477
  };
1716
2478
 
1717
- /** Excel's built-in table style names. */
2479
+ /**
2480
+ * Excel's built-in table style names.
2481
+ *
2482
+ * @group Workbooks
2483
+ */
1718
2484
  type TableStyleName = 'TableStyleDark1' | 'TableStyleDark2' | 'TableStyleDark3' | 'TableStyleDark4' | 'TableStyleDark5' | 'TableStyleDark6' | 'TableStyleDark7' | 'TableStyleDark8' | 'TableStyleDark9' | 'TableStyleDark10' | 'TableStyleDark11' | 'TableStyleLight1' | 'TableStyleLight2' | 'TableStyleLight3' | 'TableStyleLight4' | 'TableStyleLight5' | 'TableStyleLight6' | 'TableStyleLight7' | 'TableStyleLight8' | 'TableStyleLight9' | 'TableStyleLight10' | 'TableStyleLight11' | 'TableStyleLight12' | 'TableStyleLight13' | 'TableStyleLight14' | 'TableStyleLight15' | 'TableStyleLight16' | 'TableStyleLight17' | 'TableStyleLight18' | 'TableStyleLight19' | 'TableStyleLight20' | 'TableStyleLight21' | 'TableStyleMedium1' | 'TableStyleMedium2' | 'TableStyleMedium3' | 'TableStyleMedium4' | 'TableStyleMedium5' | 'TableStyleMedium6' | 'TableStyleMedium7' | 'TableStyleMedium8' | 'TableStyleMedium9' | 'TableStyleMedium10' | 'TableStyleMedium11' | 'TableStyleMedium12' | 'TableStyleMedium13' | 'TableStyleMedium14' | 'TableStyleMedium15' | 'TableStyleMedium16' | 'TableStyleMedium17' | 'TableStyleMedium18' | 'TableStyleMedium19' | 'TableStyleMedium20' | 'TableStyleMedium21' | 'TableStyleMedium22' | 'TableStyleMedium23' | 'TableStyleMedium24' | 'TableStyleMedium25' | 'TableStyleMedium26' | 'TableStyleMedium27' | 'TableStyleMedium28';
1719
2485
 
1720
2486
  /**
1721
2487
  * Describes which style is used to display this table, and specifies which portions of the table
1722
2488
  * have which styles applied.
2489
+ *
2490
+ * @group Workbooks
1723
2491
  */
1724
2492
  type TableStyle = {
1725
2493
  /**
@@ -1763,6 +2531,7 @@ type TableStyle = {
1763
2531
  * calculated columns.
1764
2532
  *
1765
2533
  * @see {@link https://support.microsoft.com/office/f5ed2452-2337-4f71-bed3-c8ae6d2b276e}
2534
+ * @group Workbooks
1766
2535
  */
1767
2536
  type Table = {
1768
2537
  /**
@@ -1806,233 +2575,2029 @@ type Table = {
1806
2575
  };
1807
2576
 
1808
2577
  /**
1809
- * Directions on how formulas should be recalculated in the workbook.
2578
+ * A custom colour, used to add extra colours to a theme.
2579
+ *
2580
+ * @group Themes
1810
2581
  */
1811
- type CalcProps = {
1812
- /**
1813
- * Specifies whether an attempt should be made to calculate formulas that contain circular
1814
- * references. Defaults to `false` in Excel.
1815
- */
1816
- iterate?: boolean;
1817
- /**
1818
- * The maximum number of calculation iterations, when {@link CalcProps.iterate} is `true`.
1819
- * Defaults to `100` in Excel.
1820
- */
1821
- iterateCount?: integer;
1822
- /**
1823
- * When a calculation iteration results in an absolute change that is less than iterateDelta,
1824
- * then no further iterations should be attempted. Defaults to `0.001` in Excel.
1825
- */
1826
- iterateDelta?: number;
1827
- /**
1828
- * Which of the two date systems the workbook uses. 1900 is the default.
1829
- *
1830
- * @see {@link https://support.microsoft.com/office/e7fe7167-48a9-4b96-bb53-5612a800b487 | Date systems in Excel}
1831
- */
1832
- epoch?: 1900 | 1904;
1833
- /**
1834
- * The calculation mode for the workbook.
1835
- *
1836
- * - `"auto"` (default when absent): recalculate all formulas automatically.
1837
- * - `"autoNoTable"`: recalculate automatically but exclude data tables.
1838
- * - `"manual"`: formulas are only recalculated when explicitly triggered.
1839
- *
1840
- * @defaultValue "auto"
1841
- */
1842
- calcMode?: 'auto' | 'autoNoTable' | 'manual';
2582
+ type ThemeCustomColor = {
2583
+ name?: string;
2584
+ color: Color;
1843
2585
  };
1844
2586
 
1845
2587
  /**
1846
- * A collection of default properties that apply to cells, rows, or columns in the worksheet.
2588
+ * Canonical theme colour palette.
2589
+ *
2590
+ * Consists of twelve colours that come together to form the colour scheme for a theme.
2591
+ *
2592
+ * @group Themes
1847
2593
  */
1848
- type WorksheetDefaults = {
1849
- /** Default width of the UI-grid column. */
1850
- colWidth: PixelValue;
1851
- /** Default height of the UI-grid height. */
1852
- rowHeight: PixelValue;
2594
+ type ThemeColorScheme = {
2595
+ /** Colour scheme name. */
2596
+ name: string;
2597
+ /** The "light 1" colour. */
2598
+ lt1: Color;
2599
+ /** The "dark 1" colour. */
2600
+ dk1: Color;
2601
+ /** The "light 2" colour. */
2602
+ lt2: Color;
2603
+ /** The "dark 2" colour. */
2604
+ dk2: Color;
2605
+ /** Accent 1 colour. */
2606
+ accent1: Color;
2607
+ /** Accent 2 colour. */
2608
+ accent2: Color;
2609
+ /** Accent 3 colour. */
2610
+ accent3: Color;
2611
+ /** Accent 4 colour. */
2612
+ accent4: Color;
2613
+ /** Accent 5 colour. */
2614
+ accent5: Color;
2615
+ /** Accent 6 colour. */
2616
+ accent6: Color;
2617
+ /** Unvisited hyperlink colour. */
2618
+ hlink: Color;
2619
+ /** Visited hyperlink colour. */
2620
+ folHlink: Color;
1853
2621
  };
1854
2622
 
1855
2623
  /**
1856
- * Visual scale (aka zoom level, aka magnification) applied when displaying a worksheet.
2624
+ * Script-specific supplemental font.
1857
2625
  *
1858
- * Each of the three layouts has its own scale. A scale is represented as a percentage, with `100`
1859
- * (100%) being the default 1:1 scale. When a layout has no explicit scale, use 100%.
2626
+ * @group Themes
1860
2627
  */
1861
- type WorksheetLayoutScales = {
1862
- /**
1863
- * Zoom level for normal view.
1864
- *
1865
- * @min 10
1866
- * @max 400
1867
- * @defaultValue 100
1868
- * */
1869
- normal?: integer;
1870
- /**
1871
- * Zoom level for page layout view.
1872
- *
1873
- * @min 10
1874
- * @max 400
1875
- * @defaultValue 100
1876
- */
1877
- pageLayout?: integer;
2628
+ type ThemeSupplementalFont = {
1878
2629
  /**
1879
- * Zoom level for page break preview (aka sheet layout view).
2630
+ * ISO 15924 script code (e.g. `Egyp`, `Arab`).
1880
2631
  *
1881
- * @min 10
1882
- * @max 400
1883
- * @defaultValue 100
2632
+ * @see {@link https://en.wikipedia.org/wiki/ISO_15924}
1884
2633
  */
1885
- pageBreakPreview?: integer;
2634
+ script: string;
2635
+ /** Font face to use for this script. */
2636
+ typeface: string;
1886
2637
  };
1887
2638
 
1888
2639
  /**
1889
- * A worksheet view.
1890
- *
1891
- * A worksheet view is a display configuration for a particular worksheet. Worksheet view settings
1892
- * can include:
1893
- *
1894
- * - Active cell
1895
- * - Selected ranges
1896
- * - View type (normal, page layout, or page break layout)
1897
- * - Zoom level
2640
+ * A font definition.
1898
2641
  *
1899
- * Currently JSF does not include all available settings for a worksheet.
2642
+ * @group Themes
1900
2643
  */
1901
- type WorksheetView = {
2644
+ type ThemeTextFont = {
1902
2645
  /**
1903
- * The id of the workbook view this worksheet view belongs to.
2646
+ * Typeface name, e.g. `"Calibri"`.
1904
2647
  *
1905
- * This is a zero-based index of the workbook view, as stored in the {@link Workbook.views} array.
2648
+ * Specifies the name of the font to be used. If this font isn't available, font substitution
2649
+ * should be used in order to select an alternate font.
2650
+ */
2651
+ typeface: string;
2652
+ /**
2653
+ * PANOSE 1.0 classification as hex. Used to guide selection of a similar alternate font if the
2654
+ * chosen font is unavailable.
1906
2655
  *
1907
- * Within a single worksheet, each view must reference a distinct workbook view (i.e. no two views
1908
- * in the same worksheet can share the same `workbookView` id). However, views from different
1909
- * worksheets may reference the same workbook view.
2656
+ * @see {@link https://en.wikipedia.org/wiki/PANOSE}
1910
2657
  */
1911
- workbookView: integer;
1912
- /** Cell that is selected by default when the sheet is visible. */
1913
- activeCell?: CellId;
1914
- /** Ranges of cells that are selected by default when the sheet is visible. */
1915
- activeRanges?: CellRange[];
2658
+ panose?: string;
1916
2659
  /**
1917
- * The layout used to display the worksheet.
2660
+ * Charset byte value.
1918
2661
  *
1919
- * @defaultValue "normal"
2662
+ * Specifies the character set supported by the font. Used in font substitution logic to locate an
2663
+ * appropriate substitute font when this font isn't available.
2664
+ *
2665
+ * | Value | Description |
2666
+ * |-----------------|-------------------------------------------------------------|
2667
+ * | 0 | ANSI character set (IANA name `iso-8859-1`) |
2668
+ * | 1 | Default character set |
2669
+ * | 2 | Symbol character set |
2670
+ * | 77 | Mac character set (IANA name `macintosh`) |
2671
+ * | 128 | Shift JIS character set (IANA name `shift_jis`) |
2672
+ * | 129 | Hangul character set (IANA name `ks_c_5601-1987`) |
2673
+ * | 130 | Johab character set (IANA name `KS C-5601-1992`) |
2674
+ * | 134 | GB-2312 character set (IANA name `GBK`) |
2675
+ * | 136 | Chinese Big Five character set (IANA name `Big5`) |
2676
+ * | 161 | Greek character set (IANA name `windows-1253`) |
2677
+ * | 162 | Turkish character set (IANA name `iso-8859-9`) |
2678
+ * | 163 | Vietnamese character set (IANA name `windows-1258`) |
2679
+ * | 177 | Hebrew character set (IANA name `windows-1255`) |
2680
+ * | 178 | Arabic character set (IANA name `windows-1256`) |
2681
+ * | 186 | Baltic character set (IANA name `windows-1257`) |
2682
+ * | 204 | Russian character set (IANA name `windows-1251`) |
2683
+ * | 222 | Thai character set (IANA name `windows-874`) |
2684
+ * | 238 | Eastern European character set (IANA name `windows-1250`) |
2685
+ * | 255 | Specifies an OEM character set not defined by ISO/IEC 29500 |
2686
+ * | Any other value | Application-defined, can be ignored |
1920
2687
  */
1921
- activeLayout?: 'normal' | 'pageLayout' | 'pageBreakPreview';
2688
+ charset?: number;
1922
2689
  /**
1923
- * Scale (aka zoom level, aka magnification) applied when displaying a worksheet. Each different
1924
- * layout has its own scale.
2690
+ * Specifies the font pitch.
2691
+ *
2692
+ * | Value | Description |
2693
+ * |------:|-----------------------------------------|
2694
+ * | 0 | Default pitch + unknown font family |
2695
+ * | 1 | Fixed pitch + unknown font family |
2696
+ * | 2 | Variable pitch + unknown font family |
2697
+ * | 16 | Default pitch + roman font family |
2698
+ * | 17 | Fixed pitch + roman font family |
2699
+ * | 18 | Variable pitch + roman font family |
2700
+ * | 32 | Default pitch + Swiss font family |
2701
+ * | 33 | Fixed pitch + Swiss font family |
2702
+ * | 34 | Variable pitch + Swiss font family |
2703
+ * | 48 | Default pitch + modern font family |
2704
+ * | 49 | Fixed pitch + modern font family |
2705
+ * | 50 | Variable pitch + modern font family |
2706
+ * | 64 | Default pitch + script font family |
2707
+ * | 65 | Fixed pitch + script font family |
2708
+ * | 66 | Variable pitch + script font family |
2709
+ * | 80 | Default pitch + decorative font family |
2710
+ * | 81 | Fixed pitch + decorative font family |
2711
+ * | 82 | Variable pitch + decorative font family |
1925
2712
  */
1926
- layoutScales?: WorksheetLayoutScales;
2713
+ pitchFamily?: number;
1927
2714
  };
1928
2715
 
1929
2716
  /**
1930
- * A rectangle of cells. A sheet within a spreadsheet.
2717
+ * A font collection from the theme.
2718
+ *
2719
+ * A font collection consists of a font definition for Latin, East Asian, and complex script. On top
2720
+ * of these, a font collection can also define a font for use in a specific language or languages.
2721
+ *
2722
+ * @group Themes
1931
2723
  */
1932
- type Worksheet = {
1933
- /** Name of the worksheet. */
1934
- name: string;
1935
- /** The cells belonging to the worksheet that have some data attached. */
1936
- cells: Record<CellId, Cell>;
1937
- comments?: ThreadedComment[];
1938
- notes?: Note[];
1939
- /** Widths and styles of the columns in the worksheet. */
1940
- columns?: GridSize[];
1941
- /** Heights and styles of the rows in the worksheet. */
1942
- rows?: GridSize[];
1943
- /** Ranges that capture which cells have been merged. */
1944
- merges?: string[];
1945
- /** A collection of default properties that apply to cells, rows, or columns in the worksheet. */
1946
- defaults?: WorksheetDefaults;
2724
+ type ThemeFontCollection = {
2725
+ /** Latin script defaults. */
2726
+ latin: ThemeTextFont;
2727
+ /** East Asian script defaults. */
2728
+ eastAsian?: ThemeTextFont;
2729
+ /** Complex script defaults. */
2730
+ complexScript?: ThemeTextFont;
1947
2731
  /**
1948
- * Whether or not the sheet should be shown to a user in a UI displaying the workbook.
1949
- *
1950
- * - 0 = sheet is visible
1951
- * - 1 = sheet is hidden
1952
- * - 2 = sheet is "very hidden"
1953
- *
1954
- * @see {@link https://exceloffthegrid.com/make-excel-sheets-very-hidden/}
2732
+ * Additional fonts used for language-specific fonts in themes. For example, one can specify a
2733
+ * font that gets used only within the Japanese language context.
1955
2734
  */
1956
- hidden?: 0 | 1 | 2;
1957
- /** Indicates whether a hairline-grid should be drawn when displaying the sheet. */
1958
- showGridLines?: boolean;
1959
- /** The different display configurations saved for the worksheet. */
1960
- views?: WorksheetView[];
1961
- /** A list of drawings that appear in this worksheet. */
1962
- drawing?: Drawing[];
2735
+ supplemental?: ThemeSupplementalFont[];
1963
2736
  };
1964
2737
 
1965
2738
  /**
1966
- * A workbook view.
2739
+ * Theme font pair (major and minor font).
1967
2740
  *
1968
- * A workbook view is the display settings that apply to the entire workbook. Workbook view settings
1969
- * include:
2741
+ * @group Themes
2742
+ */
2743
+ type ThemeFontScheme = {
2744
+ /** Name of the font scheme. */
2745
+ name: string;
2746
+ /** Major theme font. */
2747
+ major: ThemeFontCollection;
2748
+ /** Minor theme font. */
2749
+ minor: ThemeFontCollection;
2750
+ };
2751
+
2752
+ /**
2753
+ * Workbook theme.
1970
2754
  *
1971
- * - Active sheet
1972
- * - Window size and position
1973
- * - Window state (whether the window is maximised, minimised, etc)
1974
- * - Scroll bar visibility
2755
+ * This covers colours and fonts, but does not include fill styles, background fill styles, line
2756
+ * styles, and effect styles. This is left for a future date.
1975
2757
  *
1976
- * Currently JSF does not include all available settings for a workbook.
2758
+ * @group Themes
1977
2759
  */
1978
- type WorkbookView = {
2760
+ type Theme = {
1979
2761
  /**
1980
- * Index to the active sheet in this workbook view. The default value is 0 (first sheet).
2762
+ * Theme name.
1981
2763
  *
1982
- * @defaultValue 0
2764
+ * @default ""
1983
2765
  */
1984
- activeSheet?: integer;
2766
+ name?: string;
2767
+ /** Theme colour palette. */
2768
+ colorScheme: ThemeColorScheme;
2769
+ /** Theme major/minor font choice. */
2770
+ fontScheme: ThemeFontScheme;
2771
+ /**
2772
+ * Custom colour palettes.
2773
+ */
2774
+ customColors?: ThemeCustomColor[];
1985
2775
  };
1986
2776
 
1987
2777
  /**
1988
- * A workbook is a collection of worksheets, styles, defined names, and other metadata. It's what's
1989
- * commonly known as a spreadsheet.
2778
+ * The axis a pivot field can be placed on.
2779
+ *
2780
+ * @group PivotTables
1990
2781
  */
1991
- type Workbook = {
1992
- /** Name of the workbook. In the case of a .xlsx file it will be the filename. */
1993
- name: string;
1994
- /** An ordered array of the worksheets in the workbook. */
1995
- sheets: Worksheet[];
1996
- /** An array of the workbook's defined names. */
1997
- names?: DefinedName[];
1998
- /** Metadata on the workbook's tables. */
1999
- tables?: Table[];
2000
- /** Directions on how formulas should be recalculated in the workbook. */
2001
- calculationProperties?: CalcProps;
2002
- /** Styles for cells in the workbook. */
2003
- styles?: Style[];
2004
- /** External cells referenced by the workbook. An external cell is a cell in another workbook. */
2005
- externals?: External[];
2782
+ type PivotFieldAxis = 'row' | 'col' | 'page';
2783
+
2784
+ /**
2785
+ * The axis a pivot area targets. Extends {@link PivotFieldAxis} with an additional `'values'`
2786
+ * option for the data-values axis.
2787
+ *
2788
+ * @group PivotTables
2789
+ */
2790
+ type PivotAreaAxis = PivotFieldAxis | 'values';
2791
+
2792
+ /**
2793
+ * A reference within a pivot area, identifying specific field items that define the area's scope.
2794
+ *
2795
+ * @group PivotTables
2796
+ */
2797
+ type PivotAreaReference = {
2006
2798
  /**
2007
- * Deduplicated formulas used in the workbook. Stored in R1C1 notation. Two formulas are
2008
- * considered to be the same when their respective representations in R1C1 notation, are
2009
- * identical.
2799
+ * Index of the field this reference applies to.
2800
+ * The special value `4294967294` (0xFFFFFFFE) refers to the data (values) field.
2010
2801
  */
2011
- formulas?: string[];
2012
- /** The different display configurations saved for the workbook. */
2013
- views?: WorkbookView[];
2802
+ field?: integer;
2014
2803
  /**
2015
- * Individuals who have written a threaded comment in this workbook, or who have been mentioned in
2016
- * one.
2804
+ * Whether this reference participates in the selection. When false, the reference
2805
+ * constrains the area without being selected itself.
2017
2806
  *
2018
- * @see {@link ThreadedComment}
2807
+ * @default true
2019
2808
  */
2020
- people?: Person[];
2809
+ selected?: boolean;
2021
2810
  /**
2022
- * A simple dictionary of binary images used by this workbook.
2811
+ * Whether item indices are positional (absolute row/column position)
2812
+ * rather than field-item-based.
2023
2813
  *
2024
- * The keys should be the file paths of the images used to refer to them, commonly these will be
2025
- * the `mediaId` properties on drawing objects. The values should be data URI encoded binaries.
2814
+ * @default false
2815
+ */
2816
+ byPosition?: boolean;
2817
+ /**
2818
+ * Whether the reference is relative to the pivot table's origin.
2026
2819
  *
2027
- * The following is a table of formats you may be expected to encounter:
2820
+ * @default false
2821
+ */
2822
+ relative?: boolean;
2823
+ /**
2824
+ * Whether the default subtotal is included.
2028
2825
  *
2029
- * | Extension | MIME type | Common name
2030
- * |-------------------------|------------------------|-------------
2031
- * | `.png` | `image/png` | Portable Network Graphics
2032
- * | `.jpg`, `.jpeg` | `image/jpeg` | JPEG
2033
- * | `.gif` | `image/gif` | Graphics Interchange Format
2034
- * | `.emf` | `image/emf` | Enhanced Metafile
2035
- * | `.wmf` | `image/wmf` | Windows Metafile
2826
+ * @default false
2827
+ */
2828
+ defaultSubtotal?: boolean;
2829
+ /**
2830
+ * Whether the sum subtotal is included.
2831
+ *
2832
+ * @default false
2833
+ */
2834
+ sumSubtotal?: boolean;
2835
+ /**
2836
+ * Whether the countA subtotal is included.
2837
+ *
2838
+ * @default false
2839
+ */
2840
+ countASubtotal?: boolean;
2841
+ /**
2842
+ * Whether the average subtotal is included.
2843
+ *
2844
+ * @default false
2845
+ */
2846
+ avgSubtotal?: boolean;
2847
+ /**
2848
+ * Whether the max subtotal is included.
2849
+ *
2850
+ * @default false
2851
+ */
2852
+ maxSubtotal?: boolean;
2853
+ /**
2854
+ * Whether the min subtotal is included.
2855
+ *
2856
+ * @default false
2857
+ */
2858
+ minSubtotal?: boolean;
2859
+ /**
2860
+ * Whether the product subtotal is included.
2861
+ *
2862
+ * @default false
2863
+ */
2864
+ productSubtotal?: boolean;
2865
+ /**
2866
+ * Whether the count subtotal is included.
2867
+ *
2868
+ * @default false
2869
+ */
2870
+ countSubtotal?: boolean;
2871
+ /**
2872
+ * Whether the standard deviation subtotal is included.
2873
+ *
2874
+ * @default false
2875
+ */
2876
+ stdDevSubtotal?: boolean;
2877
+ /**
2878
+ * Whether the population standard deviation subtotal is included.
2879
+ *
2880
+ * @default false
2881
+ */
2882
+ stdDevPSubtotal?: boolean;
2883
+ /**
2884
+ * Whether the variance subtotal is included.
2885
+ *
2886
+ * @default false
2887
+ */
2888
+ varSubtotal?: boolean;
2889
+ /**
2890
+ * Whether the population variance subtotal is included.
2891
+ *
2892
+ * @default false
2893
+ */
2894
+ varPSubtotal?: boolean;
2895
+ /** Indices of the field items included in this reference. */
2896
+ itemIndices?: integer[];
2897
+ };
2898
+
2899
+ /**
2900
+ * The type of pivot area targeted.
2901
+ *
2902
+ * @group PivotTables
2903
+ */
2904
+ type PivotAreaType = 'none' | 'normal' | 'data' | 'all' | 'origin' | 'button' | 'topRight';
2905
+
2906
+ /**
2907
+ * Describes a region of a pivot table, used to target formatting, conditional formatting,
2908
+ * and other area-specific features.
2909
+ *
2910
+ * @group PivotTables
2911
+ */
2912
+ type PivotArea = {
2913
+ /**
2914
+ * The type of area.
2915
+ *
2916
+ * @default 'normal'
2917
+ */
2918
+ type?: PivotAreaType;
2919
+ /** The field index this area applies to. */
2920
+ field?: integer;
2921
+ /**
2922
+ * Whether the area applies only to data cells (excluding labels).
2923
+ *
2924
+ * @default true
2925
+ */
2926
+ dataOnly?: boolean;
2927
+ /**
2928
+ * Whether the area applies only to label cells (excluding data).
2929
+ *
2930
+ * @default false
2931
+ */
2932
+ labelOnly?: boolean;
2933
+ /**
2934
+ * Whether the row grand total is included.
2935
+ *
2936
+ * @default false
2937
+ */
2938
+ grandRow?: boolean;
2939
+ /**
2940
+ * Whether the column grand total is included.
2941
+ *
2942
+ * @default false
2943
+ */
2944
+ grandCol?: boolean;
2945
+ /**
2946
+ * Whether item indices refer to cache field items rather than pivot field items.
2947
+ *
2948
+ * @default false
2949
+ */
2950
+ cacheIndex?: boolean;
2951
+ /**
2952
+ * Whether the area includes outline-mode items.
2953
+ *
2954
+ * @default true
2955
+ */
2956
+ outline?: boolean;
2957
+ /** A cell reference offset relative to the pivot table's top-left corner. */
2958
+ offset?: string;
2959
+ /**
2960
+ * Whether collapsed hierarchy levels are treated as subtotals.
2961
+ *
2962
+ * @default false
2963
+ */
2964
+ collapsedLevelsAreSubtotals?: boolean;
2965
+ /** The axis this area targets. */
2966
+ axis?: PivotAreaAxis;
2967
+ /** The position of the field on its axis (0-based). */
2968
+ fieldPosition?: integer;
2969
+ /** References that narrow the area to specific field items. */
2970
+ references?: PivotAreaReference[];
2971
+ };
2972
+
2973
+ /**
2974
+ * Comparison operator for a custom auto-filter criterion.
2975
+ *
2976
+ * @group PivotTables
2977
+ */
2978
+ type PivotCustomFilterOperator = 'lessThan' | 'lessThanOrEqual' | 'equal' | 'notEqual' | 'greaterThanOrEqual' | 'greaterThan';
2979
+
2980
+ /**
2981
+ * A single criterion within a custom auto-filter, specifying an operator and comparison value.
2982
+ *
2983
+ * @group PivotTables
2984
+ */
2985
+ type PivotCustomFilterCriterion = {
2986
+ operator?: PivotCustomFilterOperator;
2987
+ val?: string;
2988
+ };
2989
+
2990
+ /**
2991
+ * A filter column within an auto-filter, specifying the filter criteria for a single column.
2992
+ *
2993
+ * @group PivotTables
2994
+ */
2995
+ type PivotAutoFilterColumn = {
2996
+ /** The 0-based column index within the auto-filter range. */
2997
+ colId: integer;
2998
+ /** Top-10 filter: show top/bottom N items by count, percent, or sum. */
2999
+ top10?: {
3000
+ /**
3001
+ * Whether to show the top items (true) or bottom items (false).
3002
+ *
3003
+ * @default true
3004
+ */
3005
+ top?: boolean;
3006
+ /**
3007
+ * Whether filtering is by percent (true) or count (false).
3008
+ *
3009
+ * @default false
3010
+ */
3011
+ percent?: boolean;
3012
+ /** The number of items (or percent) to show. */
3013
+ val: number;
3014
+ /** The actual cutoff value used for filtering. */
3015
+ filterVal?: number;
3016
+ };
3017
+ /** Custom filter criteria (up to two conditions with AND/OR logic). */
3018
+ customFilters?: {
3019
+ /**
3020
+ * Whether the two filters are combined with AND (true) or OR (false).
3021
+ *
3022
+ * @default false
3023
+ */
3024
+ and?: boolean;
3025
+ filters: PivotCustomFilterCriterion[];
3026
+ };
3027
+ };
3028
+
3029
+ /**
3030
+ * The unit used for grouping a cache field's values.
3031
+ *
3032
+ * @group PivotTables
3033
+ */
3034
+ type PivotGroupBy = 'range' | 'seconds' | 'minutes' | 'hours' | 'days' | 'months' | 'quarters' | 'years';
3035
+
3036
+ /**
3037
+ * Range grouping properties that define how a cache field's values are grouped into intervals.
3038
+ *
3039
+ * @group PivotTables
3040
+ */
3041
+ type PivotCacheRangePr = {
3042
+ /**
3043
+ * Whether the start value is determined automatically from source data.
3044
+ *
3045
+ * @default true
3046
+ */
3047
+ autoStart?: boolean;
3048
+ /**
3049
+ * Whether the end value is determined automatically from source data.
3050
+ *
3051
+ * @default true
3052
+ */
3053
+ autoEnd?: boolean;
3054
+ /**
3055
+ * The grouping unit.
3056
+ *
3057
+ * @default 'range'
3058
+ */
3059
+ groupBy?: PivotGroupBy;
3060
+ /** Start value for numeric range grouping. */
3061
+ startNum?: number;
3062
+ /** End value for numeric range grouping. */
3063
+ endNum?: number;
3064
+ /** Start date for date range grouping (ISO 8601 datetime string). */
3065
+ startDate?: string;
3066
+ /** End date for date range grouping (ISO 8601 datetime string). */
3067
+ endDate?: string;
3068
+ /**
3069
+ * The interval size for each group.
3070
+ *
3071
+ * @default 1
3072
+ */
3073
+ groupInterval?: number;
3074
+ };
3075
+
3076
+ /**
3077
+ * A shared item value in a pivot cache field. Each item represents a unique value found in the
3078
+ * source data for that field.
3079
+ *
3080
+ * @group PivotTables
3081
+ */
3082
+ type PivotCacheSharedItem = PivotCacheSharedItemStr | PivotCacheSharedItemNum | PivotCacheSharedItemBool | PivotCacheSharedItemDate | PivotCacheSharedItemErr | PivotCacheSharedItemNil;
3083
+ /** A string shared item. @group PivotTables */
3084
+ type PivotCacheSharedItemStr = {
3085
+ t: 's';
3086
+ v: string;
3087
+ };
3088
+ /** A numeric shared item. @group PivotTables */
3089
+ type PivotCacheSharedItemNum = {
3090
+ t: 'n';
3091
+ v: number;
3092
+ };
3093
+ /** A boolean shared item. @group PivotTables */
3094
+ type PivotCacheSharedItemBool = {
3095
+ t: 'b';
3096
+ v: boolean;
3097
+ };
3098
+ /** A date shared item (ISO 8601 string). @group PivotTables */
3099
+ type PivotCacheSharedItemDate = {
3100
+ t: 'd';
3101
+ v: string;
3102
+ };
3103
+ /** An error shared item (e.g. `"#REF!"`). @group PivotTables */
3104
+ type PivotCacheSharedItemErr = {
3105
+ t: 'e';
3106
+ v: string;
3107
+ };
3108
+ /** An empty/missing shared item. @group PivotTables */
3109
+ type PivotCacheSharedItemNil = {
3110
+ t: 'z';
3111
+ };
3112
+
3113
+ /**
3114
+ * Field grouping information that defines how a cache field's values are grouped.
3115
+ *
3116
+ * @group PivotTables
3117
+ */
3118
+ type PivotCacheFieldGroup = {
3119
+ /** Index of the parent grouped field (for multi-level grouping). */
3120
+ par?: integer;
3121
+ /** Index of the base (source) cache field that this grouping is derived from. */
3122
+ base?: integer;
3123
+ /** Range grouping properties (for date or numeric range grouping). */
3124
+ rangePr?: PivotCacheRangePr;
3125
+ /** Discrete grouping: maps each shared item index to its group index. */
3126
+ discretePr?: integer[];
3127
+ /** The group item labels, representing each group's display value. */
3128
+ groupItems?: PivotCacheSharedItem[];
3129
+ };
3130
+
3131
+ /**
3132
+ * Metadata describing the type composition and value range of a cache field's data. These are
3133
+ * redundant when {@link PivotCacheField.sharedItems} contains items (the metadata can be derived),
3134
+ * but for fields whose data is stored only in records (no shared items), they preserve min/max
3135
+ * and type information that would otherwise be lost.
3136
+ *
3137
+ * @group PivotTables
3138
+ */
3139
+ type PivotCacheSharedItemsMeta = {
3140
+ /**
3141
+ * Whether the field contains blank (missing) values.
3142
+ *
3143
+ * @default false
3144
+ */
3145
+ containsBlank?: boolean;
3146
+ /**
3147
+ * Whether the field contains more than one data type (excluding blank and string).
3148
+ *
3149
+ * @default false
3150
+ */
3151
+ containsMixedTypes?: boolean;
3152
+ /**
3153
+ * Whether the field contains a mix of text and other types, or only text.
3154
+ *
3155
+ * @default true
3156
+ */
3157
+ containsSemiMixedTypes?: boolean;
3158
+ /**
3159
+ * Whether the field contains string values.
3160
+ *
3161
+ * @default true
3162
+ */
3163
+ containsString?: boolean;
3164
+ /**
3165
+ * Whether the field contains numeric values.
3166
+ *
3167
+ * @default false
3168
+ */
3169
+ containsNumber?: boolean;
3170
+ /**
3171
+ * Whether the field contains only integer numeric values (no fractions).
3172
+ *
3173
+ * @default false
3174
+ */
3175
+ containsInteger?: boolean;
3176
+ /**
3177
+ * Whether the field contains date values.
3178
+ *
3179
+ * @default false
3180
+ */
3181
+ containsDate?: boolean;
3182
+ /**
3183
+ * Whether the field contains non-date values.
3184
+ *
3185
+ * @default true
3186
+ */
3187
+ containsNonDate?: boolean;
3188
+ /** The minimum numeric value in the field. */
3189
+ minValue?: number;
3190
+ /** The maximum numeric value in the field. */
3191
+ maxValue?: number;
3192
+ /** The minimum date value in the field (ISO 8601 datetime string). */
3193
+ minDate?: string;
3194
+ /** The maximum date value in the field (ISO 8601 datetime string). */
3195
+ maxDate?: string;
3196
+ };
3197
+
3198
+ /**
3199
+ * Describes a field (column) in a pivot cache. Each cache field corresponds to a column in the
3200
+ * source data range.
3201
+ *
3202
+ * @group PivotTables
3203
+ */
3204
+ type PivotCacheField = {
3205
+ /** The name of the field, typically matching the column header in the source data. */
3206
+ name: string;
3207
+ /**
3208
+ * The unique values found in this field's source data. Used for item indexing in pivot cache
3209
+ * records and pivot field items.
3210
+ */
3211
+ sharedItems?: PivotCacheSharedItem[];
3212
+ /**
3213
+ * Metadata about the shared items or record-level values for this field. When
3214
+ * {@link sharedItems} is populated, this can be derived from the items; when absent, it
3215
+ * preserves type/range information that would otherwise be lost.
3216
+ */
3217
+ sharedItemsMeta?: PivotCacheSharedItemsMeta;
3218
+ /** The number format code for this field's values (e.g. `"General"`, `"#,##0"`). */
3219
+ numFmt?: string;
3220
+ /** A formula for a calculated field, expressed in A1-style notation. */
3221
+ formula?: string;
3222
+ /**
3223
+ * Whether this field comes from the source database. When `false`, the field is a calculated
3224
+ * field not present in the original data source.
3225
+ *
3226
+ * @default true
3227
+ */
3228
+ databaseField?: boolean;
3229
+ /** Grouping information for this field (date ranges, numeric ranges, or discrete groups). */
3230
+ fieldGroup?: PivotCacheFieldGroup;
3231
+ };
3232
+
3233
+ /**
3234
+ * A single value in a pivot cache record. Each record is an array of these values, one per cache
3235
+ * field.
3236
+ *
3237
+ * Each value is either an inline {@link PivotCacheSharedItem} or an `{ x: integer }` shared item
3238
+ * index, referring to an entry in the corresponding field's
3239
+ * {@link PivotCacheField.sharedItems | sharedItems} array.
3240
+ *
3241
+ * @group PivotTables
3242
+ */
3243
+ type PivotCacheRecordValue = PivotCacheSharedItem | {
3244
+ t: 'x';
3245
+ v: integer;
3246
+ };
3247
+
3248
+ /**
3249
+ * A single record (row) of cached source data, with one value per cache field.
3250
+ *
3251
+ * @group PivotTables
3252
+ */
3253
+ type PivotCacheRecord = PivotCacheRecordValue[];
3254
+
3255
+ /**
3256
+ * Shared properties for all pivot cache source types.
3257
+ *
3258
+ * @group PivotTables
3259
+ */
3260
+ type PivotCacheBase = {
3261
+ /**
3262
+ * The fields (columns) in the cache, in source-data order. Each entry parallels the
3263
+ * corresponding pivot table's {@link PivotTable.fields | fields} array by index.
3264
+ */
3265
+ fields: PivotCacheField[];
3266
+ /**
3267
+ * The cached data records. Each record is an array of values corresponding to the cache fields.
3268
+ * When absent, the pivot table relies on the source data directly.
3269
+ */
3270
+ records?: PivotCacheRecord[];
3271
+ /**
3272
+ * Name of the user who last refreshed the cache.
3273
+ */
3274
+ refreshedBy?: string;
3275
+ /**
3276
+ * When the cache was last refreshed, as a serial date number (e.g. `39536.657`).
3277
+ */
3278
+ refreshedDate?: number;
3279
+ /**
3280
+ * Whether the cache is refreshed on file open.
3281
+ *
3282
+ * @default false
3283
+ */
3284
+ refreshOnLoad?: boolean;
3285
+ /**
3286
+ * Whether refresh is enabled for this cache.
3287
+ *
3288
+ * @default true
3289
+ */
3290
+ enableRefresh?: boolean;
3291
+ /**
3292
+ * Whether the cache definition is upgraded when refreshed.
3293
+ *
3294
+ * @default false
3295
+ */
3296
+ upgradeOnRefresh?: boolean;
3297
+ /**
3298
+ * Revision-tracking unique identifier. A GUID string like
3299
+ * `"{93AACE53-8F3A-A04A-893A-A439866B3165}"` assigned by Excel 2014+ for revision tracking.
3300
+ */
3301
+ uid?: string;
3302
+ };
3303
+
3304
+ /**
3305
+ * One of the source ranges in a consolidation-source pivot cache.
3306
+ *
3307
+ * @group PivotTables
3308
+ */
3309
+ type PivotCacheConsolidationRangeSet = {
3310
+ /** The A1-style range reference. */
3311
+ ref?: CellRange;
3312
+ /** The sheet containing this range. */
3313
+ sheet?: string;
3314
+ /** Index into the first page field's items. */
3315
+ i1?: integer;
3316
+ /** Index into the second page field's items. */
3317
+ i2?: integer;
3318
+ /** Index into the third page field's items. */
3319
+ i3?: integer;
3320
+ /** Index into the fourth page field's items. */
3321
+ i4?: integer;
3322
+ };
3323
+
3324
+ /**
3325
+ * Describes the source of a pivot cache's data when it consolidates multiple ranges (via the
3326
+ * legacy PivotTable Wizard).
3327
+ *
3328
+ * @group PivotTables
3329
+ */
3330
+ type PivotCacheConsolidationSource = {
3331
+ /**
3332
+ * Whether Excel automatically creates page fields.
3333
+ *
3334
+ * @default true
3335
+ */
3336
+ autoPage?: boolean;
3337
+ /** Page fields. Each inner array is one page field's item names. Up to 4. */
3338
+ pages?: string[][];
3339
+ /** The source ranges being consolidated. */
3340
+ rangeSets: PivotCacheConsolidationRangeSet[];
3341
+ };
3342
+
3343
+ /**
3344
+ * A pivot cache whose source data consolidates multiple ranges.
3345
+ *
3346
+ * @group PivotTables
3347
+ */
3348
+ type PivotCacheConsolidation = PivotCacheBase & {
3349
+ sourceType: 'consolidation';
3350
+ consolidation: PivotCacheConsolidationSource;
3351
+ };
3352
+
3353
+ /**
3354
+ * A pivot cache whose source data comes from an external data connection.
3355
+ *
3356
+ * @group PivotTables
3357
+ */
3358
+ type PivotCacheExternal = PivotCacheBase & {
3359
+ sourceType: 'external';
3360
+ connectionId: integer;
3361
+ };
3362
+
3363
+ /**
3364
+ * A pivot cache whose source data comes from scenarios.
3365
+ *
3366
+ * @group PivotTables
3367
+ */
3368
+ type PivotCacheScenario = PivotCacheBase & {
3369
+ sourceType: 'scenario';
3370
+ };
3371
+
3372
+ /**
3373
+ * A worksheet range source, identified by a cell range and sheet name.
3374
+ *
3375
+ * @group PivotTables
3376
+ */
3377
+ type PivotCacheWorksheetSourceRange = {
3378
+ /** Type discriminator for a worksheet range source. */
3379
+ type: 'range';
3380
+ /** The A1-style range reference to the source data, including headers. */
3381
+ ref: CellRange;
3382
+ /** The name of the sheet containing the source data. */
3383
+ sheet?: string;
3384
+ };
3385
+ /**
3386
+ * A named source (defined name or table), optionally scoped to a sheet.
3387
+ *
3388
+ * @group PivotTables
3389
+ */
3390
+ type PivotCacheWorksheetSourceName = {
3391
+ /** Type discriminator for a worksheet name source. */
3392
+ type: 'name';
3393
+ /** A defined name or table name that identifies the source data. */
3394
+ name: string;
3395
+ /** The name of the sheet, when `name` is a sheet-scoped defined name. */
3396
+ sheet?: string;
3397
+ };
3398
+ /**
3399
+ * Describes the source of a pivot cache's data when the source is a worksheet range or named
3400
+ * range/table. Either `ref` + `sheet` identifies a cell range, or `name` identifies a defined
3401
+ * name or table (with optional `sheet` for sheet-scoped names).
3402
+ *
3403
+ * @group PivotTables
3404
+ */
3405
+ type PivotCacheWorksheetSource = PivotCacheWorksheetSourceRange | PivotCacheWorksheetSourceName;
3406
+
3407
+ /**
3408
+ * A pivot cache whose source data comes from a worksheet range or named range/table.
3409
+ *
3410
+ * @group PivotTables
3411
+ */
3412
+ type PivotCacheWorksheet = PivotCacheBase & {
3413
+ sourceType: 'worksheet';
3414
+ worksheetSource: PivotCacheWorksheetSource;
3415
+ };
3416
+
3417
+ /**
3418
+ * A pivot cache stores a snapshot of the source data used by one or more pivot tables. It contains
3419
+ * field definitions, shared item pools, and optionally the full set of cached records.
3420
+ *
3421
+ * @group PivotTables
3422
+ */
3423
+ type PivotCache = PivotCacheWorksheet | PivotCacheExternal | PivotCacheConsolidation | PivotCacheScenario;
3424
+
3425
+ /**
3426
+ * A calculated field definition in a pivot table. Calculated fields derive their values from a
3427
+ * formula that references other cache fields.
3428
+ *
3429
+ * @group PivotTables
3430
+ */
3431
+ type PivotCalculatedField = {
3432
+ /** The name of the calculated field. */
3433
+ name: string;
3434
+ /** The formula expression that computes this field's values from other cache fields. */
3435
+ formula: string;
3436
+ };
3437
+
3438
+ /**
3439
+ * The aggregation function applied to a data field's values.
3440
+ *
3441
+ * Beware of the `'count'` false cognate: here it means "count of non-empty values" (like the
3442
+ * COUNTA worksheet function), while in {@link PivotSubtotalFunction} `'count'` means "count of
3443
+ * numeric values" (like the COUNT worksheet function). The `'countNums'` value here corresponds
3444
+ * to COUNT.
3445
+ *
3446
+ * @group PivotTables
3447
+ */
3448
+ type PivotDataFieldAggregation = 'sum' | 'count' | 'average' | 'max' | 'min' | 'product' | 'countNums' | 'stdDev' | 'stdDevP' | 'var' | 'varP';
3449
+
3450
+ /**
3451
+ * Controls how a data field's values are displayed relative to other values. For example,
3452
+ * `'percentOfTotal'` displays each value as a percentage of the grand total.
3453
+ *
3454
+ * @group PivotTables
3455
+ */
3456
+ type PivotShowDataAs = 'normal' | 'difference' | 'percent' | 'percentDiff' | 'runTotal' | 'percentOfRow' | 'percentOfCol' | 'percentOfTotal' | 'index' | 'percentOfParentRow' | 'percentOfParentCol' | 'percentOfParent' | 'percentOfRunningTotal' | 'rankAscending' | 'rankDescending';
3457
+
3458
+ /**
3459
+ * Describes a data field in a pivot table. Data fields define the values that are aggregated and
3460
+ * displayed in the data area of the pivot table.
3461
+ *
3462
+ * @group PivotTables
3463
+ */
3464
+ type PivotDataField = {
3465
+ /**
3466
+ * The display name of the data field (e.g. "Sum of Revenue"). Derivable from the field name
3467
+ * and aggregation function, but Excel always writes it.
3468
+ */
3469
+ name?: string;
3470
+ /** Index into the pivot table's {@link PivotField} array (and the cache's field array). */
3471
+ fieldIndex: integer;
3472
+ /**
3473
+ * The aggregation function to apply (NB: not related to row/column subtotals configured
3474
+ * via {@link PivotField.subtotalFunctions}).
3475
+ *
3476
+ * @default 'sum'
3477
+ */
3478
+ subtotal?: PivotDataFieldAggregation;
3479
+ /**
3480
+ * How to display the aggregated values.
3481
+ *
3482
+ * @default 'normal'
3483
+ */
3484
+ showDataAs?: PivotShowDataAs;
3485
+ /**
3486
+ * The index of the base field used for "show data as" calculations (e.g. percent difference).
3487
+ * Only meaningful when {@link showDataAs} is set to a relative calculation mode.
3488
+ *
3489
+ * @default -1
3490
+ */
3491
+ baseField?: integer;
3492
+ /**
3493
+ * The index of the base item used for "show data as" calculations. Only meaningful when
3494
+ * {@link showDataAs} is set to a relative calculation mode.
3495
+ *
3496
+ * @default 1048832
3497
+ */
3498
+ baseItem?: integer;
3499
+ /** The number format code for this data field's values (e.g. `"General"`, `"#,##0"`). */
3500
+ numFmt?: string;
3501
+ };
3502
+
3503
+ /**
3504
+ * The subtotal aggregation functions that can be applied to a pivot field.
3505
+ *
3506
+ * Beware of the `'count'` false cognate: here it means "count of numeric values" (like the COUNT
3507
+ * worksheet function), while in {@link PivotDataFieldAggregation} `'count'` means "count of
3508
+ * non-empty values" (like the COUNTA worksheet function).
3509
+ *
3510
+ * @group PivotTables
3511
+ */
3512
+ type PivotSubtotalFunction = 'sum' | 'countA' | 'avg' | 'max' | 'min' | 'product' | 'count' | 'stdDev' | 'stdDevP' | 'var' | 'varP';
3513
+
3514
+ /**
3515
+ * The type of a pivot field item, indicating its role in the pivot table layout.
3516
+ *
3517
+ * - `'data'` — a regular data item representing a unique value from the field.
3518
+ * - `'default'` — the default subtotal item.
3519
+ * - Any {@link PivotSubtotalFunction} value — a specific subtotal aggregation item.
3520
+ * - `'grand'` — a grand total item.
3521
+ * - `'blank'` — a blank item (placeholder).
3522
+ *
3523
+ * @group PivotTables
3524
+ */
3525
+ type PivotItemType = PivotSubtotalFunction | 'data' | 'default' | 'grand' | 'blank';
3526
+
3527
+ /**
3528
+ * An item within a pivot field. Items represent individual values, subtotals, or other special
3529
+ * entries in a row or column field.
3530
+ *
3531
+ * @group PivotTables
3532
+ */
3533
+ type PivotFieldItem = {
3534
+ /**
3535
+ * Index into the corresponding cache field's {@link PivotCacheField.sharedItems | sharedItems}
3536
+ * array. Absent for non-data items (subtotals, grand totals, blanks).
3537
+ */
3538
+ itemIndex?: integer;
3539
+ /**
3540
+ * The type of this item.
3541
+ *
3542
+ * @default 'data'
3543
+ */
3544
+ itemType?: PivotItemType;
3545
+ /**
3546
+ * Whether this item is hidden (filtered out).
3547
+ *
3548
+ * @default false
3549
+ */
3550
+ hidden?: boolean;
3551
+ /**
3552
+ * Display name override for this item. When absent, the item's name is
3553
+ * derived from the cache field's shared items.
3554
+ */
3555
+ name?: string;
3556
+ /**
3557
+ * Whether this item's children are expanded (visible).
3558
+ *
3559
+ * @default true
3560
+ */
3561
+ expanded?: boolean;
3562
+ /**
3563
+ * Whether this item refers to a value that is no longer in the source data (a "missing" item).
3564
+ *
3565
+ * @default false
3566
+ */
3567
+ missing?: boolean;
3568
+ };
3569
+
3570
+ /**
3571
+ * Configuration for a single field in a pivot table. There is one PivotField per cache field, in
3572
+ * the same order as the cache fields.
3573
+ *
3574
+ * @group PivotTables
3575
+ */
3576
+ type PivotField = {
3577
+ /**
3578
+ * Display name override for this field. When present, this replaces
3579
+ * the cache field name in the pivot table's UI. Distinct from {@link PivotFieldItem.name} which
3580
+ * overrides individual item labels.
3581
+ */
3582
+ name?: string;
3583
+ /**
3584
+ * Which axis this field is placed on. Absent if the field is not placed on a row, column, or
3585
+ * page axis (e.g. fields used only as data fields, or fields not used in the layout at all).
3586
+ */
3587
+ axis?: PivotFieldAxis;
3588
+ /**
3589
+ * Whether this field is used as a data field. Data fields appear in the pivot table's
3590
+ * {@link PivotDataField} list; this flag indicates
3591
+ * that the field participates as a value source rather than being placed on a row/col/page axis.
3592
+ *
3593
+ * @default false
3594
+ */
3595
+ dataField?: boolean;
3596
+ /**
3597
+ * Whether to show all items for this field, including those with no data.
3598
+ *
3599
+ * @default true
3600
+ */
3601
+ showAll?: boolean;
3602
+ /**
3603
+ * The subtotal functions to show. When absent or empty, the default subtotal (typically sum or
3604
+ * count) is used.
3605
+ */
3606
+ subtotalFunctions?: PivotSubtotalFunction[];
3607
+ /**
3608
+ * The sort order for this field's items.
3609
+ *
3610
+ * @default 'manual'
3611
+ */
3612
+ sortType?: 'manual' | 'ascending' | 'descending';
3613
+ /** The items in this field, representing unique values and special entries. */
3614
+ items?: PivotFieldItem[];
3615
+ /**
3616
+ * Whether the field uses compact layout (labels in the same column as child fields).
3617
+ *
3618
+ * @default true
3619
+ */
3620
+ compact?: boolean;
3621
+ /**
3622
+ * Whether the field uses outline layout (labels on their own row, above child data).
3623
+ *
3624
+ * @default true
3625
+ */
3626
+ outline?: boolean;
3627
+ /**
3628
+ * Whether subtotals appear at the top of each group (only meaningful in outline mode).
3629
+ *
3630
+ * @default true
3631
+ */
3632
+ subtotalTop?: boolean;
3633
+ /**
3634
+ * Whether to insert a blank row after each group in this field.
3635
+ *
3636
+ * @default false
3637
+ */
3638
+ insertBlankRow?: boolean;
3639
+ /**
3640
+ * Whether to show the default subtotal for this field.
3641
+ *
3642
+ * @default true
3643
+ */
3644
+ defaultSubtotal?: boolean;
3645
+ /** Custom caption for the subtotal row. */
3646
+ subtotalCaption?: string;
3647
+ /** The number format code for this field's data (e.g. `"General"`, `"#,##0"`). */
3648
+ numFmt?: string;
3649
+ /**
3650
+ * Whether filter dropdowns are shown for this field.
3651
+ *
3652
+ * @default true
3653
+ */
3654
+ showDropDowns?: boolean;
3655
+ /**
3656
+ * Whether the field can be dragged to the row axis.
3657
+ *
3658
+ * @default true
3659
+ */
3660
+ dragToRow?: boolean;
3661
+ /**
3662
+ * Whether the field can be dragged to the column axis.
3663
+ *
3664
+ * @default true
3665
+ */
3666
+ dragToCol?: boolean;
3667
+ /**
3668
+ * Whether the field can be dragged to the page (filter) axis.
3669
+ *
3670
+ * @default true
3671
+ */
3672
+ dragToPage?: boolean;
3673
+ /**
3674
+ * Whether the field can be dragged to the data area.
3675
+ *
3676
+ * @default true
3677
+ */
3678
+ dragToData?: boolean;
3679
+ /**
3680
+ * Whether the field can be dragged off the pivot table (removed).
3681
+ *
3682
+ * @default true
3683
+ */
3684
+ dragOff?: boolean;
3685
+ /**
3686
+ * Whether multiple items can be selected in this field's filter.
3687
+ *
3688
+ * @default false
3689
+ */
3690
+ multipleItemSelectionAllowed?: boolean;
3691
+ /**
3692
+ * Whether a page break is inserted after each group in this field.
3693
+ *
3694
+ * @default false
3695
+ */
3696
+ insertPageBreak?: boolean;
3697
+ /**
3698
+ * Whether newly added items are hidden by default.
3699
+ *
3700
+ * @default false
3701
+ */
3702
+ hideNewItems?: boolean;
3703
+ /**
3704
+ * Whether new items are included in the field's manual filter.
3705
+ *
3706
+ * @default false
3707
+ */
3708
+ includeNewItemsInFilter?: boolean;
3709
+ /**
3710
+ * Whether the auto-show (top/bottom N) filter is enabled.
3711
+ *
3712
+ * @default false
3713
+ */
3714
+ autoShow?: boolean;
3715
+ /**
3716
+ * Whether auto-show displays the top N items (true) or bottom N items (false).
3717
+ *
3718
+ * @default true
3719
+ */
3720
+ topAutoShow?: boolean;
3721
+ /**
3722
+ * Number of items to display when auto-show is enabled.
3723
+ *
3724
+ * @default 10
3725
+ */
3726
+ itemPageCount?: integer;
3727
+ /** Whether sorting is deferred to the data source. */
3728
+ dataSourceSort?: boolean;
3729
+ /**
3730
+ * Whether the field defaults to no auto-sort (manual sort).
3731
+ *
3732
+ * @default false
3733
+ */
3734
+ nonAutoSortDefault?: boolean;
3735
+ /** Index of the data field used for ranking. */
3736
+ rankBy?: integer;
3737
+ /**
3738
+ * Whether this field's hierarchy level is hidden.
3739
+ *
3740
+ * @default false
3741
+ */
3742
+ hiddenLevel?: boolean;
3743
+ /** The unique member property for this field (OLAP). */
3744
+ uniqueMemberProperty?: string;
3745
+ /**
3746
+ * Whether all items in this field are drilled down.
3747
+ *
3748
+ * @default false
3749
+ */
3750
+ allDrilled?: boolean;
3751
+ /**
3752
+ * Whether this is a server-based field.
3753
+ *
3754
+ * @default false
3755
+ */
3756
+ serverField?: boolean;
3757
+ /**
3758
+ * Whether the field supports measure filtering (OLAP).
3759
+ *
3760
+ * @default false
3761
+ */
3762
+ measureFilter?: boolean;
3763
+ /**
3764
+ * Whether member property values are shown in cells.
3765
+ *
3766
+ * @default false
3767
+ */
3768
+ showPropCell?: boolean;
3769
+ /**
3770
+ * Whether member property values are shown in tooltips.
3771
+ *
3772
+ * @default false
3773
+ */
3774
+ showPropTip?: boolean;
3775
+ /**
3776
+ * Whether member property values are used as captions.
3777
+ *
3778
+ * @default false
3779
+ */
3780
+ showPropAsCaption?: boolean;
3781
+ /**
3782
+ * Default drill state for member properties.
3783
+ *
3784
+ * @default false
3785
+ */
3786
+ defaultAttributeDrillState?: boolean;
3787
+ };
3788
+
3789
+ /**
3790
+ * The type of a pivot table filter.
3791
+ *
3792
+ * @group PivotTables
3793
+ */
3794
+ type PivotFilterType = 'unknown' | 'count' | 'percent' | 'sum' | 'captionEqual' | 'captionNotEqual' | 'captionBeginsWith' | 'captionNotBeginsWith' | 'captionEndsWith' | 'captionNotEndsWith' | 'captionContains' | 'captionNotContains' | 'captionGreaterThan' | 'captionGreaterThanOrEqual' | 'captionLessThan' | 'captionLessThanOrEqual' | 'captionBetween' | 'captionNotBetween' | 'valueEqual' | 'valueNotEqual' | 'valueGreaterThan' | 'valueGreaterThanOrEqual' | 'valueLessThan' | 'valueLessThanOrEqual' | 'valueBetween' | 'valueNotBetween' | 'dateEqual' | 'dateNotEqual' | 'dateOlderThan' | 'dateOlderThanOrEqual' | 'dateNewerThan' | 'dateNewerThanOrEqual' | 'dateBetween' | 'dateNotBetween' | 'tomorrow' | 'today' | 'yesterday' | 'nextWeek' | 'thisWeek' | 'lastWeek' | 'nextMonth' | 'thisMonth' | 'lastMonth' | 'nextQuarter' | 'thisQuarter' | 'lastQuarter' | 'nextYear' | 'thisYear' | 'lastYear' | 'yearToDate' | 'Q1' | 'Q2' | 'Q3' | 'Q4' | 'M1' | 'M2' | 'M3' | 'M4' | 'M5' | 'M6' | 'M7' | 'M8' | 'M9' | 'M10' | 'M11' | 'M12';
3795
+
3796
+ /**
3797
+ * An advanced filter applied to a pivot table field.
3798
+ *
3799
+ * Pivot filters implement features like "Show Top 10", "Show items where value > X",
3800
+ * and date-based filters.
3801
+ *
3802
+ * @group PivotTables
3803
+ */
3804
+ type PivotFilter = {
3805
+ /** Index of the pivot field this filter applies to. */
3806
+ fieldIndex: integer;
3807
+ /** The filter type. */
3808
+ type: PivotFilterType;
3809
+ /** Unique identifier for this filter within the pivot table. */
3810
+ id: integer;
3811
+ /**
3812
+ * Evaluation order for multiple filters. Lower values are evaluated first.
3813
+ *
3814
+ * @default 0
3815
+ */
3816
+ evalOrder?: integer;
3817
+ /** Member property field index (OLAP). */
3818
+ mpFld?: integer;
3819
+ /** Measure hierarchy index (OLAP). */
3820
+ iMeasureHier?: integer;
3821
+ /** Measure field index used for value-based filters. */
3822
+ iMeasureFld?: integer;
3823
+ /** Display name for the filter. */
3824
+ name?: string;
3825
+ /** Description of the filter. */
3826
+ description?: string;
3827
+ /** First string value for comparison-based filters. */
3828
+ stringValue1?: string;
3829
+ /** Second string value for between/not-between filters. */
3830
+ stringValue2?: string;
3831
+ /** Auto-filter criteria that implement this pivot filter. */
3832
+ autoFilter?: {
3833
+ /** The reference range for the auto-filter. */
3834
+ ref?: string;
3835
+ /** Filter columns with their criteria. */
3836
+ filterColumns?: PivotAutoFilterColumn[];
3837
+ };
3838
+ };
3839
+
3840
+ /**
3841
+ * Describes a page (filter) field in a pivot table. Page fields allow the user to filter the
3842
+ * entire pivot table to show only data matching a selected item.
3843
+ *
3844
+ * @group PivotTables
3845
+ */
3846
+ type PivotPageField = {
3847
+ /** Index into the pivot table's {@link PivotField} array (and the cache's field array). */
3848
+ fieldIndex: integer;
3849
+ /**
3850
+ * The index of the currently selected item in the field's items list. When absent, all items are
3851
+ * shown (no filter applied).
3852
+ */
3853
+ selectedItem?: integer;
3854
+ /**
3855
+ * An optional name override for the page field. Identifies the field in formulas and
3856
+ * programmatic access (e.g. GETPIVOTDATA).
3857
+ */
3858
+ name?: string;
3859
+ /**
3860
+ * Display caption for the page field. Shown in the pivot table UI but not used for programmatic
3861
+ * field identification.
3862
+ */
3863
+ caption?: string;
3864
+ /**
3865
+ * Hierarchy index for OLAP page fields.
3866
+ *
3867
+ * @default -1
3868
+ */
3869
+ hierarchy?: integer;
3870
+ };
3871
+
3872
+ /**
3873
+ * A layout item in the row or column area, describing what each row or column header represents.
3874
+ *
3875
+ * @group PivotTables
3876
+ */
3877
+ type PivotRowColItem = {
3878
+ /**
3879
+ * The type of this layout item (same enumeration as {@link PivotFieldItem.itemType}).
3880
+ *
3881
+ * @default 'data'
3882
+ */
3883
+ itemType?: PivotItemType;
3884
+ /**
3885
+ * The number of leading axis positions whose {@link itemIndices} entries are omitted because
3886
+ * they are identical to the previous {@link PivotRowColItem}'s values (see
3887
+ * {@link PivotTable | PivotTable's type description} for the level/axis model). The omitted
3888
+ * entries are inherited from the preceding item in {@link PivotTable.rowItems | rowItems} or
3889
+ * {@link PivotTable.colItems | colItems}.
3890
+ *
3891
+ * @default 0
3892
+ */
3893
+ repeatedItemCount?: integer;
3894
+ /**
3895
+ * Indices into each axis field's {@link PivotField.items | items} array. Entries correspond
3896
+ * positionally to the fields listed in {@link PivotTable.rowFieldIndices | rowFieldIndices} (for
3897
+ * row items) or {@link PivotTable.colFieldIndices | colFieldIndices} (for column items): entry
3898
+ * *i* indexes into the *i*-th axis field's {@link PivotField.items | items}.
3899
+ *
3900
+ * When {@link repeatedItemCount} is greater than zero, the first that many entries are omitted
3901
+ * (inherited from the previous {@link PivotRowColItem}), so the array starts at position
3902
+ * {@link repeatedItemCount}.
3903
+ */
3904
+ itemIndices?: integer[];
3905
+ /**
3906
+ * Index into the pivot table's {@link PivotTable.dataFields | dataFields}, indicating which data
3907
+ * field this item represents.
3908
+ *
3909
+ * @default 0
3910
+ */
3911
+ dataFieldIndex?: integer;
3912
+ };
3913
+
3914
+ /**
3915
+ * Describes the position of the pivot table's header and data areas within its output range
3916
+ * ({@link PivotTable.ref | ref}).
3917
+ *
3918
+ * All offsets are 0-based from the top-left cell of {@link PivotTable.ref | ref}. The difference
3919
+ * `firstDataRow - firstHeaderRow` equals the number of column-field header rows.
3920
+ *
3921
+ * @group PivotTables
3922
+ */
3923
+ type PivotTableLocation = {
3924
+ /**
3925
+ * 0-based row offset from the top of {@link PivotTable.ref | ref} to the first row of the body
3926
+ * area (column-field items, or data if there are no column fields).
3927
+ */
3928
+ firstHeaderRow: integer;
3929
+ /**
3930
+ * 0-based row offset from the top of {@link PivotTable.ref | ref} to the first row containing
3931
+ * data values.
3932
+ */
3933
+ firstDataRow: integer;
3934
+ /**
3935
+ * 0-based column offset from the left of {@link PivotTable.ref | ref} to the first column
3936
+ * containing data values.
3937
+ */
3938
+ firstDataCol: integer;
3939
+ /**
3940
+ * Number of rows occupied by the page field area (see {@link PivotTable | PivotTable's type
3941
+ * description}). Layout depends on {@link PivotTable.pageOverThenDown | pageOverThenDown} and
3942
+ * {@link PivotTable.pageWrap | pageWrap}.
3943
+ *
3944
+ * @default 0
3945
+ */
3946
+ rowPageCount?: integer;
3947
+ /**
3948
+ * Number of columns occupied by the page field area (see {@link PivotTable | PivotTable's type
3949
+ * description}). Layout depends on {@link PivotTable.pageOverThenDown | pageOverThenDown} and
3950
+ * {@link PivotTable.pageWrap | pageWrap}.
3951
+ *
3952
+ * @default 0
3953
+ */
3954
+ colPageCount?: integer;
3955
+ };
3956
+
3957
+ /**
3958
+ * Excel's built-in pivot table style names.
3959
+ *
3960
+ * @group PivotTables
3961
+ */
3962
+ type PivotTableStyleName = 'PivotStyleDark1' | 'PivotStyleDark2' | 'PivotStyleDark3' | 'PivotStyleDark4' | 'PivotStyleDark5' | 'PivotStyleDark6' | 'PivotStyleDark7' | 'PivotStyleDark8' | 'PivotStyleDark9' | 'PivotStyleDark10' | 'PivotStyleDark11' | 'PivotStyleDark12' | 'PivotStyleDark13' | 'PivotStyleDark14' | 'PivotStyleDark15' | 'PivotStyleDark16' | 'PivotStyleDark17' | 'PivotStyleDark18' | 'PivotStyleDark19' | 'PivotStyleDark20' | 'PivotStyleDark21' | 'PivotStyleDark22' | 'PivotStyleDark23' | 'PivotStyleDark24' | 'PivotStyleDark25' | 'PivotStyleDark26' | 'PivotStyleDark27' | 'PivotStyleDark28' | 'PivotStyleLight1' | 'PivotStyleLight2' | 'PivotStyleLight3' | 'PivotStyleLight4' | 'PivotStyleLight5' | 'PivotStyleLight6' | 'PivotStyleLight7' | 'PivotStyleLight8' | 'PivotStyleLight9' | 'PivotStyleLight10' | 'PivotStyleLight11' | 'PivotStyleLight12' | 'PivotStyleLight13' | 'PivotStyleLight14' | 'PivotStyleLight15' | 'PivotStyleLight16' | 'PivotStyleLight17' | 'PivotStyleLight18' | 'PivotStyleLight19' | 'PivotStyleLight20' | 'PivotStyleLight21' | 'PivotStyleLight22' | 'PivotStyleLight23' | 'PivotStyleLight24' | 'PivotStyleLight25' | 'PivotStyleLight26' | 'PivotStyleLight27' | 'PivotStyleLight28' | 'PivotStyleMedium1' | 'PivotStyleMedium2' | 'PivotStyleMedium3' | 'PivotStyleMedium4' | 'PivotStyleMedium5' | 'PivotStyleMedium6' | 'PivotStyleMedium7' | 'PivotStyleMedium8' | 'PivotStyleMedium9' | 'PivotStyleMedium10' | 'PivotStyleMedium11' | 'PivotStyleMedium12' | 'PivotStyleMedium13' | 'PivotStyleMedium14' | 'PivotStyleMedium15' | 'PivotStyleMedium16' | 'PivotStyleMedium17' | 'PivotStyleMedium18' | 'PivotStyleMedium19' | 'PivotStyleMedium20' | 'PivotStyleMedium21' | 'PivotStyleMedium22' | 'PivotStyleMedium23' | 'PivotStyleMedium24' | 'PivotStyleMedium25' | 'PivotStyleMedium26' | 'PivotStyleMedium27' | 'PivotStyleMedium28';
3963
+
3964
+ /**
3965
+ * Presentation style settings for a pivot table.
3966
+ *
3967
+ * @group PivotTables
3968
+ */
3969
+ type PivotTableStyle = {
3970
+ /**
3971
+ * The name of the pivot table style (e.g. `"PivotStyleMedium9"`).
3972
+ *
3973
+ * If the value is null or omitted the table should not be rendered with any special styling (note
3974
+ * that this only applies if the style object itself is present).
3975
+ *
3976
+ * @default null
3977
+ */
3978
+ name?: PivotTableStyleName | null;
3979
+ /**
3980
+ * Whether row header formatting should be applied.
3981
+ *
3982
+ * @default false
3983
+ */
3984
+ showRowHeaders?: boolean;
3985
+ /**
3986
+ * Whether column header formatting should be applied.
3987
+ *
3988
+ * @default false
3989
+ */
3990
+ showColumnHeaders?: boolean;
3991
+ /**
3992
+ * Whether row stripe formatting should be applied.
3993
+ *
3994
+ * @default false
3995
+ */
3996
+ showRowStripes?: boolean;
3997
+ /**
3998
+ * Whether column stripe formatting should be applied.
3999
+ *
4000
+ * @default false
4001
+ */
4002
+ showColumnStripes?: boolean;
4003
+ /**
4004
+ * Whether the last column's formatting from the named style is applied to the grand total column.
4005
+ *
4006
+ * @default false
4007
+ */
4008
+ showLastColumn?: boolean;
4009
+ };
4010
+
4011
+ /**
4012
+ * A pivot table definition. Pivot tables dynamically group, filter, and aggregate source data,
4013
+ * displaying the results in a structured layout on a worksheet.
4014
+ *
4015
+ * The layout is organized around **axes**: each {@link PivotField} can be placed on the row axis,
4016
+ * column axis, or page (filter) axis via its {@link PivotField.axis | axis} property.
4017
+ * {@link rowFieldIndices} and {@link colFieldIndices} list the fields on each axis in display
4018
+ * order; each position in that list is sometimes called a **level**. The page axis fields appear
4019
+ * in the **page field area**, a region above the pivot table body where filter dropdowns are
4020
+ * displayed (see {@link pageFields}).
4021
+ *
4022
+ * {@link rowItems} and {@link colItems} describe the rendered layout: each
4023
+ * {@link PivotRowColItem} represents one row or column header, with
4024
+ * {@link PivotRowColItem.itemIndices | itemIndices} mapping positionally to the fields on that
4025
+ * axis. The **data area** is the grid of aggregated values framed by those row and column
4026
+ * headers; its contents are defined by the {@link dataFields}.
4027
+ *
4028
+ * ```
4029
+ * +--------------------------------------------+
4030
+ * | Page field area (filters) | pageFields
4031
+ * | rowPageCount × colPageCount |
4032
+ * +----------------+---------------------------+ firstHeaderRow
4033
+ * | | Column headers | colItems
4034
+ * | Row headers +---------------------------+ firstDataRow
4035
+ * | (rowItems) | Data area |
4036
+ * | | (dataFields) |
4037
+ * +----------------+---------------------------+
4038
+ * ^ firstDataCol
4039
+ * ```
4040
+ *
4041
+ * {@link PivotTableLocation.firstHeaderRow | firstHeaderRow},
4042
+ * {@link PivotTableLocation.firstDataRow | firstDataRow}, and
4043
+ * {@link PivotTableLocation.firstDataCol | firstDataCol} locate these regions within the
4044
+ * output range ({@link ref}).
4045
+ *
4046
+ * @see {@link https://support.microsoft.com/office/a9a84538-bfe9-40a9-a8e9-f99134456576}
4047
+ *
4048
+ * @group PivotTables
4049
+ */
4050
+ type PivotTable = {
4051
+ /**
4052
+ * The name of the pivot table. Typically unique per workbook, but Excel allows duplicate names
4053
+ * across different sheets.
4054
+ */
4055
+ name: string;
4056
+ /** The name of the sheet where this pivot table's output is rendered. */
4057
+ sheet: string;
4058
+ /** The pivot cache that supplies source data for this pivot table. */
4059
+ cache: PivotCache;
4060
+ /** The A1-style range reference covering the pivot table's output area. */
4061
+ ref: CellRange;
4062
+ /** Position information for the pivot table's data within its output range. */
4063
+ location: PivotTableLocation;
4064
+ /**
4065
+ * The pivot fields, paralleling the cache's {@link PivotCacheBase.fields | fields} array.
4066
+ * Each field's configuration determines whether and how it participates in the pivot table
4067
+ * layout.
4068
+ */
4069
+ fields: PivotField[];
4070
+ /**
4071
+ * Indices into {@link fields} identifying which fields appear on the row axis, in display order.
4072
+ * Negative indices are special placeholders (e.g. `-2` represents the "Values" virtual field,
4073
+ * used when there are multiple data fields) and do not index into {@link fields}.
4074
+ */
4075
+ rowFieldIndices?: integer[];
4076
+ /**
4077
+ * Indices into {@link fields} identifying which fields appear on the column axis, in display
4078
+ * order. Negative indices are special placeholders (e.g. `-2` represents the "Values" virtual
4079
+ * field) and do not index into {@link fields}.
4080
+ */
4081
+ colFieldIndices?: integer[];
4082
+ /** The data fields, defining the aggregated values displayed in the pivot table's data area. */
4083
+ dataFields?: PivotDataField[];
4084
+ /** The page (filter) fields, allowing the pivot table to be filtered by specific field values. */
4085
+ pageFields?: PivotPageField[];
4086
+ /** Layout items for the row area, describing each row header. */
4087
+ rowItems?: PivotRowColItem[];
4088
+ /** Layout items for the column area, describing each column header. */
4089
+ colItems?: PivotRowColItem[];
4090
+ /** Presentation style for the pivot table. */
4091
+ style?: PivotTableStyle;
4092
+ /** Advanced filters applied to pivot fields. */
4093
+ filters?: PivotFilter[];
4094
+ /**
4095
+ * Calculated field definitions. Each entry defines a formula-based field that derives its values
4096
+ * from other cache fields.
4097
+ */
4098
+ calculatedFields?: PivotCalculatedField[];
4099
+ /**
4100
+ * Revision-tracking unique identifier. A GUID string like
4101
+ * `"{93AACE53-8F3A-A04A-893A-A439866B3165}"` assigned by Excel 2014+ for revision tracking.
4102
+ */
4103
+ uid?: string;
4104
+ /**
4105
+ * Whether grand totals should be shown for rows.
4106
+ *
4107
+ * @default true
4108
+ */
4109
+ rowGrandTotals?: boolean;
4110
+ /**
4111
+ * Whether grand totals should be shown for columns.
4112
+ *
4113
+ * @default true
4114
+ */
4115
+ colGrandTotals?: boolean;
4116
+ /**
4117
+ * Whether the pivot table should automatically refresh when its source data changes.
4118
+ *
4119
+ * @default false
4120
+ */
4121
+ autoRefresh?: boolean;
4122
+ /**
4123
+ * Default compact flag for pivot fields. Fields inherit this unless they override
4124
+ * {@link PivotField.compact | their own compact}.
4125
+ *
4126
+ * @default true
4127
+ */
4128
+ compact?: boolean;
4129
+ /**
4130
+ * Default outline flag for pivot fields. Fields inherit this unless they override
4131
+ * {@link PivotField.outline | their own outline}.
4132
+ *
4133
+ * @default false
4134
+ */
4135
+ outline?: boolean;
4136
+ /**
4137
+ * Whether data-area values are repeated on outline header rows. When false (the default),
4138
+ * values appear only on the innermost detail rows; when true, each outline-level header row
4139
+ * also shows the aggregated values for its group.
4140
+ *
4141
+ * @default false
4142
+ */
4143
+ outlineData?: boolean;
4144
+ /**
4145
+ * Whether data fields in compact layout share a single column.
4146
+ *
4147
+ * @default true
4148
+ */
4149
+ compactData?: boolean;
4150
+ /**
4151
+ * Whether classic-style grid drop zones are shown. Drop zones are labeled regions (e.g.
4152
+ * "Drop Row Fields Here") displayed in the pivot table area where fields can be dragged to
4153
+ * assign them to an axis.
4154
+ *
4155
+ * @default false
4156
+ */
4157
+ gridDropZones?: boolean;
4158
+ /**
4159
+ * Number of character widths to indent row labels in compact layout.
4160
+ *
4161
+ * @default 1
4162
+ */
4163
+ indent?: integer;
4164
+ /**
4165
+ * Whether the data (values) axis runs along rows rather than columns.
4166
+ *
4167
+ * @default false
4168
+ */
4169
+ dataOnRows?: boolean;
4170
+ /**
4171
+ * Position of the "Values" virtual field within its axis. When absent, the Values field is placed
4172
+ * at the end.
4173
+ */
4174
+ dataPosition?: integer;
4175
+ /**
4176
+ * Whether row and column headers are displayed.
4177
+ *
4178
+ * @default true
4179
+ */
4180
+ showHeaders?: boolean;
4181
+ /**
4182
+ * Whether empty rows are shown in the output.
4183
+ *
4184
+ * @default false
4185
+ */
4186
+ showEmptyRow?: boolean;
4187
+ /**
4188
+ * Whether empty columns are shown in the output.
4189
+ *
4190
+ * @default false
4191
+ */
4192
+ showEmptyCol?: boolean;
4193
+ /**
4194
+ * Whether drop zones for fields are displayed in the pivot table area.
4195
+ *
4196
+ * @default true
4197
+ */
4198
+ showDropZones?: boolean;
4199
+ /**
4200
+ * Whether member property tooltips are shown.
4201
+ *
4202
+ * @default true
4203
+ */
4204
+ showMemberPropertyTips?: boolean;
4205
+ /**
4206
+ * Whether drill-down (expand/collapse) is enabled on pivot field items.
4207
+ *
4208
+ * @default true
4209
+ */
4210
+ enableDrill?: boolean;
4211
+ /**
4212
+ * Whether the pivot table shows "Multiple Items" labels when a page field
4213
+ * has more than one item selected.
4214
+ *
4215
+ * @default true
4216
+ */
4217
+ showMultipleLabel?: boolean;
4218
+ /**
4219
+ * Caption for the data (values) area. Excel always writes this (typically `"Data"` or a
4220
+ * localized equivalent).
4221
+ */
4222
+ dataCaption?: string;
4223
+ /** Custom label for grand total rows/columns. */
4224
+ grandTotalCaption?: string;
4225
+ /** Text to display in place of error values. */
4226
+ errorCaption?: string;
4227
+ /**
4228
+ * Whether error captions are shown (when true, cells with errors display {@link errorCaption}).
4229
+ *
4230
+ * @default false
4231
+ */
4232
+ showError?: boolean;
4233
+ /** Text to display in place of missing values. */
4234
+ missingCaption?: string;
4235
+ /**
4236
+ * Whether missing-value captions are shown.
4237
+ *
4238
+ * @default true
4239
+ */
4240
+ showMissing?: boolean;
4241
+ /** Caption for the row header area. */
4242
+ rowHeaderCaption?: string;
4243
+ /** Caption for the column header area. */
4244
+ colHeaderCaption?: string;
4245
+ /**
4246
+ * Whether hidden items are included in subtotals.
4247
+ *
4248
+ * @default false
4249
+ */
4250
+ subtotalHiddenItems?: boolean;
4251
+ /**
4252
+ * Whether field names are printed on each page when the pivot table is printed.
4253
+ *
4254
+ * @default false
4255
+ */
4256
+ fieldPrintTitles?: boolean;
4257
+ /**
4258
+ * Whether item labels are printed on each page when the pivot table is printed.
4259
+ *
4260
+ * @default false
4261
+ */
4262
+ itemPrintTitles?: boolean;
4263
+ /**
4264
+ * Whether labels from outer row fields are merged across cells.
4265
+ *
4266
+ * @default false
4267
+ */
4268
+ mergeItem?: boolean;
4269
+ /**
4270
+ * Whether custom list ordering is used when sorting items.
4271
+ *
4272
+ * @default true
4273
+ */
4274
+ customListSort?: boolean;
4275
+ /**
4276
+ * Whether multiple filters can be applied to a single field simultaneously.
4277
+ *
4278
+ * @default true
4279
+ */
4280
+ multipleFieldFilters?: boolean;
4281
+ /**
4282
+ * Whether field items are shown in the pivot table body.
4283
+ *
4284
+ * @default true
4285
+ */
4286
+ showItems?: boolean;
4287
+ /**
4288
+ * Whether calculated members from OLAP data sources are shown.
4289
+ *
4290
+ * @default true
4291
+ */
4292
+ showCalcMbrs?: boolean;
4293
+ /**
4294
+ * Whether cell formatting is preserved on refresh.
4295
+ *
4296
+ * @default true
4297
+ */
4298
+ preserveFormatting?: boolean;
4299
+ /**
4300
+ * Number of page fields per column before wrapping to a new column.
4301
+ *
4302
+ * @default 0
4303
+ */
4304
+ pageWrap?: integer;
4305
+ /**
4306
+ * Whether page fields are laid out across then down (true) or down then across (false).
4307
+ *
4308
+ * @default false
4309
+ */
4310
+ pageOverThenDown?: boolean;
4311
+ /** Built-in auto-format ID. */
4312
+ autoFormatId?: integer;
4313
+ /**
4314
+ * Whether auto-formatting is applied.
4315
+ *
4316
+ * @default false
4317
+ */
4318
+ useAutoFormatting?: boolean;
4319
+ /**
4320
+ * Whether number formats from the auto-format are applied.
4321
+ *
4322
+ * @default false
4323
+ */
4324
+ applyNumberFormats?: boolean;
4325
+ /**
4326
+ * Whether border formats from the auto-format are applied.
4327
+ *
4328
+ * @default false
4329
+ */
4330
+ applyBorderFormats?: boolean;
4331
+ /**
4332
+ * Whether font formats from the auto-format are applied.
4333
+ *
4334
+ * @default false
4335
+ */
4336
+ applyFontFormats?: boolean;
4337
+ /**
4338
+ * Whether pattern (fill) formats from the auto-format are applied.
4339
+ *
4340
+ * @default false
4341
+ */
4342
+ applyPatternFormats?: boolean;
4343
+ /**
4344
+ * Whether alignment formats from the auto-format are applied.
4345
+ *
4346
+ * @default false
4347
+ */
4348
+ applyAlignmentFormats?: boolean;
4349
+ /**
4350
+ * Whether width/height adjustments from the auto-format are applied.
4351
+ *
4352
+ * @default false
4353
+ */
4354
+ applyWidthHeightFormats?: boolean;
4355
+ };
4356
+
4357
+ /**
4358
+ * Directions on how formulas should be recalculated in the workbook.
4359
+ *
4360
+ * @group Workbooks
4361
+ */
4362
+ type CalcProps = {
4363
+ /**
4364
+ * Specifies whether an attempt should be made to calculate formulas that contain circular
4365
+ * references. Defaults to `false` in Excel.
4366
+ */
4367
+ iterate?: boolean;
4368
+ /**
4369
+ * The maximum number of calculation iterations, when {@link CalcProps.iterate} is `true`.
4370
+ * Defaults to `100` in Excel.
4371
+ */
4372
+ iterateCount?: integer;
4373
+ /**
4374
+ * When a calculation iteration results in an absolute change that is less than iterateDelta,
4375
+ * then no further iterations should be attempted. Defaults to `0.001` in Excel.
4376
+ */
4377
+ iterateDelta?: number;
4378
+ /**
4379
+ * Which of the two date systems the workbook uses. 1900 is the default.
4380
+ *
4381
+ * @see {@link https://support.microsoft.com/office/e7fe7167-48a9-4b96-bb53-5612a800b487 | Date systems in Excel}
4382
+ */
4383
+ epoch?: 1900 | 1904;
4384
+ /**
4385
+ * The calculation mode for the workbook.
4386
+ *
4387
+ * - `"auto"` (default when absent): recalculate all formulas automatically.
4388
+ * - `"autoNoTable"`: recalculate automatically but exclude data tables.
4389
+ * - `"manual"`: formulas are only recalculated when explicitly triggered.
4390
+ *
4391
+ * @defaultValue "auto"
4392
+ */
4393
+ calcMode?: 'auto' | 'autoNoTable' | 'manual';
4394
+ };
4395
+
4396
+ /**
4397
+ * A collection of default properties that apply to cells, rows, or columns in the worksheet.
4398
+ *
4399
+ * @group Workbooks
4400
+ */
4401
+ type WorksheetDefaults = {
4402
+ /** Default width of the UI-grid column. */
4403
+ colWidth: PixelValue;
4404
+ /** Default height of the UI-grid height. */
4405
+ rowHeight: PixelValue;
4406
+ };
4407
+
4408
+ /**
4409
+ * Visual scale (aka zoom level, aka magnification) applied when displaying a worksheet.
4410
+ *
4411
+ * Each of the three layouts has its own scale. A scale is represented as a percentage, with `100`
4412
+ * (100%) being the default 1:1 scale. When a layout has no explicit scale, use 100%.
4413
+ *
4414
+ * @group Workbooks
4415
+ */
4416
+ type WorksheetLayoutScales = {
4417
+ /**
4418
+ * Zoom level for normal view.
4419
+ *
4420
+ * @min 10
4421
+ * @max 400
4422
+ * @defaultValue 100
4423
+ * */
4424
+ normal?: integer;
4425
+ /**
4426
+ * Zoom level for page layout view.
4427
+ *
4428
+ * @min 10
4429
+ * @max 400
4430
+ * @defaultValue 100
4431
+ */
4432
+ pageLayout?: integer;
4433
+ /**
4434
+ * Zoom level for page break preview (aka sheet layout view).
4435
+ *
4436
+ * @min 10
4437
+ * @max 400
4438
+ * @defaultValue 100
4439
+ */
4440
+ pageBreakPreview?: integer;
4441
+ };
4442
+
4443
+ /**
4444
+ * A worksheet view.
4445
+ *
4446
+ * A worksheet view is a display configuration for a particular worksheet. Worksheet view settings
4447
+ * can include:
4448
+ *
4449
+ * - Active cell
4450
+ * - Selected ranges
4451
+ * - View type (normal, page layout, or page break layout)
4452
+ * - Zoom level
4453
+ *
4454
+ * Currently JSF does not include all available settings for a worksheet.
4455
+ *
4456
+ * @group Workbooks
4457
+ */
4458
+ type WorksheetView = {
4459
+ /**
4460
+ * The id of the workbook view this worksheet view belongs to.
4461
+ *
4462
+ * This is a zero-based index of the workbook view, as stored in the {@link Workbook.views} array.
4463
+ *
4464
+ * Within a single worksheet, each view must reference a distinct workbook view (i.e. no two views
4465
+ * in the same worksheet can share the same `workbookView` id). However, views from different
4466
+ * worksheets may reference the same workbook view.
4467
+ */
4468
+ workbookView: integer;
4469
+ /** Cell that is selected by default when the sheet is visible. */
4470
+ activeCell?: CellId;
4471
+ /** Ranges of cells that are selected by default when the sheet is visible. */
4472
+ activeRanges?: CellRange[];
4473
+ /**
4474
+ * The layout used to display the worksheet.
4475
+ *
4476
+ * @defaultValue "normal"
4477
+ */
4478
+ activeLayout?: 'normal' | 'pageLayout' | 'pageBreakPreview';
4479
+ /**
4480
+ * Scale (aka zoom level, aka magnification) applied when displaying a worksheet. Each different
4481
+ * layout has its own scale.
4482
+ */
4483
+ layoutScales?: WorksheetLayoutScales;
4484
+ /** Indicates whether a hairline-grid should be drawn when displaying the worksheet. */
4485
+ showGridLines?: boolean;
4486
+ };
4487
+
4488
+ /**
4489
+ * A rectangle of cells. A sheet within a spreadsheet.
4490
+ *
4491
+ * @group Workbooks
4492
+ */
4493
+ type Worksheet = {
4494
+ /** Name of the worksheet. */
4495
+ name: string;
4496
+ /** The cells belonging to the worksheet that have some data attached. */
4497
+ cells: Record<CellId, Cell>;
4498
+ comments?: ThreadedComment[];
4499
+ notes?: Note[];
4500
+ /** Widths and styles of the columns in the worksheet. */
4501
+ columns?: GridSize[];
4502
+ /** Heights and styles of the rows in the worksheet. */
4503
+ rows?: GridSize[];
4504
+ /** Ranges that capture which cells have been merged. */
4505
+ merges?: string[];
4506
+ /** A collection of default properties that apply to cells, rows, or columns in the worksheet. */
4507
+ defaults?: WorksheetDefaults;
4508
+ /**
4509
+ * Whether or not the sheet should be shown to a user in a UI displaying the workbook.
4510
+ *
4511
+ * - 0 = sheet is visible
4512
+ * - 1 = sheet is hidden
4513
+ * - 2 = sheet is "very hidden"
4514
+ *
4515
+ * @see {@link https://exceloffthegrid.com/make-excel-sheets-very-hidden/}
4516
+ */
4517
+ hidden?: 0 | 1 | 2;
4518
+ /** The different display configurations saved for the worksheet. */
4519
+ views?: WorksheetView[];
4520
+ /** A list of drawings that appear in this worksheet. */
4521
+ drawings?: Drawing[];
4522
+ };
4523
+
4524
+ /**
4525
+ * A workbook view.
4526
+ *
4527
+ * A workbook view is the display settings that apply to the entire workbook. Workbook view settings
4528
+ * include:
4529
+ *
4530
+ * - Active sheet
4531
+ * - Window size and position
4532
+ * - Window state (whether the window is maximised, minimised, etc)
4533
+ * - Scroll bar visibility
4534
+ *
4535
+ * Currently JSF does not include all available settings for a workbook.
4536
+ *
4537
+ * @group Workbooks
4538
+ */
4539
+ type WorkbookView = {
4540
+ /**
4541
+ * Index to the active sheet in this workbook view. The default value is 0 (first sheet).
4542
+ *
4543
+ * @defaultValue 0
4544
+ */
4545
+ activeSheet?: integer;
4546
+ };
4547
+
4548
+ /**
4549
+ * A workbook is a collection of worksheets, styles, defined names, and other metadata. It's what's
4550
+ * commonly known as a spreadsheet.
4551
+ *
4552
+ * @group Workbooks
4553
+ */
4554
+ type Workbook = {
4555
+ /** Name of the workbook. In the case of a .xlsx file it will be the filename. */
4556
+ name: string;
4557
+ /** An ordered array of the worksheets in the workbook. */
4558
+ sheets: Worksheet[];
4559
+ /** An array of the workbook's defined names. */
4560
+ names?: DefinedName[];
4561
+ /** Metadata on the workbook's tables. */
4562
+ tables?: Table[];
4563
+ /** Metadata on the workbook's pivot tables. */
4564
+ pivotTables?: PivotTable[];
4565
+ /** Directions on how formulas should be recalculated in the workbook. */
4566
+ calculationProperties?: CalcProps;
4567
+ /** Styles for cells in the workbook. */
4568
+ styles?: Style[];
4569
+ /** External cells referenced by the workbook. An external cell is a cell in another workbook. */
4570
+ externals?: External[];
4571
+ /**
4572
+ * Deduplicated formulas used in the workbook. Stored in R1C1 notation. Two formulas are
4573
+ * considered to be the same when their respective representations in R1C1 notation, are
4574
+ * identical.
4575
+ */
4576
+ formulas?: string[];
4577
+ /** The different display configurations saved for the workbook. */
4578
+ views?: WorkbookView[];
4579
+ /**
4580
+ * Individuals who have written a threaded comment in this workbook, or who have been mentioned in
4581
+ * one.
4582
+ *
4583
+ * @see {@link ThreadedComment}
4584
+ */
4585
+ people?: Person[];
4586
+ /**
4587
+ * A simple dictionary of binary images used by this workbook.
4588
+ *
4589
+ * The keys should be the file paths of the images used to refer to them, commonly these will be
4590
+ * the `mediaId` properties on drawing objects. The values should be data URI encoded binaries.
4591
+ *
4592
+ * The following is a table of formats you may be expected to encounter:
4593
+ *
4594
+ * | Extension | MIME type | Common name
4595
+ * |-------------------------|------------------------|-------------
4596
+ * | `.png` | `image/png` | Portable Network Graphics
4597
+ * | `.jpg`, `.jpeg` | `image/jpeg` | JPEG
4598
+ * | `.gif` | `image/gif` | Graphics Interchange Format
4599
+ * | `.emf` | `image/emf` | Enhanced Metafile
4600
+ * | `.wmf` | `image/wmf` | Windows Metafile
2036
4601
  * | `.wdp`, `.jxr`, `.hdp` | `image/vnd.ms-photo` | Windows Media Photo / JPEG XR
2037
4602
  * | `.bmp` | `image/bmp` | Bitmap
2038
4603
  * | `.tif`, `.tiff` | `image/tiff` | Tagged Image File Format
@@ -2042,6 +4607,54 @@ type Workbook = {
2042
4607
  * @see {@link https://www.rfc-editor.org/rfc/rfc2397}
2043
4608
  */
2044
4609
  images?: Record<string, string>;
4610
+ /**
4611
+ * The workbook theme. Specifies the colour scheme and fonts referenced throughout the workbook in
4612
+ * order to create a consistent visual presentation.
4613
+ */
4614
+ theme?: Theme;
4615
+ /**
4616
+ * Optional metadata about this workbook.
4617
+ *
4618
+ * @example
4619
+ * An XLSX file with metadata explicitly marking it as saved by Excel for Macintosh might have
4620
+ * `meta: { app: { name: 'Microsoft Excel', version: '16.0300', variant: 'Macintosh' } }`.
4621
+ *
4622
+ * @example
4623
+ * An XLSX file lacking app metadata but recognized heuristically as being a Google Sheets
4624
+ * export might have `meta: { app: { name: 'Google Sheets', confidence: 0.8 } }`.
4625
+ */
4626
+ meta?: {
4627
+ /**
4628
+ * Information about the application that originated this workbook. Converters should
4629
+ * populate this from file metadata and/or by heuristic detection (in which case they should
4630
+ * set `confidence` to a value less than `1`).
4631
+ */
4632
+ app?: {
4633
+ /**
4634
+ * The plain application name, without platform qualifiers or version suffixes
4635
+ * (e.g. `"Microsoft Excel"`, `"LibreOffice Calc"`).
4636
+ */
4637
+ name?: string;
4638
+ /**
4639
+ * The application version string, if known (e.g. `"16.0300"`).
4640
+ */
4641
+ version?: string;
4642
+ /**
4643
+ * Operating system or other variant of the application (e.g. `"Macintosh"`). Present when
4644
+ * the application name in the source file includes a platform qualifier that was separated
4645
+ * out from {@link name}.
4646
+ */
4647
+ variant?: string;
4648
+ /**
4649
+ * How confident the converter is in the identification. A value of `1` means the app
4650
+ * information came directly from the metadata in the source file. Values less than `1`
4651
+ * indicate heuristic detection, with lower values representing less certainty.
4652
+ *
4653
+ * @defaultValue 1
4654
+ */
4655
+ confidence?: number;
4656
+ };
4657
+ };
2045
4658
  };
2046
4659
 
2047
- export type { AdjustCoordinate, AdjustPoint, AdjustValueHandlePolar, AdjustValueHandleXY, ArcToCommand, BlackWhiteMode, BlipFill, BorderStyle, CalcProps, Cell, CellId, CellOffset, CellRange, CellValueType, CloseCommand, Color, Comment, ConnectionPoint, CubicBezierToCommand, DashStop, DataTable, DefinedName, DmlAngle, Drawing, EmuValue, Extent, External, ExternalWorksheet, Fill, FillPatternStyle, FlipAxis, FontStyleIndex, GeomGuideName, GradientColorStop, GradientLinearFill, GradientPathFill, Graphic, GraphicAnchor, GraphicAnchorAbsolute, GraphicAnchorOneCell, GraphicAnchorTwoCell, GraphicBitmap, GraphicChart, GraphicConnectionShape, GraphicGroup, GraphicShape, GridSize, GroupFill, GuidePoint, HAlign, HyperlinkTextRun, InsetRect, Line, LineAlignment, LineCapType, LineCompoundType, LineEnd, LineEndSize, LineEndType, LineJoinType, LineStyle, LineToCommand, MentionTextRun, MoveToCommand, NoFill, Note, Paragraph, Path, PathCommand, PathFillMode, PathFillType, PatternFill, PatternStyle, Percentage, Person, PixelValue, Point, PositiveCoordinate, QuadraticBezierToCommand, RectAlignment, RelativeRect, Shape, ShapeRect, ShapeStyle, SolidFill, Style, Table, TableColumn, TableColumnDataType, TableStyle, TableStyleName, TextAnchoring, TextBody, TextHorzOverflow, TextRun, TextVertOverflow, TextVerticalType, TextWrapping, ThreadedComment, Tile, Underline, VAlign, Workbook, WorkbookView, Worksheet, WorksheetDefaults, WorksheetLayoutScales, WorksheetView, Xfrm, XfrmGroup };
4660
+ export type { AdjustCoordinate, AdjustPoint, AdjustValueHandlePolar, AdjustValueHandleXY, ArcToCommand, AutoColor, BlackWhiteMode, BlipFill, BorderStyle, CalcProps, Cell, CellId, CellOffset, CellRange, CellValueType, CloseCommand, Color, ColorTransform, Comment, ConnectionPoint, CubicBezierToCommand, DashStop, DataTable, DefinedName, DmlAngle, Drawing, EmuValue, Extent, External, ExternalDefinedName, ExternalWorksheet, Fill, FillPatternStyle, FlipAxis, FontStyleIndex, GeomGuideName, GradientColorStop, GradientLinearFill, GradientPathFill, Graphic, GraphicAnchor, GraphicAnchorAbsolute, GraphicAnchorOneCell, GraphicAnchorTwoCell, GraphicBitmap, GraphicChart, GraphicConnectionShape, GraphicGroup, GraphicShape, GridSize, GroupFill, GuidePoint, HAlign, HslColor, HyperlinkTextRun, IndexedColor, InsetRect, Line, LineAlignment, LineCapType, LineCompoundType, LineEnd, LineEndSize, LineEndType, LineJoinType, LineStyle, LineToCommand, MentionTextRun, MoveToCommand, NoFill, Note, Paragraph, Path, PathCommand, PathFillMode, PathFillType, PatternFill, PatternStyle, Percentage, Person, PivotArea, PivotAreaAxis, PivotAreaReference, PivotAreaType, PivotAutoFilterColumn, PivotCache, PivotCacheBase, PivotCacheConsolidation, PivotCacheConsolidationRangeSet, PivotCacheConsolidationSource, PivotCacheExternal, PivotCacheField, PivotCacheFieldGroup, PivotCacheRangePr, PivotCacheRecord, PivotCacheRecordValue, PivotCacheScenario, PivotCacheSharedItem, PivotCacheSharedItemBool, PivotCacheSharedItemDate, PivotCacheSharedItemErr, PivotCacheSharedItemNil, PivotCacheSharedItemNum, PivotCacheSharedItemStr, PivotCacheSharedItemsMeta, PivotCacheWorksheet, PivotCacheWorksheetSource, PivotCacheWorksheetSourceName, PivotCacheWorksheetSourceRange, PivotCalculatedField, PivotCustomFilterCriterion, PivotCustomFilterOperator, PivotDataField, PivotDataFieldAggregation, PivotField, PivotFieldAxis, PivotFieldItem, PivotFilter, PivotFilterType, PivotGroupBy, PivotItemType, PivotPageField, PivotRowColItem, PivotShowDataAs, PivotSubtotalFunction, PivotTable, PivotTableLocation, PivotTableStyle, PivotTableStyleName, PixelValue, Point, PositiveCoordinate, PresetColor, QuadraticBezierToCommand, RectAlignment, RelativeRect, ScRgbColor, SchemeColor, Shape, ShapeRect, ShapeStyle, SolidFill, SrgbColor, Style, SystemColor, Table, TableColumn, TableColumnDataType, TableStyle, TableStyleName, TextAnchoring, TextBody, TextHorzOverflow, TextRun, TextVertOverflow, TextVerticalType, TextWrapping, Theme, ThemeColorScheme, ThemeCustomColor, ThemeFontCollection, ThemeFontScheme, ThemeSupplementalFont, ThemeTextFont, ThreadedComment, Tile, Underline, VAlign, Workbook, WorkbookView, Worksheet, WorksheetDefaults, WorksheetLayoutScales, WorksheetView, Xfrm, XfrmGroup, integer };