@shbernal/ts-xlsx 1.2.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (161) hide show
  1. package/README.md +5 -0
  2. package/dist/core/address.d.ts +49 -2
  3. package/dist/core/address.js +31 -3
  4. package/dist/core/autofilter.d.ts +2 -2
  5. package/dist/core/cell.d.ts +17 -16
  6. package/dist/core/cell.js +3 -7
  7. package/dist/core/color-resolution.d.ts +7 -7
  8. package/dist/core/column.d.ts +8 -9
  9. package/dist/core/column.js +2 -4
  10. package/dist/core/comment-thread.d.ts +32 -23
  11. package/dist/core/comment-thread.js +4 -4
  12. package/dist/core/conditional-formatting-overlay.d.ts +1 -1
  13. package/dist/core/conditional-formatting.d.ts +3 -3
  14. package/dist/core/data-validation-overlay.d.ts +1 -1
  15. package/dist/core/data-validation.d.ts +3 -3
  16. package/dist/core/date.d.ts +3 -3
  17. package/dist/core/formula.d.ts +6 -6
  18. package/dist/core/grid-edits.js +3 -3
  19. package/dist/core/image.d.ts +37 -2
  20. package/dist/core/image.js +6 -0
  21. package/dist/core/internal.d.ts +9 -1
  22. package/dist/core/limits.d.ts +4 -4
  23. package/dist/core/merge.d.ts +6 -12
  24. package/dist/core/merge.js +0 -3
  25. package/dist/core/page-setup.d.ts +4 -4
  26. package/dist/core/pivot-table.d.ts +2 -4
  27. package/dist/core/pivot-table.js +5 -5
  28. package/dist/core/preserved.d.ts +3 -3
  29. package/dist/core/protection.d.ts +4 -4
  30. package/dist/core/range.d.ts +16 -14
  31. package/dist/core/range.js +5 -5
  32. package/dist/core/row-input.d.ts +2 -8
  33. package/dist/core/row-input.js +2 -2
  34. package/dist/core/row.d.ts +7 -8
  35. package/dist/core/row.js +2 -4
  36. package/dist/core/style.d.ts +14 -14
  37. package/dist/core/table-style.d.ts +9 -9
  38. package/dist/core/table-style.js +1 -1
  39. package/dist/core/table.d.ts +30 -42
  40. package/dist/core/table.js +16 -10
  41. package/dist/core/theme.d.ts +13 -43
  42. package/dist/core/theme.js +2 -148
  43. package/dist/core/value.d.ts +7 -7
  44. package/dist/core/workbook-protection.d.ts +2 -2
  45. package/dist/core/workbook-styles.d.ts +26 -0
  46. package/dist/core/workbook-styles.js +48 -0
  47. package/dist/core/workbook-theme.d.ts +25 -0
  48. package/dist/core/workbook-theme.js +49 -0
  49. package/dist/core/workbook-vba.d.ts +17 -0
  50. package/dist/core/workbook-vba.js +79 -0
  51. package/dist/core/workbook.d.ts +141 -83
  52. package/dist/core/workbook.js +74 -133
  53. package/dist/core/worksheet-comments.d.ts +9 -0
  54. package/dist/core/worksheet-comments.js +52 -0
  55. package/dist/core/worksheet-model.d.ts +4 -4
  56. package/dist/core/worksheet-model.js +1 -0
  57. package/dist/core/worksheet-pictures.d.ts +29 -0
  58. package/dist/core/worksheet-pictures.js +42 -0
  59. package/dist/core/worksheet.d.ts +94 -77
  60. package/dist/core/worksheet.js +36 -95
  61. package/dist/customui/errors.d.ts +1 -1
  62. package/dist/customui/ribbon.d.ts +3 -3
  63. package/dist/entries/core.d.ts +4 -4
  64. package/dist/entries/core.js +1 -1
  65. package/dist/entries/vba.d.ts +1 -1
  66. package/dist/entries/vba.js +1 -1
  67. package/dist/entries/xlsx.d.ts +1 -0
  68. package/dist/entries/xlsx.js +1 -0
  69. package/dist/errors.d.ts +12 -12
  70. package/dist/io/csv/read.js +1 -2
  71. package/dist/io/csv/write.d.ts +8 -3
  72. package/dist/io/csv/write.js +17 -2
  73. package/dist/io/opc/errors.d.ts +6 -6
  74. package/dist/io/opc/inflate.d.ts +1 -1
  75. package/dist/io/opc/namespaces.d.ts +1 -1
  76. package/dist/io/opc/read-opc.d.ts +19 -3
  77. package/dist/io/opc/read-opc.js +14 -8
  78. package/dist/io/opc/read-options.d.ts +2 -2
  79. package/dist/io/opc/sniff-format.d.ts +2 -2
  80. package/dist/io/opc/zip-mtime.d.ts +5 -0
  81. package/dist/io/opc/zip-mtime.js +1 -0
  82. package/dist/io/style/xf-style.d.ts +38 -6
  83. package/dist/io/style/xf-style.js +22 -0
  84. package/dist/io/xlsb/errors.d.ts +1 -1
  85. package/dist/io/xlsb/formula.d.ts +4 -4
  86. package/dist/io/xlsb/primitives.d.ts +8 -8
  87. package/dist/io/xlsb/ptg-functions.d.ts +1 -1
  88. package/dist/io/xlsb/read-styles.js +2 -20
  89. package/dist/io/xlsb/read.d.ts +2 -2
  90. package/dist/io/xlsx/cell-accumulator.d.ts +25 -6
  91. package/dist/io/xlsx/cell-accumulator.js +111 -30
  92. package/dist/io/xlsx/cell-value.d.ts +2 -2
  93. package/dist/io/xlsx/cell-value.js +3 -3
  94. package/dist/io/xlsx/color-xml.js +11 -17
  95. package/dist/io/xlsx/comments.d.ts +5 -5
  96. package/dist/io/xlsx/comments.js +13 -6
  97. package/dist/io/xlsx/conditional-formatting.d.ts +3 -3
  98. package/dist/io/xlsx/conditional-formatting.js +7 -16
  99. package/dist/io/xlsx/data-validation.d.ts +2 -2
  100. package/dist/io/xlsx/data-validation.js +1 -1
  101. package/dist/io/xlsx/edit-vba.js +2 -1
  102. package/dist/io/xlsx/errors.d.ts +3 -3
  103. package/dist/io/xlsx/hyperlinks.d.ts +4 -2
  104. package/dist/io/xlsx/hyperlinks.js +5 -5
  105. package/dist/io/xlsx/images.d.ts +1 -1
  106. package/dist/io/xlsx/images.js +8 -8
  107. package/dist/io/xlsx/namespaces.d.ts +2 -2
  108. package/dist/io/xlsx/package-plan.js +5 -2
  109. package/dist/io/xlsx/read-pivot.js +2 -5
  110. package/dist/io/xlsx/read-rows.d.ts +13 -13
  111. package/dist/io/xlsx/read-rows.js +19 -55
  112. package/dist/io/xlsx/read-shared-strings.js +7 -5
  113. package/dist/io/xlsx/read-styles.d.ts +3 -3
  114. package/dist/io/xlsx/read-styles.js +40 -65
  115. package/dist/io/xlsx/read-worksheet.js +67 -115
  116. package/dist/io/xlsx/read.d.ts +3 -5
  117. package/dist/io/xlsx/read.js +94 -71
  118. package/dist/io/xlsx/rich-runs.d.ts +1 -1
  119. package/dist/io/xlsx/rich-runs.js +1 -1
  120. package/dist/io/xlsx/rich-text.d.ts +1 -1
  121. package/dist/io/xlsx/shared-strings.d.ts +2 -2
  122. package/dist/io/xlsx/sheet-properties.js +5 -4
  123. package/dist/io/xlsx/styles.d.ts +8 -9
  124. package/dist/io/xlsx/styles.js +4 -3
  125. package/dist/io/xlsx/tables.d.ts +2 -2
  126. package/dist/io/xlsx/tables.js +8 -13
  127. package/dist/io/xlsx/theme-xml.d.ts +37 -0
  128. package/dist/io/xlsx/theme-xml.js +142 -0
  129. package/dist/io/xlsx/threaded-comments.d.ts +18 -27
  130. package/dist/io/xlsx/threaded-comments.js +9 -21
  131. package/dist/io/xlsx/workbook-xml.d.ts +1 -1
  132. package/dist/io/xlsx/workbook-xml.js +6 -2
  133. package/dist/io/xlsx/worksheet-xml.d.ts +2 -2
  134. package/dist/io/xlsx/worksheet-xml.js +7 -12
  135. package/dist/io/xlsx/write-stream.d.ts +15 -15
  136. package/dist/io/xlsx/write-stream.js +5 -3
  137. package/dist/io/xlsx/write.d.ts +12 -7
  138. package/dist/io/xlsx/write.js +10 -6
  139. package/dist/io/xlsx/x14-ext.d.ts +1 -1
  140. package/dist/vba/bytes.d.ts +12 -0
  141. package/dist/vba/bytes.js +40 -0
  142. package/dist/vba/cfb-writer.d.ts +1 -1
  143. package/dist/vba/cfb.d.ts +1 -1
  144. package/dist/vba/cfb.js +15 -51
  145. package/dist/vba/codepage.d.ts +2 -2
  146. package/dist/vba/errors.d.ts +2 -2
  147. package/dist/vba/index.d.ts +2 -2
  148. package/dist/vba/index.js +2 -2
  149. package/dist/vba/ms-ovba.d.ts +1 -1
  150. package/dist/vba/ms-ovba.js +1 -3
  151. package/dist/vba/project-editor.d.ts +9 -9
  152. package/dist/vba/project-editor.js +2 -11
  153. package/dist/vba/project.d.ts +5 -5
  154. package/dist/vba/project.js +1 -10
  155. package/dist/vba/vba-encoding.d.ts +1 -1
  156. package/dist/xml/errors.d.ts +1 -1
  157. package/dist/xml/xml-read.d.ts +38 -9
  158. package/dist/xml/xml-read.js +23 -0
  159. package/dist/xml/xml.d.ts +31 -9
  160. package/dist/xml/xml.js +23 -3
  161. package/package.json +41 -35
@@ -1,10 +1,10 @@
1
1
  import { type AutoFilter } from './autofilter.ts';
2
2
  import { Cell } from './cell.ts';
3
3
  import { Column } from './column.ts';
4
- import { type CommentThread } from './comment-thread.ts';
4
+ import type { CommentThread } from './comment-thread.ts';
5
5
  import type { ConditionalFormatting } from './conditional-formatting.ts';
6
6
  import type { DataValidation, DataValidationEntry } from './data-validation.ts';
7
- import { type AnchoredImage, type AnchorPoint, type ImageAnchor, type ImageEditAs } from './image.ts';
7
+ import type { AnchoredImage, AnchorPoint, ImageAnchor, ImageEditAs } from './image.ts';
8
8
  import { INTERNAL } from './internal.ts';
9
9
  import type { HeaderFooter, PageBreak, PageMargins, PageSetup, PrintOptions } from './page-setup.ts';
10
10
  import { type ParsedPivotTable, PivotTable, type PivotTableOptions } from './pivot-table.ts';
@@ -39,7 +39,7 @@ export interface OutlineProperties {
39
39
  /**
40
40
  * A worksheet's frozen-pane view. `state` `'frozen'` locks the top `ySplit` rows and left `xSplit`
41
41
  * columns in place while the rest scrolls; `'normal'` (the default) has no split and emits no
42
- * `<pane>` writing a normal view leaves no leftover pane markup that would trip Excel's repair
42
+ * `<pane>`: writing a normal view leaves no leftover pane markup that would trip Excel's repair
43
43
  * prompt. An empty object is a normal view.
44
44
  */
45
45
  export interface SheetView {
@@ -51,16 +51,25 @@ export interface SheetView {
51
51
  ySplit?: number;
52
52
  /** The cell anchoring the bottom-right scrolling pane; defaults to the first unfrozen cell. */
53
53
  topLeftCell?: string;
54
+ /**
55
+ * Whether the grid's cell lines are drawn on screen. Absent means Excel's default, which is on,
56
+ * so only `false` is worth setting: a sheet that paints its own fills and borders reads as a
57
+ * document rather than a spreadsheet once the grid behind it is off.
58
+ *
59
+ * On screen only, and unrelated to {@link PrintOptions.gridLines}, which decides whether the grid
60
+ * is *printed*. Excel exposes them as two separate checkboxes because the answers differ.
61
+ */
62
+ showGridLines?: boolean;
54
63
  }
55
64
  /**
56
65
  * Per-column formatting. A column may exist purely to carry these, with no cells. The style
57
66
  * facets are *defaults* for the column's cells: a cell that sets a facet of its own wins, but
58
- * one that leaves a facet unset inherits the column's the same precedence Excel applies, and
67
+ * one that leaves a facet unset inherits the column's, the same precedence Excel applies, and
59
68
  * symmetric with how a {@link RowProperties} fill defaults a row's cells.
60
69
  */
61
70
  export interface ColumnProperties extends CellStyle {
62
71
  /** Stable key naming the column so a keyed-object row (see {@link Worksheet.addRow}) can place a
63
- * value under it by name rather than position. In-memory only it is not serialized to OOXML. */
72
+ * value under it by name rather than position. In-memory only: it is not serialized to OOXML. */
64
73
  key?: string;
65
74
  /** Column width in character units. */
66
75
  width?: number;
@@ -96,26 +105,34 @@ export interface CellModel extends CellStyle {
96
105
  note?: string | undefined;
97
106
  }
98
107
  /**
99
- * A serialisable snapshot of a worksheet's value and overlay content its cells and their styles,
100
- * the column/row/page metadata, and the sheet-level overlays (merges, data validations, conditional
101
- * formattings, tables, the autofilter, protection). {@link Worksheet.model} exports one; assigning
102
- * it back reproduces that content. The getter and setter cover exactly the same fields, so a
103
- * `dst.model = src.model` round-trip drops none of it an export field the import ignored would
104
- * silently lose data, the historical merge-loss failure this contract exists to prevent. Both
105
- * directions are driven from one field table (`core/worksheet-model.ts`), which the compiler proves
106
- * covers every field below, so adding a field here without wiring it fails the build.
108
+ * A serialisable snapshot of a worksheet's value and overlay content: its cells and their styles,
109
+ * the column/row/page metadata, the frozen-pane view, and the sheet-level overlays (merges, data
110
+ * validations, conditional formattings, tables, the autofilter, protection). {@link Worksheet.model}
111
+ * exports one; assigning it back reproduces that content. The getter and setter cover exactly the
112
+ * same fields, so a `dst.model = src.model` round-trip drops none of it: an export field the import
113
+ * ignored would silently lose data, the historical merge-loss failure this contract exists to
114
+ * prevent. Both directions are driven from one field table (`core/worksheet-model.ts`), which the
115
+ * compiler proves covers every field below, so adding a field here without wiring it fails the build.
116
+ *
117
+ * The line between what belongs here and what does not is **workbook-independence**: a field earns
118
+ * its place when its value means the same thing on any sheet of any workbook. That is the test a new
119
+ * field is measured against, and applying it is what admitted the autofilter and the frozen-pane view
120
+ * after each had been omitted for no stated reason (ADR-0005 §2).
107
121
  *
108
- * Out of scope by design: content that carries workbook-level identity rather than pure sheet
109
- * state anchored and background images (their bytes live on the {@link Workbook}), pivot tables
110
- * (their source references a live worksheet), and byte-preserved parts (charts, vector drawings,
111
- * slicers) kept verbatim for round-tripping. These stay with their source sheet; a model assignment
112
- * neither copies nor clears them.
122
+ * Out of scope by design: content carrying workbook-level identity rather than pure sheet state.
123
+ * That covers anchored and background images (their bytes live on the {@link Workbook}), pivot tables
124
+ * (their source references a live worksheet), threaded comments (their authors are ids into the
125
+ * workbook's {@link Workbook.persons} registry, so a copied conversation would name an author the
126
+ * destination has never heard of), and byte-preserved parts (charts, vector drawings, slicers) kept
127
+ * verbatim for round-tripping. These stay with their source sheet; a model assignment neither copies
128
+ * nor clears them.
113
129
  */
114
130
  export interface WorksheetModel {
115
131
  state: WorksheetState['state'];
116
132
  tabColor: Color | undefined;
117
133
  properties: WorksheetProperties;
118
134
  outline: OutlineProperties;
135
+ view: SheetView;
119
136
  pageSetup: PageSetup;
120
137
  printOptions: PrintOptions;
121
138
  pageMargins: PageMargins;
@@ -154,7 +171,7 @@ export declare class Worksheet {
154
171
  readonly properties: WorksheetProperties;
155
172
  /**
156
173
  * Outline summary-position flags. Mutate in place: `sheet.outline.summaryBelow = false`. Empty
157
- * means unset the writer emits no `<outlinePr>` and a round-trip never fabricates one.
174
+ * means unset: the writer emits no `<outlinePr>` and a round-trip never fabricates one.
158
175
  */
159
176
  readonly outline: OutlineProperties;
160
177
  /**
@@ -164,13 +181,13 @@ export declare class Worksheet {
164
181
  readonly view: SheetView;
165
182
  /**
166
183
  * Print-scaling and orientation. Mutate in place: `sheet.pageSetup.fitToPage = true`. Empty means
167
- * unset the writer emits neither `<pageSetUpPr>` nor `<pageSetup>` and a round-trip never
184
+ * unset: the writer emits neither `<pageSetUpPr>` nor `<pageSetup>` and a round-trip never
168
185
  * fabricates them.
169
186
  */
170
187
  readonly pageSetup: PageSetup;
171
188
  /**
172
189
  * Print-toggle flags (`<printOptions>`): centring, and whether headings/gridlines print. Mutate in
173
- * place: `sheet.printOptions.gridLines = true`. Empty means unset the writer emits no element and
190
+ * place: `sheet.printOptions.gridLines = true`. Empty means unset. The writer emits no element and
174
191
  * a round-trip never fabricates one.
175
192
  */
176
193
  readonly printOptions: PrintOptions;
@@ -208,8 +225,8 @@ export declare class Worksheet {
208
225
  /** Whether a cell has been materialised at the given 1-based position. */
209
226
  hasCell(row: number, col: number): boolean;
210
227
  /**
211
- * A handle on a 1-based column: its formatting, its cells, and its values. Cheap and stateless
212
- * it creates neither cells nor a format record, so asking about a column costs nothing and does
228
+ * A handle on a 1-based column: its formatting, its cells, and its values. Cheap and stateless.
229
+ * It creates neither cells nor a format record, so asking about a column costs nothing and does
213
230
  * not extend the used range. Writing through it (`getColumn(2).width = 12`) is what materialises
214
231
  * the record.
215
232
  *
@@ -217,7 +234,7 @@ export declare class Worksheet {
217
234
  */
218
235
  getColumn(index: number): Column;
219
236
  /**
220
- * A handle on a 1-based row: its formatting, its cells, and its values. Cheap and stateless — it
237
+ * A handle on a 1-based row: its formatting, its cells, and its values. Cheap and stateless. It
221
238
  * creates neither cells nor a format record, so asking about a row costs nothing and does not
222
239
  * extend the used range. Writing through it (`getRow(3).height = 20`) is what materialises the
223
240
  * record.
@@ -226,7 +243,7 @@ export declare class Worksheet {
226
243
  */
227
244
  getRow(number: number): Row;
228
245
  /**
229
- * A handle on a rectangular block of cells `getRange('B2:D5')`, or the same block by its
246
+ * A handle on a rectangular block of cells: `getRange('B2:D5')`, or the same block by its
230
247
  * inclusive corners as `getRange(2, 2, 5, 4)`. Cheap and stateless like {@link getRow} and
231
248
  * {@link getColumn}: it creates no cells and does not extend the used range.
232
249
  *
@@ -245,7 +262,7 @@ export declare class Worksheet {
245
262
  getRange(reference: string): Range;
246
263
  getRange(top: number, left: number, bottom: number, right: number): Range;
247
264
  /**
248
- * The 1-based index of the last row carrying anything data or its own formatting
265
+ * The 1-based index of the last row carrying anything (data or its own formatting),
249
266
  * or 0 for an empty sheet. Spans gaps: a value in row 5 makes this 5 even if rows 2–4
250
267
  * are empty. This is the used-range extent, not a populated-row tally (see
251
268
  * {@link actualRowCount}).
@@ -254,29 +271,29 @@ export declare class Worksheet {
254
271
  /** The number of rows that hold at least one non-empty cell, ignoring gaps and formatting-only rows. */
255
272
  get actualRowCount(): number;
256
273
  /**
257
- * The 1-based index of the last column carrying anything a non-empty cell or its own format
258
- * properties or 0 for an empty sheet. The used-range width, mirroring {@link rowCount} for the
274
+ * The 1-based index of the last column carrying anything (a non-empty cell or its own format
275
+ * properties), or 0 for an empty sheet. The used-range width, mirroring {@link rowCount} for the
259
276
  * other axis: a value in column E makes this 5 even if columns B–D are empty.
260
277
  */
261
278
  get columnCount(): number;
262
279
  /**
263
- * The sheet's used range as one handle `A1` through the last row and column that carry
264
- * anything or `undefined` when there is no rectangle to name.
280
+ * The sheet's used range as one handle: `A1` through the last row and column that carry
281
+ * anything, or `undefined` when there is no rectangle to name.
265
282
  *
266
283
  * This is {@link rowCount} and {@link columnCount} said once, so a caller stops reassembling
267
284
  * `A1:${numberToColumn(sheet.columnCount)}${sheet.rowCount}` by hand. That is what an
268
- * {@link autoFilter} covering the whole sheet wants `sheet.autoFilter = sheet.usedRange.address`
269
- * and Excel writes exactly that ref for a filter it applies itself. A header-only ref filters
285
+ * {@link autoFilter} covering the whole sheet wants (`sheet.autoFilter = sheet.usedRange.address`),
286
+ * and Excel writes exactly that ref for a filter it applies itself. A header-only ref filters
270
287
  * nothing, which is the bug this exists to make hard to write.
271
288
  *
272
289
  * It inherits both counts' definition of *used*, so it spans gaps (a value in `E5` and nothing
273
- * else still gives `A1:E5`) and includes a line carrying only its own formatting a set column
290
+ * else still gives `A1:E5`) and includes a line carrying only its own formatting: a set column
274
291
  * width, an outline level, a merge reaching past the last value. `undefined` therefore means
275
292
  * strictly "no rectangle": an empty sheet, or one carrying only row formatting and no columns at
276
293
  * all (or the reverse), where an axis has no extent to bound the other against.
277
294
  *
278
- * Not the same thing as the `<dimension>` a written package records. That is the *tight* box
279
- * top-left at the first used cell, formatting-only rows excluded because Excel writes it to
295
+ * Not the same thing as the `<dimension>` a written package records. That is the *tight* box,
296
+ * top-left at the first used cell and formatting-only rows excluded, because Excel writes it to
280
297
  * describe where the data is, not what the grid spans. This handle is anchored at `A1`, because
281
298
  * a caller asking for the used range means the block to read, style or filter.
282
299
  */
@@ -303,7 +320,7 @@ export declare class Worksheet {
303
320
  /** The tables defined on this sheet, in definition order. */
304
321
  get tables(): readonly Table[];
305
322
  /** The table with the given name (case-sensitive, the identifier Excel uses), or `undefined`.
306
- * A table read back from a file is fully hydrated its rows can be read and appended to. */
323
+ * A table read back from a file is fully hydrated: its rows can be read and appended to. */
307
324
  getTable(name: string): Table | undefined;
308
325
  /**
309
326
  * Add a pivot table to this (destination) sheet, summarising a source sheet's data. The source is
@@ -316,7 +333,7 @@ export declare class Worksheet {
316
333
  /** The pivot tables hosted on this sheet, in definition order. */
317
334
  get pivotTables(): readonly PivotTable[];
318
335
  /**
319
- * Pivot tables reconstructed from a loaded package, in the order the reader found them a
336
+ * Pivot tables reconstructed from a loaded package, in the order the reader found them: a
320
337
  * read-only inspection view (source range, field roles, value field, aggregation). A pivot
321
338
  * authored on this sheet via {@link addPivotTable} does not appear here; a pivot loaded from a
322
339
  * file does not appear in {@link pivotTables}. The loaded pivots re-emit verbatim through
@@ -324,13 +341,13 @@ export declare class Worksheet {
324
341
  */
325
342
  get loadedPivotTables(): readonly ParsedPivotTable[];
326
343
  /**
327
- * Anchor a threaded conversation to a cell Excel's modern review comment: an opening message, its
328
- * replies, and whether the discussion was marked resolved. Distinct from a cell's legacy note
329
- * ({@link Cell.note}), and mutually exclusive with one: Excel refuses to put both on one cell, and a
330
- * cell carrying both is written back as the conversation alone.
344
+ * Anchor a threaded conversation to a cell. This is Excel's modern review comment: an opening
345
+ * message, its replies, and whether the discussion was marked resolved. Distinct from a cell's
346
+ * legacy note ({@link Cell.note}), and mutually exclusive with one: Excel refuses to put both on
347
+ * one cell, and a cell carrying both is written back as the conversation alone.
331
348
  *
332
349
  * Every message supplies its own {@link Comment.id} and {@link Comment.date}, and names its author by
333
- * {@link Comment.personId} into the workbook registry ({@link Workbook.addPerson}) the writer has no
350
+ * {@link Comment.personId} into the workbook registry ({@link Workbook.addPerson}): the writer has no
334
351
  * clock and no id generator, so nothing here is invented and the same workbook always serialises to the
335
352
  * same bytes. Every id is normalised to the brace-wrapped upper-case GUID form the format requires, so a
336
353
  * `crypto.randomUUID()` is accepted as-is.
@@ -338,7 +355,7 @@ export declare class Worksheet {
338
355
  * Message ids must be unique **within this sheet**, because that is the scope in which they mean
339
356
  * anything: a reply names its thread by the head's id inside the sheet's own part, and the legacy
340
357
  * fallback comment binds its cell by the same id inside the sheet's own comments part. Two sheets reusing
341
- * one id is therefore harmless and is not rejected Excel's ids happen to be globally unique, but
358
+ * one id is therefore harmless and is not rejected: Excel's ids happen to be globally unique, but
342
359
  * nothing resolves across a part boundary.
343
360
  *
344
361
  * @throws {SyntaxError} if the anchor does not resolve to a single cell, if any id is not a GUID, if a
@@ -347,7 +364,7 @@ export declare class Worksheet {
347
364
  */
348
365
  addCommentThread(thread: CommentThread): void;
349
366
  /**
350
- * The threaded conversations on this sheet Excel's modern review comments (author, timestamp,
367
+ * The threaded conversations on this sheet: Excel's modern review comments (author, timestamp,
351
368
  * replies, resolved state, `@mentions`). Empty for a sheet with none. Distinct from a cell's legacy note
352
369
  * ({@link Cell.note}).
353
370
  */
@@ -390,7 +407,7 @@ export declare class Worksheet {
390
407
  */
391
408
  addImageAnchor(imageId: number, anchor: ImageAnchor): void;
392
409
  /** Drop every anchor of the given workbook image from this sheet. The image stays registered on the
393
- * workbook another sheet may still show it so only this sheet's anchors are removed; the writer
410
+ * workbook (another sheet may still show it), so only this sheet's anchors are removed; the writer
394
411
  * then omits any media no sheet anchors any longer. */
395
412
  removeImage(imageId: number): void;
396
413
  /** The images anchored to this sheet, in the order they were added. */
@@ -407,11 +424,11 @@ export declare class Worksheet {
407
424
  get preservedReferences(): readonly PreservedWorksheetReference[];
408
425
  /**
409
426
  * Merge a range of cells (`"A1:B2"`). A range that overlaps an already-merged region is
410
- * rejected Excel forbids overlapping merges and writes such geometry as a corrupt file.
427
+ * rejected: Excel forbids overlapping merges and writes such geometry as a corrupt file.
411
428
  * Whole-row/column ranges (`"A:A"`) are unbounded, carry no rectangle, and are not overlap-checked.
412
429
  *
413
430
  * Any value already sitting in a covered non-anchor cell is discarded, keeping only the top-left
414
- * anchor's exactly how Excel collapses a range on merge. Leaving it would emit a populated `<c>`
431
+ * anchor's, exactly how Excel collapses a range on merge. Leaving it would emit a populated `<c>`
415
432
  * under the `<mergeCell>` ref, the geometry Excel opens with a repair prompt. Covered-cell styles
416
433
  * survive (a border spanning the merge is legal), so only the conflicting value is cleared.
417
434
  */
@@ -419,15 +436,15 @@ export declare class Worksheet {
419
436
  /** The merged ranges on this sheet, in the order they were added. */
420
437
  get merges(): readonly string[];
421
438
  /**
422
- * The sheet's autofilter its range plus any per-column criteria or `undefined` when the sheet
439
+ * The sheet's autofilter (its range plus any per-column criteria), or `undefined` when the sheet
423
440
  * carries none. Setting one turns on the header-row filter dropdowns Excel draws over the range;
424
441
  * the writer emits both the sheet's `<autoFilter>` element and the hidden `_FilterDatabase` defined
425
442
  * name Excel derives from it. Setting `undefined` clears the filter.
426
443
  *
427
- * A bare range string is the ergonomic common case `sheet.autoFilter = 'A1:C10'` for dropdowns
444
+ * A bare range string is the ergonomic common case: `sheet.autoFilter = 'A1:C10'` for dropdowns
428
445
  * with no active criteria; pass an {@link AutoFilter} object to narrow columns. Either way the
429
446
  * value is normalised on assignment (range to canonical `A1:C10` form) and the getter returns the
430
- * structured object. The range must be a bounded rectangle a whole-row/column reference is not a
447
+ * structured object. The range must be a bounded rectangle: a whole-row/column reference is not a
431
448
  * filterable region and is rejected.
432
449
  */
433
450
  get autoFilter(): AutoFilter | undefined;
@@ -445,7 +462,7 @@ export declare class Worksheet {
445
462
  * the rule through {@link dataValidationAt}.
446
463
  *
447
464
  * Pass `{extended: true}` to mark a rule that belongs in the 2009 extension form
448
- * (`<x14:dataValidation>`) the carrier Excel uses for a list source on another sheet and other
465
+ * (`<x14:dataValidation>`), the carrier Excel uses for a list source on another sheet and other
449
466
  * shapes the standard element cannot express. The reader sets it for a rule found in that form so a
450
467
  * round-trip writes it back there instead of silently corrupting the cross-sheet reference.
451
468
  */
@@ -455,7 +472,7 @@ export declare class Worksheet {
455
472
  /** The data validations on this sheet, each bound to its target range, in insertion order. */
456
473
  get dataValidations(): readonly DataValidationEntry[];
457
474
  /**
458
- * Attach a conditional formatting to a target range. `formatting.ref` is an OOXML `sqref` one
475
+ * Attach a conditional formatting to a target range. `formatting.ref` is an OOXML `sqref`: one
459
476
  * range (`"A1:A10"`), a whole column, or several space-separated areas (`"A1:C1 A3:C3"`) sharing one
460
477
  * rule set. The block is stored once against the range, defensively copied so the getter never hands
461
478
  * back a reference into the caller's object.
@@ -472,8 +489,8 @@ export declare class Worksheet {
472
489
  * Remove `count` rows starting at the 1-based `start`, then insert the given rows in their place.
473
490
  * Rows below the edit shift by `inserts.length - count`: a delete pulls the tail up, an insert
474
491
  * pushes it down, and doing both at once is a replace. Each inserted row takes either
475
- * {@link RowInput} shape a positional array from column A, or a key-addressed object exactly
476
- * like {@link addRow}. A `count` larger than the rows present simply clears the tail it never
492
+ * {@link RowInput} shape, a positional array from column A or a key-addressed object, exactly
493
+ * like {@link addRow}. A `count` larger than the rows present simply clears the tail; it never
477
494
  * silently becomes a no-op. Cells carry their full style to the shifted position, and merged ranges
478
495
  * shift with the rows they cover.
479
496
  *
@@ -491,19 +508,19 @@ export declare class Worksheet {
491
508
  /**
492
509
  * Append a row of `values` after the last used row, returning the cells it materialised.
493
510
  * The append point is {@link rowCount}` + 1`, so the row lands below every row that holds
494
- * data or its own formatting never overwriting existing content, unlike {@link insertRow},
511
+ * data or its own formatting, never overwriting existing content, unlike {@link insertRow},
495
512
  * which shifts and needs a position. Unlike {@link spliceRows}, appending shifts nothing, so
496
513
  * it never disturbs merges or the rows above.
497
514
  *
498
- * A row takes either shape: a positional array whose values map to columns from A a hole in a
499
- * sparse array (`['a', , 'c']`) leaves that column untouched or a keyed object whose values
500
- * land under the columns carrying the matching {@link ColumnProperties.key}.
515
+ * A row takes either shape. A positional array maps its values to columns from A, and a hole in a
516
+ * sparse array (`['a', , 'c']`) leaves that column untouched. A keyed object lands its values
517
+ * under the columns carrying the matching {@link ColumnProperties.key}.
501
518
  */
502
519
  addRow(values: RowInput): Cell[];
503
520
  /**
504
521
  * Append several rows after the last used row in one call, returning the cells materialised
505
- * for each. The rows stack in order the first lands at {@link rowCount}` + 1`, the next
506
- * directly below it so a later row never collides with an earlier one even when both are
522
+ * for each. The rows stack in order: the first lands at {@link rowCount}` + 1`, the next
523
+ * directly below it, so a later row never collides with an earlier one even when both are
507
524
  * value-less. Each row is an array or a keyed object independently, so a mixed batch is fine.
508
525
  * The bulk form of {@link addRow}.
509
526
  */
@@ -520,8 +537,8 @@ export declare class Worksheet {
520
537
  unfreeze(): void;
521
538
  /**
522
539
  * Copy the row at the 1-based `start`, `options.count` times (default 1). With `options.insert`
523
- * (the default) the copies are inserted directly after the source, shifting the rows below and
524
- * any merged range there down by `count`; otherwise the copies overwrite the rows immediately
540
+ * (the default) the copies are inserted directly after the source, shifting the rows below, and
541
+ * any merged range there, down by `count`; otherwise the copies overwrite the rows immediately
525
542
  * below without shifting. Each copy is a faithful duplicate of the source's values and per-cell
526
543
  * styles, and carries no merge of its own, so a range can be merged onto a duplicated row afterwards.
527
544
  *
@@ -533,7 +550,7 @@ export declare class Worksheet {
533
550
  }): void;
534
551
  /**
535
552
  * Remove `count` columns starting at the 1-based `start`, then insert the given columns in their
536
- * place the column analog of {@link spliceRows}. Columns to the right shift by
553
+ * place: the column analog of {@link spliceRows}. Columns to the right shift by
537
554
  * `inserts.length - count`, keeping their values and styles, and a merged range lying wholly to
538
555
  * the right of the edit re-anchors to its new columns. Each inserted column is an array of values
539
556
  * indexed by row (index 0 → row 1); an empty array inserts a blank column.
@@ -552,7 +569,7 @@ export declare class Worksheet {
552
569
  /**
553
570
  * Append a column of `values` after the last used column, returning the cells it materialised.
554
571
  * The append point is {@link columnCount}` + 1`, so the column lands right of every column that
555
- * holds data or its own formatting never overwriting existing content, unlike {@link insertColumn},
572
+ * holds data or its own formatting, never overwriting existing content, unlike {@link insertColumn},
556
573
  * which shifts and needs a position. Unlike {@link spliceColumns}, appending shifts nothing, so it
557
574
  * never disturbs merges or the columns to its left.
558
575
  *
@@ -562,19 +579,19 @@ export declare class Worksheet {
562
579
  addColumn(values: CellValue[]): Cell[];
563
580
  /**
564
581
  * Append several columns after the last used column in one call, returning the cells materialised
565
- * for each. The columns stack in order the first lands at {@link columnCount}` + 1`, the next
566
- * directly right of it so a later column never collides with an earlier one even when both are
582
+ * for each. The columns stack in order: the first lands at {@link columnCount}` + 1`, the next
583
+ * directly right of it, so a later column never collides with an earlier one even when both are
567
584
  * value-less. The bulk form of {@link addColumn}.
568
585
  */
569
586
  addColumns(columns: CellValue[][]): Cell[][];
570
587
  /**
571
588
  * A snapshot of this sheet's value and overlay content (see {@link WorksheetModel}). Reading it and
572
- * assigning it onto another sheet `dst.model = src.model` reproduces the source: merges, cells
573
- * and their styles, column/row metadata, tables, the autofilter, protection, and the page setup all
574
- * survive, because the getter emits and the setter consumes exactly the same fields. Identity
575
- * (`name`, `id`) is not part of the model and is never touched by assignment; nor are attached parts
576
- * that carry workbook-level identity (images, pivots, byte-preserved charts/drawings) — see
577
- * {@link WorksheetModel} for that boundary.
589
+ * assigning it onto another sheet (`dst.model = src.model`) reproduces the source: merges, cells
590
+ * and their styles, column/row metadata, tables, the autofilter, protection, the frozen-pane view,
591
+ * and the page setup all survive, because the getter emits and the setter consumes exactly the same
592
+ * fields. Identity (`name`, `id`) is not part of the model and is never touched by assignment; nor
593
+ * are attached parts that carry workbook-level identity (images, pivots, threaded comments,
594
+ * byte-preserved charts/drawings). See {@link WorksheetModel} for that boundary.
578
595
  */
579
596
  get model(): WorksheetModel;
580
597
  set model(model: WorksheetModel);
@@ -593,7 +610,7 @@ export declare class Worksheet {
593
610
  /** The sheet's protection, or `undefined` if the sheet is unprotected. */
594
611
  get protection(): SheetProtection | undefined;
595
612
  /**
596
- * The codec's channel into this sheet see `core/internal.ts` for why these are not public
613
+ * The codec's channel into this sheet. See `core/internal.ts` for why these are not public
597
614
  * methods. Declared last so every private field it closes over is already in scope.
598
615
  */
599
616
  readonly [INTERNAL]: WorksheetInternals;
@@ -614,7 +631,7 @@ export interface WorksheetInternals {
614
631
  */
615
632
  evictRow(number: number): void;
616
633
  /**
617
- * Register a pivot table reconstructed from a loaded package the reader's counterpart to
634
+ * Register a pivot table reconstructed from a loaded package: the reader's counterpart to
618
635
  * {@link Worksheet.addPivotTable}. This records an inspectable, read-only view of a pivot the
619
636
  * reader parsed from its OOXML parts; the pivot itself round-trips by byte-preservation, so
620
637
  * registering it here only makes it visible via {@link Worksheet.loadedPivotTables} and never
@@ -626,7 +643,7 @@ export interface WorksheetInternals {
626
643
  * replacing any already held. Their authors and mentioned people are already resolved against the
627
644
  * workbook registry, so a thread arrives self-contained.
628
645
  *
629
- * Not authoring {@link Worksheet.addCommentThread} is that, and validates the anchor. These
646
+ * Not authoring: {@link Worksheet.addCommentThread} is that, and validates the anchor. These
630
647
  * threads are what a re-write emits, so what the reader hands over is what the file will say.
631
648
  */
632
649
  restoreCommentThreads(threads: readonly CommentThread[]): void;
@@ -637,7 +654,7 @@ export interface WorksheetInternals {
637
654
  */
638
655
  addPreservedReference(reference: PreservedWorksheetReference): void;
639
656
  /**
640
- * Reinstate an already-derived protection state the deserialization counterpart to
657
+ * Reinstate an already-derived protection state: the deserialization counterpart to
641
658
  * {@link Worksheet.protect}. A loaded `<sheetProtection>` carries its credential in finished agile
642
659
  * form (algorithm, hash, salt, spin count) with no recoverable plaintext password, so the reader
643
660
  * restores that credential verbatim rather than re-hashing.
@@ -646,7 +663,7 @@ export interface WorksheetInternals {
646
663
  /**
647
664
  * Materialise the cell at an exact 1-based position, creating it on first access. Unlike
648
665
  * {@link Worksheet.getCell} this performs no merge resolution: the cell returned is the one at
649
- * `(row, col)` even when a merged region covers it. Loading content is where that matters a
666
+ * `(row, col)` even when a merged region covers it. Loading content is where that matters: a
650
667
  * model or a parsed file states where each value sits, and routing a covered value to its region
651
668
  * master mid-load would move it.
652
669
  */