@shbernal/ts-xlsx 3.0.0 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (277) hide show
  1. package/README.md +34 -24
  2. package/dist/bytes.d.ts +10 -2
  3. package/dist/bytes.js +22 -0
  4. package/dist/core/address.d.ts +96 -2
  5. package/dist/core/address.js +87 -33
  6. package/dist/core/array-formula-ranges.d.ts +33 -0
  7. package/dist/core/array-formula-ranges.js +62 -0
  8. package/dist/core/autofilter.d.ts +4 -3
  9. package/dist/core/autofilter.js +31 -30
  10. package/dist/core/axis-handle.d.ts +2 -0
  11. package/dist/core/axis-handle.js +5 -2
  12. package/dist/core/cell.d.ts +4 -3
  13. package/dist/core/cell.js +4 -6
  14. package/dist/core/clone.d.ts +29 -0
  15. package/dist/core/clone.js +24 -0
  16. package/dist/core/color-resolution.js +4 -6
  17. package/dist/core/column.d.ts +1 -0
  18. package/dist/core/column.js +6 -2
  19. package/dist/core/comment-thread.d.ts +7 -3
  20. package/dist/core/comment-thread.js +2 -1
  21. package/dist/core/conditional-formatting-overlay.d.ts +11 -1
  22. package/dist/core/conditional-formatting-overlay.js +30 -3
  23. package/dist/core/conditional-formatting.d.ts +107 -11
  24. package/dist/core/conditional-formatting.js +76 -19
  25. package/dist/core/containers.d.ts +12 -0
  26. package/dist/core/containers.js +5 -0
  27. package/dist/core/data-validation-overlay.d.ts +7 -1
  28. package/dist/core/data-validation-overlay.js +19 -4
  29. package/dist/core/data-validation.d.ts +22 -0
  30. package/dist/core/data-validation.js +30 -4
  31. package/dist/core/date-format.d.ts +20 -0
  32. package/dist/core/date-format.js +170 -0
  33. package/dist/core/date.d.ts +43 -8
  34. package/dist/core/date.js +19 -3
  35. package/dist/core/formula-references.d.ts +26 -0
  36. package/dist/core/formula-references.js +173 -0
  37. package/dist/core/formula-scan.d.ts +2 -0
  38. package/dist/core/formula-scan.js +58 -0
  39. package/dist/core/formula.d.ts +76 -17
  40. package/dist/core/formula.js +87 -80
  41. package/dist/core/function-values.d.ts +4 -0
  42. package/dist/core/function-values.js +58 -0
  43. package/dist/core/future-functions.d.ts +3 -0
  44. package/dist/core/{modern-functions.js → future-functions.js} +119 -88
  45. package/dist/core/grid-edits.d.ts +30 -3
  46. package/dist/core/grid-edits.js +248 -81
  47. package/dist/core/grid-shift.d.ts +58 -9
  48. package/dist/core/grid-shift.js +26 -4
  49. package/dist/core/hyperlink.d.ts +39 -0
  50. package/dist/core/hyperlink.js +88 -0
  51. package/dist/core/image.d.ts +49 -14
  52. package/dist/core/image.js +16 -5
  53. package/dist/core/internal.d.ts +10 -2
  54. package/dist/core/limits.d.ts +25 -0
  55. package/dist/core/limits.js +4 -0
  56. package/dist/core/merge.d.ts +18 -4
  57. package/dist/core/merge.js +33 -20
  58. package/dist/core/page-setup.d.ts +26 -11
  59. package/dist/core/pivot-table.d.ts +49 -10
  60. package/dist/core/pivot-table.js +112 -60
  61. package/dist/core/protection.d.ts +66 -4
  62. package/dist/core/protection.js +6 -11
  63. package/dist/core/range.js +34 -30
  64. package/dist/core/row-input.js +2 -2
  65. package/dist/core/row.d.ts +1 -0
  66. package/dist/core/row.js +6 -2
  67. package/dist/core/structured-reference.d.ts +7 -0
  68. package/dist/core/structured-reference.js +7 -0
  69. package/dist/core/style.d.ts +85 -70
  70. package/dist/core/style.js +92 -28
  71. package/dist/core/table-style.d.ts +1 -1
  72. package/dist/core/table-style.js +4 -4
  73. package/dist/core/table.d.ts +64 -16
  74. package/dist/core/table.js +87 -40
  75. package/dist/core/theme.d.ts +2 -0
  76. package/dist/core/theme.js +9 -5
  77. package/dist/core/value.d.ts +60 -28
  78. package/dist/core/value.js +48 -43
  79. package/dist/core/workbook-media.d.ts +34 -0
  80. package/dist/core/workbook-media.js +44 -0
  81. package/dist/core/workbook-styles.d.ts +83 -1
  82. package/dist/core/workbook-styles.js +4 -0
  83. package/dist/core/workbook-theme.js +5 -3
  84. package/dist/core/workbook-vba.js +3 -2
  85. package/dist/core/workbook.d.ts +41 -3
  86. package/dist/core/workbook.js +46 -41
  87. package/dist/core/worksheet-comments.d.ts +2 -1
  88. package/dist/core/worksheet-comments.js +20 -13
  89. package/dist/core/worksheet-merges.d.ts +49 -0
  90. package/dist/core/worksheet-merges.js +65 -0
  91. package/dist/core/worksheet-model.d.ts +10 -2
  92. package/dist/core/worksheet-model.js +28 -9
  93. package/dist/core/worksheet-pictures.d.ts +3 -3
  94. package/dist/core/worksheet-pictures.js +7 -6
  95. package/dist/core/worksheet.d.ts +165 -27
  96. package/dist/core/worksheet.js +206 -89
  97. package/dist/customui/ribbon.js +2 -1
  98. package/dist/entries/core.d.ts +21 -14
  99. package/dist/entries/core.js +14 -7
  100. package/dist/entries/errors.d.ts +1 -0
  101. package/dist/entries/errors.js +1 -0
  102. package/dist/entries/xlsx.d.ts +1 -1
  103. package/dist/errors.d.ts +64 -0
  104. package/dist/errors.js +22 -0
  105. package/dist/hex.d.ts +8 -0
  106. package/dist/hex.js +3 -0
  107. package/dist/io/cell-metadata/metadata.d.ts +42 -0
  108. package/dist/io/cell-metadata/metadata.js +35 -0
  109. package/dist/io/cell-metadata/rich-values.d.ts +11 -0
  110. package/dist/io/cell-metadata/rich-values.js +80 -0
  111. package/dist/io/csv/delimiter.d.ts +21 -0
  112. package/dist/io/csv/delimiter.js +18 -0
  113. package/dist/io/csv/errors.d.ts +14 -0
  114. package/dist/io/csv/errors.js +5 -0
  115. package/dist/io/csv/read.d.ts +6 -1
  116. package/dist/io/csv/read.js +51 -22
  117. package/dist/io/csv/write.d.ts +19 -5
  118. package/dist/io/csv/write.js +24 -44
  119. package/dist/io/opc/inflate.js +14 -0
  120. package/dist/io/opc/namespaces.d.ts +16 -0
  121. package/dist/io/opc/namespaces.js +4 -0
  122. package/dist/io/opc/part-paths.d.ts +9 -0
  123. package/dist/io/opc/part-paths.js +5 -5
  124. package/dist/io/opc/read-opc.d.ts +58 -14
  125. package/dist/io/opc/read-opc.js +49 -21
  126. package/dist/io/opc/read-options.d.ts +5 -1
  127. package/dist/io/opc/sniff-format.d.ts +3 -3
  128. package/dist/io/opc/sniff-format.js +2 -2
  129. package/dist/io/opc/strict-relationships.d.ts +2 -0
  130. package/dist/io/opc/strict-relationships.js +12 -0
  131. package/dist/io/read-policy/column-budget.d.ts +26 -0
  132. package/dist/io/read-policy/column-budget.js +18 -0
  133. package/dist/io/read-policy/read-repair.d.ts +74 -0
  134. package/dist/io/read-policy/read-repair.js +119 -0
  135. package/dist/io/style/cell-style-resolution.d.ts +25 -0
  136. package/dist/io/style/cell-style-resolution.js +30 -0
  137. package/dist/io/style/xf-style.d.ts +23 -1
  138. package/dist/io/style/xf-style.js +8 -0
  139. package/dist/io/xlsb/formula.d.ts +2 -2
  140. package/dist/io/xlsb/formula.js +52 -35
  141. package/dist/io/xlsb/primitives.js +8 -14
  142. package/dist/io/xlsb/ptg-functions.d.ts +19 -10
  143. package/dist/io/xlsb/ptg-functions.js +495 -596
  144. package/dist/io/xlsb/read-metadata.d.ts +7 -0
  145. package/dist/io/xlsb/read-metadata.js +69 -0
  146. package/dist/io/xlsb/read-styles.js +45 -81
  147. package/dist/io/xlsb/read-worksheet.d.ts +26 -1
  148. package/dist/io/xlsb/read-worksheet.js +148 -106
  149. package/dist/io/xlsb/read.d.ts +6 -3
  150. package/dist/io/xlsb/read.js +70 -31
  151. package/dist/io/xlsb/record-stream.d.ts +30 -0
  152. package/dist/io/xlsb/record-stream.js +20 -0
  153. package/dist/io/xlsb/record-types.d.ts +14 -5
  154. package/dist/io/xlsb/record-types.js +14 -5
  155. package/dist/io/xlsb/sheet-protection.d.ts +20 -0
  156. package/dist/io/xlsb/sheet-protection.js +60 -0
  157. package/dist/io/xlsx/cell-accumulator.d.ts +24 -9
  158. package/dist/io/xlsx/cell-accumulator.js +74 -21
  159. package/dist/io/xlsx/cell-metadata.d.ts +39 -0
  160. package/dist/io/xlsx/cell-metadata.js +162 -0
  161. package/dist/io/xlsx/cell-value.d.ts +19 -5
  162. package/dist/io/xlsx/cell-value.js +45 -30
  163. package/dist/io/xlsx/color-xml.js +3 -2
  164. package/dist/io/xlsx/column-span.d.ts +11 -0
  165. package/dist/io/xlsx/column-span.js +9 -0
  166. package/dist/io/xlsx/comments.d.ts +9 -30
  167. package/dist/io/xlsx/comments.js +25 -83
  168. package/dist/io/xlsx/conditional-formatting.d.ts +43 -23
  169. package/dist/io/xlsx/conditional-formatting.js +437 -138
  170. package/dist/io/xlsx/data-validation.d.ts +12 -7
  171. package/dist/io/xlsx/data-validation.js +67 -53
  172. package/dist/io/xlsx/edit-vba.d.ts +7 -2
  173. package/dist/io/xlsx/edit-vba.js +52 -52
  174. package/dist/io/xlsx/font-xml.d.ts +7 -0
  175. package/dist/io/xlsx/font-xml.js +104 -0
  176. package/dist/io/xlsx/hyperlinks.d.ts +19 -21
  177. package/dist/io/xlsx/hyperlinks.js +12 -32
  178. package/dist/io/xlsx/images.d.ts +49 -16
  179. package/dist/io/xlsx/images.js +149 -50
  180. package/dist/io/xlsx/namespaces.d.ts +24 -0
  181. package/dist/io/xlsx/namespaces.js +11 -0
  182. package/dist/io/xlsx/package-plan.d.ts +60 -15
  183. package/dist/io/xlsx/package-plan.js +83 -18
  184. package/dist/io/xlsx/part-names.d.ts +6 -8
  185. package/dist/io/xlsx/part-names.js +3 -7
  186. package/dist/io/xlsx/pivot.d.ts +5 -5
  187. package/dist/io/xlsx/pivot.js +26 -24
  188. package/dist/io/xlsx/preserved-splices.d.ts +6 -0
  189. package/dist/io/xlsx/preserved-splices.js +74 -0
  190. package/dist/io/xlsx/read-comments.d.ts +29 -0
  191. package/dist/io/xlsx/read-comments.js +75 -0
  192. package/dist/io/xlsx/read-parts.d.ts +59 -0
  193. package/dist/io/xlsx/read-parts.js +259 -0
  194. package/dist/io/xlsx/read-pivot.js +11 -4
  195. package/dist/io/xlsx/{rich-runs.d.ts → read-rich-runs.d.ts} +8 -5
  196. package/dist/io/xlsx/{rich-runs.js → read-rich-runs.js} +24 -4
  197. package/dist/io/xlsx/read-rows.d.ts +35 -11
  198. package/dist/io/xlsx/read-rows.js +73 -49
  199. package/dist/io/xlsx/read-shared-strings.js +3 -2
  200. package/dist/io/xlsx/read-styles.d.ts +0 -30
  201. package/dist/io/xlsx/read-styles.js +45 -105
  202. package/dist/io/xlsx/read-workbook-xml.d.ts +42 -0
  203. package/dist/io/xlsx/read-workbook-xml.js +175 -0
  204. package/dist/io/xlsx/read-worksheet.d.ts +9 -3
  205. package/dist/io/xlsx/read-worksheet.js +70 -177
  206. package/dist/io/xlsx/read.d.ts +3 -14
  207. package/dist/io/xlsx/read.js +74 -411
  208. package/dist/io/xlsx/relationships.d.ts +3 -0
  209. package/dist/io/xlsx/relationships.js +4 -0
  210. package/dist/io/xlsx/rich-text.js +1 -1
  211. package/dist/io/xlsx/row-position.d.ts +20 -0
  212. package/dist/io/xlsx/row-position.js +11 -0
  213. package/dist/io/xlsx/row-xml.d.ts +139 -0
  214. package/dist/io/xlsx/row-xml.js +222 -0
  215. package/dist/io/xlsx/shared-formulas.js +2 -2
  216. package/dist/io/xlsx/sheet-properties.d.ts +10 -1
  217. package/dist/io/xlsx/sheet-properties.js +182 -20
  218. package/dist/io/xlsx/strict-parts.d.ts +7 -0
  219. package/dist/io/xlsx/strict-parts.js +171 -0
  220. package/dist/io/xlsx/style-elements.d.ts +41 -0
  221. package/dist/io/xlsx/style-elements.js +136 -0
  222. package/dist/io/xlsx/styles.d.ts +17 -3
  223. package/dist/io/xlsx/styles.js +13 -209
  224. package/dist/io/xlsx/tables.d.ts +10 -2
  225. package/dist/io/xlsx/tables.js +55 -52
  226. package/dist/io/xlsx/theme-xml.d.ts +32 -4
  227. package/dist/io/xlsx/theme-xml.js +106 -71
  228. package/dist/io/xlsx/threaded-comments.d.ts +14 -11
  229. package/dist/io/xlsx/threaded-comments.js +16 -8
  230. package/dist/io/xlsx/workbook-xml.d.ts +45 -6
  231. package/dist/io/xlsx/workbook-xml.js +62 -54
  232. package/dist/io/xlsx/worksheet-xml.d.ts +26 -70
  233. package/dist/io/xlsx/worksheet-xml.js +69 -282
  234. package/dist/io/xlsx/write-stream.d.ts +90 -19
  235. package/dist/io/xlsx/write-stream.js +80 -25
  236. package/dist/io/xlsx/write.d.ts +12 -6
  237. package/dist/io/xlsx/write.js +226 -123
  238. package/dist/rel-type.d.ts +25 -0
  239. package/dist/rel-type.js +9 -0
  240. package/dist/token-set.d.ts +13 -0
  241. package/dist/token-set.js +4 -1
  242. package/dist/vba/bytes.d.ts +16 -5
  243. package/dist/vba/bytes.js +27 -6
  244. package/dist/vba/cfb-format.d.ts +55 -0
  245. package/dist/vba/cfb-format.js +35 -0
  246. package/dist/vba/cfb-writer.d.ts +8 -0
  247. package/dist/vba/cfb-writer.js +40 -40
  248. package/dist/vba/cfb.d.ts +21 -4
  249. package/dist/vba/cfb.js +124 -90
  250. package/dist/vba/codepage.js +2 -1
  251. package/dist/vba/dir-records.d.ts +6 -0
  252. package/dist/vba/dir-records.js +10 -2
  253. package/dist/vba/errors.d.ts +11 -4
  254. package/dist/vba/index.d.ts +0 -2
  255. package/dist/vba/index.js +0 -2
  256. package/dist/vba/ms-ovba.d.ts +6 -2
  257. package/dist/vba/ms-ovba.js +66 -22
  258. package/dist/vba/project-editor.js +129 -119
  259. package/dist/vba/project.d.ts +15 -1
  260. package/dist/vba/project.js +38 -13
  261. package/dist/vba/vba-encoding.d.ts +4 -10
  262. package/dist/vba/vba-encoding.js +3 -17
  263. package/dist/xml/xml-attrs.d.ts +37 -0
  264. package/dist/xml/xml-attrs.js +30 -0
  265. package/dist/xml/xml-chars.d.ts +40 -0
  266. package/dist/xml/xml-chars.js +12 -0
  267. package/dist/xml/xml-namespaces.d.ts +31 -0
  268. package/dist/xml/xml-namespaces.js +50 -0
  269. package/dist/xml/xml-read.d.ts +101 -11
  270. package/dist/xml/xml-read.js +150 -18
  271. package/dist/xml/xml-scan.d.ts +25 -34
  272. package/dist/xml/xml-scan.js +69 -46
  273. package/dist/xml/xml.d.ts +59 -26
  274. package/dist/xml/xml.js +45 -23
  275. package/package.json +15 -9
  276. package/skills/ts-xlsx-upstream/SKILL.md +21 -13
  277. package/dist/core/modern-functions.d.ts +0 -1
@@ -1,14 +1,16 @@
1
1
  import { AuthoringError } from '../errors.js';
2
2
  import { tokenSet } from '../token-set.js';
3
- import { decodeCellRef, decodeRange, encodeAddress, tryDecodeCellRef } from './address.js';
3
+ import { assertAxisInBounds, boundedRect, decodeCellRef, encodeAddress, encodeRange, MAX_ROW, tryDecodeAnchoredRange, tryDecodeCellRef, tryDecodeRange, } from './address.js';
4
+ import { arrayRangeConflicts, formulaPlacement, } from './array-formula-ranges.js';
4
5
  import { canonicalizeAutoFilter } from './autofilter.js';
5
6
  import { applyCellStyle, Cell, copyCellContent } from './cell.js';
6
7
  import { Column } from './column.js';
7
8
  import { ConditionalFormattingOverlay } from './conditional-formatting-overlay.js';
8
9
  import { DataValidationOverlay } from './data-validation-overlay.js';
10
+ import { translateFormula } from './formula-references.js';
9
11
  import { GridEdits } from './grid-edits.js';
12
+ import { HyperlinkOverlay } from './hyperlink.js';
10
13
  import { INTERNAL } from './internal.js';
11
- import { MergeIndex } from './merge-index.js';
12
14
  import { clearCoveredValues } from './merge.js';
13
15
  import { PivotTable } from './pivot-table.js';
14
16
  import { deriveCredential, } from './protection.js';
@@ -17,7 +19,9 @@ import { buildRowCells, positionalPlacements, rowPlacements } from './row-input.
17
19
  import { Row } from './row.js';
18
20
  import { Table } from './table.js';
19
21
  import { UsedExtent } from './used-extent.js';
22
+ import { isArrayFormulaValue, isFormulaValue, isSharedFormulaValue, } from './value.js';
20
23
  import { WorksheetComments } from './worksheet-comments.js';
24
+ import { WorksheetMerges } from './worksheet-merges.js';
21
25
  import { WORKSHEET_MODEL_FACETS } from './worksheet-model.js';
22
26
  import { WorksheetPictures } from './worksheet-pictures.js';
23
27
  export const isVisibility = tokenSet({ visible: true, hidden: true, veryHidden: true });
@@ -26,6 +30,7 @@ export class Worksheet {
26
30
  id;
27
31
  state;
28
32
  tabColor;
33
+ codeName;
29
34
  properties = {};
30
35
  outline = {};
31
36
  view = {};
@@ -42,42 +47,47 @@ export class Worksheet {
42
47
  #pivotTables = [];
43
48
  #loadedPivotTables = [];
44
49
  #comments = new WorksheetComments(() => this.name);
45
- #merges = [];
50
+ #merges = new WorksheetMerges();
46
51
  #images = new WorksheetPictures({
47
52
  columnWidth: (col) => this.#columns.get(col + 1)?.width ?? this.properties.defaultColWidth,
48
53
  rowHeight: (row) => this.#rowProperties.get(row + 1)?.height ?? this.properties.defaultRowHeight,
49
54
  });
50
55
  #preservedReferences = [];
51
- #mergeRects = [];
52
56
  #dataValidations = new DataValidationOverlay();
53
57
  #conditionalFormattings = new ConditionalFormattingOverlay();
58
+ #hyperlinks = new HyperlinkOverlay();
54
59
  #protection;
60
+ #formulaHost;
55
61
  #autoFilter;
56
62
  #edits;
57
63
  #extent;
58
- #mergeIndex;
59
64
  constructor(name, id, state = 'visible') {
60
65
  this.name = name;
61
66
  this.id = id;
62
67
  this.state = state;
63
- this.#mergeIndex = new MergeIndex(this.#mergeRects);
64
68
  this.#extent = new UsedExtent({
65
69
  rows: this.#rows,
66
70
  rowProperties: this.#rowProperties,
67
71
  columns: this.#columns,
68
- mergeRects: this.#mergeRects,
72
+ mergeRects: this.#merges.rects,
69
73
  });
70
74
  this.#edits = new GridEdits({
71
75
  rows: this.#rows,
72
76
  rowProperties: this.#rowProperties,
73
77
  columns: this.#columns,
74
78
  merges: this.#merges,
75
- mergeRects: this.#mergeRects,
76
79
  tables: this.#tables,
80
+ pivotTables: this.#pivotTables,
81
+ loadedPivotTables: this.#loadedPivotTables,
77
82
  images: this.#images.anchors,
78
83
  dataValidations: this.#dataValidations,
79
84
  conditionalFormattings: this.#conditionalFormattings,
85
+ hyperlinks: this.#hyperlinks,
80
86
  comments: this.#comments,
87
+ rowBreaks: this.rowBreaks,
88
+ columnBreaks: this.columnBreaks,
89
+ sheetName: () => this.name,
90
+ formulaHost: () => this.#formulaHost,
81
91
  autoFilter: {
82
92
  get: () => this.#autoFilter,
83
93
  set: (next) => {
@@ -88,8 +98,7 @@ export class Worksheet {
88
98
  }
89
99
  getCell(reference) {
90
100
  const { col, row } = decodeCellRef(reference);
91
- const master = this.#mergeIndex.masterOf(row, col);
92
- return this.#cellAt(master.row, master.col);
101
+ return this[INTERNAL].masterAt(row, col);
93
102
  }
94
103
  hasCell(row, col) {
95
104
  return this.#rows.get(row)?.has(col) ?? false;
@@ -103,7 +112,11 @@ export class Worksheet {
103
112
  getRange(referenceOrTop, left, bottom, right) {
104
113
  if (typeof referenceOrTop === 'string')
105
114
  return rangeFrom(this, referenceOrTop);
106
- return new Range(this, referenceOrTop, left ?? 0, bottom ?? 0, right ?? 0);
115
+ const corners = [left, bottom, right].filter((corner) => corner !== undefined).length + 1;
116
+ if (left === undefined || bottom === undefined || right === undefined) {
117
+ throw new AuthoringError(`getRange(top, left, bottom, right) needs all four corners; got ${corners}`);
118
+ }
119
+ return new Range(this, referenceOrTop, left, bottom, right);
107
120
  }
108
121
  get rowCount() {
109
122
  return this.#extent.lastRow;
@@ -146,7 +159,7 @@ export class Worksheet {
146
159
  }
147
160
  addTable(options) {
148
161
  const table = new Table(options, {
149
- holdsValue: (row, col) => this.hasCell(row, col) && this.#cellAt(row, col).value != null,
162
+ holdsValue: (row, col) => this.#rows.get(row)?.get(col)?.value != null,
150
163
  writeCell: (row, col, value, style) => {
151
164
  const cell = this.#cellAt(row, col);
152
165
  cell.value = value;
@@ -184,11 +197,11 @@ export class Worksheet {
184
197
  commentThreadAt(reference) {
185
198
  return this.#comments.at(reference);
186
199
  }
187
- addImage(imageId, anchor) {
188
- this.#images.add(imageId, anchor);
200
+ addImage(imageId, anchor, properties) {
201
+ this.#images.add(imageId, anchor, properties);
189
202
  }
190
- addImageAnchor(imageId, anchor) {
191
- this.#images.addAnchor(imageId, anchor);
203
+ addImageAnchor(imageId, anchor, properties) {
204
+ this.#images.addAnchor(imageId, anchor, properties);
192
205
  }
193
206
  removeImage(imageId) {
194
207
  this.#images.remove(imageId);
@@ -209,21 +222,14 @@ export class Worksheet {
209
222
  return this.#preservedReferences;
210
223
  }
211
224
  mergeCells(range) {
212
- const { top, left, bottom, right } = decodeRange(range);
213
- if (top !== undefined && left !== undefined && bottom !== undefined && right !== undefined) {
214
- const rect = { top, left, bottom, right };
215
- if (this.#mergeIndex.overlapping(rect) !== undefined) {
216
- throw new AuthoringError(`merged range "${range}" overlaps an existing merged region`);
217
- }
218
- this.#mergeRects.push(rect);
219
- this.#mergeIndex.note(rect);
225
+ const rect = this.#merges.add(range);
226
+ if (rect !== undefined) {
220
227
  this.#extent.noteMerge(rect);
221
228
  clearCoveredValues(this.#rows, rect);
222
229
  }
223
- this.#merges.push(range);
224
230
  }
225
231
  get merges() {
226
- return this.#merges;
232
+ return this.#merges.ranges;
227
233
  }
228
234
  get autoFilter() {
229
235
  return this.#autoFilter;
@@ -232,20 +238,10 @@ export class Worksheet {
232
238
  this.#autoFilter = filter === undefined ? undefined : canonicalizeAutoFilter(filter);
233
239
  }
234
240
  unmergeCells(range) {
235
- const index = this.#merges.indexOf(range);
236
- if (index === -1)
237
- return false;
238
- this.#merges.splice(index, 1);
239
- const { top, left, bottom, right } = decodeRange(range);
240
- if (top !== undefined && left !== undefined && bottom !== undefined && right !== undefined) {
241
- const rectIndex = this.#mergeRects.findIndex((r) => r.top === top && r.left === left && r.bottom === bottom && r.right === right);
242
- if (rectIndex !== -1) {
243
- this.#mergeRects.splice(rectIndex, 1);
244
- this.#mergeIndex.invalidate();
245
- this.#extent.invalidate();
246
- }
247
- }
248
- return true;
241
+ const { existed, rectsChanged } = this.#merges.remove(range);
242
+ if (rectsChanged)
243
+ this.#extent.invalidate();
244
+ return existed;
249
245
  }
250
246
  addDataValidation(sqref, rule, options = {}) {
251
247
  this.#dataValidations.add(sqref, rule, options);
@@ -263,12 +259,26 @@ export class Worksheet {
263
259
  const cell = tryDecodeCellRef(reference);
264
260
  return cell === undefined ? undefined : this.#dataValidations.at(cell.col, cell.row);
265
261
  }
262
+ addHyperlink(link) {
263
+ this.#hyperlinks.add(link);
264
+ }
265
+ removeHyperlink(ref) {
266
+ return this.#hyperlinks.remove(ref);
267
+ }
268
+ get hyperlinks() {
269
+ return this.#hyperlinks.entries;
270
+ }
271
+ hyperlinkAt(reference) {
272
+ const cell = tryDecodeCellRef(reference);
273
+ return cell === undefined ? undefined : this.#hyperlinks.at(cell.col, cell.row);
274
+ }
266
275
  spliceRows(start, count, ...inserts) {
267
276
  assertStartAndCount('splice', 'row', start, count);
277
+ assertSpliceFits('row', start, inserts.length);
278
+ this.#assertArraysSurvive('row', start, count, inserts.length);
268
279
  const inserted = inserts.map((values, i) => buildRowCells(start + i, values, this.#columns));
269
280
  this.#edits.spliceRows(start, count, inserted);
270
- this.#mergeIndex.invalidate();
271
- this.#extent.invalidate();
281
+ this.#afterStructuralEdit();
272
282
  }
273
283
  insertRow(pos, values) {
274
284
  this.spliceRows(pos, 0, values);
@@ -277,15 +287,21 @@ export class Worksheet {
277
287
  return this.addRows([values])[0] ?? [];
278
288
  }
279
289
  addRows(rows) {
280
- let number = this.rowCount;
281
- return rows.map((values) => {
282
- number += 1;
283
- return rowPlacements(values, this.#columns).map(([col, value]) => {
284
- const cell = this.#cellAt(number, col);
285
- cell.value = value;
286
- return cell;
287
- });
290
+ const first = this.rowCount + 1;
291
+ const planned = rows.map((values, i) => {
292
+ const row = first + i;
293
+ const placements = rowPlacements(values, this.#columns);
294
+ for (const [col] of placements) {
295
+ assertAxisInBounds('row', row);
296
+ assertAxisInBounds('column', col);
297
+ }
298
+ return { row, placements };
288
299
  });
300
+ return planned.map(({ row, placements }) => placements.map(([col, value]) => {
301
+ const cell = this.#cellAt(row, col);
302
+ cell.value = value;
303
+ return cell;
304
+ }));
289
305
  }
290
306
  freeze(ySplit = 1, xSplit = 0) {
291
307
  if (!Number.isInteger(ySplit) || ySplit < 0 || !Number.isInteger(xSplit) || xSplit < 0) {
@@ -295,10 +311,11 @@ export class Worksheet {
295
311
  this.unfreeze();
296
312
  return;
297
313
  }
314
+ const topLeftCell = encodeAddress(xSplit + 1, ySplit + 1);
298
315
  this.view.state = 'frozen';
299
316
  this.view.xSplit = xSplit;
300
317
  this.view.ySplit = ySplit;
301
- this.view.topLeftCell = encodeAddress(xSplit + 1, ySplit + 1);
318
+ this.view.topLeftCell = topLeftCell;
302
319
  }
303
320
  unfreeze() {
304
321
  this.view.state = 'normal';
@@ -309,16 +326,19 @@ export class Worksheet {
309
326
  duplicateRow(start, options = {}) {
310
327
  const { count = 1, insert = true } = options;
311
328
  assertStartAndCount('duplicate', 'row', start, count);
312
- const source = this.#rows.get(start);
329
+ assertSpliceFits('row', start + 1, count);
330
+ if (insert)
331
+ this.#assertArraysSurvive('row', start + 1, 0, count);
332
+ else
333
+ this.#assertArraysSurvive('row', start + 1, count, count);
313
334
  const sourceProperties = this.#rowProperties.get(start);
314
335
  const snapshot = (destRow) => {
315
336
  const row = new Map();
316
- if (source) {
317
- for (const [col, cell] of source) {
318
- const copy = new Cell(destRow, col);
319
- copyCellContent(cell, copy);
320
- row.set(col, copy);
321
- }
337
+ for (const [col, cell] of this.#rows.get(start) ?? []) {
338
+ const copy = new Cell(destRow, col);
339
+ copyCellContent(cell, copy);
340
+ copy.value = filledDown(cell.value, destRow - start);
341
+ row.set(col, copy);
322
342
  }
323
343
  return row;
324
344
  };
@@ -329,23 +349,23 @@ export class Worksheet {
329
349
  this.#rowProperties.set(destRow, { ...sourceProperties });
330
350
  };
331
351
  if (insert) {
332
- const copies = Array.from({ length: count }, () => snapshot(start));
333
- this.#edits.spliceRows(start + 1, 0, copies);
334
- this.#mergeIndex.invalidate();
335
- }
336
- else {
337
- for (let i = 1; i <= count; i++)
338
- this.#rows.set(start + i, snapshot(start + i));
352
+ const blanks = Array.from({ length: count }, () => new Map());
353
+ this.#edits.spliceRows(start + 1, 0, blanks);
339
354
  }
355
+ for (let i = 1; i <= count; i++)
356
+ this.#rows.set(start + i, snapshot(start + i));
340
357
  for (let i = 1; i <= count; i++)
341
358
  copyProperties(start + i);
342
- this.#extent.invalidate();
359
+ for (let i = 1; i <= count; i++)
360
+ this.#hyperlinks.copyRow(start, start + i);
361
+ this.#afterStructuralEdit();
343
362
  }
344
363
  spliceColumns(start, count, ...inserts) {
345
364
  assertStartAndCount('splice', 'column', start, count);
365
+ assertSpliceFits('column', start, inserts.length);
366
+ this.#assertArraysSurvive('column', start, count, inserts.length);
346
367
  this.#edits.spliceColumns(start, count, inserts);
347
- this.#mergeIndex.invalidate();
348
- this.#extent.invalidate();
368
+ this.#afterStructuralEdit();
349
369
  }
350
370
  insertColumn(pos, values) {
351
371
  this.spliceColumns(pos, 0, values);
@@ -354,15 +374,21 @@ export class Worksheet {
354
374
  return this.addColumns([values])[0] ?? [];
355
375
  }
356
376
  addColumns(columns) {
357
- let index = this.columnCount;
358
- return columns.map((values) => {
359
- index += 1;
360
- return positionalPlacements(values).map(([row, value]) => {
361
- const cell = this.#cellAt(row, index);
362
- cell.value = value;
363
- return cell;
364
- });
377
+ const first = this.columnCount + 1;
378
+ const planned = columns.map((values, i) => {
379
+ const col = first + i;
380
+ const placements = positionalPlacements(values);
381
+ for (const [row] of placements) {
382
+ assertAxisInBounds('column', col);
383
+ assertAxisInBounds('row', row);
384
+ }
385
+ return { col, placements };
365
386
  });
387
+ return planned.map(({ col, placements }) => placements.map(([row, value]) => {
388
+ const cell = this.#cellAt(row, col);
389
+ cell.value = value;
390
+ return cell;
391
+ }));
366
392
  }
367
393
  get model() {
368
394
  const model = {};
@@ -370,19 +396,71 @@ export class Worksheet {
370
396
  model[facet.key] = facet.read(this);
371
397
  return model;
372
398
  }
399
+ #afterStructuralEdit() {
400
+ this.#extent.invalidate();
401
+ this.#blockObstructedSpills();
402
+ }
403
+ #blockObstructedSpills() {
404
+ const cells = [...this.#rows.values()].flatMap((cols) => [...cols.values()]);
405
+ if (!cells.some(({ value }) => isArrayFormulaValue(value) && value.dynamic === true))
406
+ return;
407
+ const placements = [];
408
+ for (const cell of cells) {
409
+ if (typeof cell.value !== 'object' || cell.value === null)
410
+ continue;
411
+ const placement = formulaPlacement(cell.address, cell.col, cell.row, cell.value);
412
+ if (placement !== undefined)
413
+ placements.push(placement);
414
+ }
415
+ for (const { array } of arrayRangeConflicts(placements)) {
416
+ const cell = this.#rows.get(array.row)?.get(array.col);
417
+ if (cell === undefined)
418
+ continue;
419
+ const value = cell.value;
420
+ if (!isArrayFormulaValue(value) || value.dynamic !== true)
421
+ continue;
422
+ cell.value = { ...value, ref: cell.address, result: { error: '#SPILL!' } };
423
+ }
424
+ }
425
+ #assertArraysSurvive(axis, start, count, insertCount) {
426
+ if (count === 0 && insertCount === 0)
427
+ return;
428
+ const end = start + count - 1;
429
+ for (const cols of this.#rows.values()) {
430
+ for (const cell of cols.values()) {
431
+ const value = cell.value;
432
+ if (!isArrayFormulaValue(value) || value.dynamic === true)
433
+ continue;
434
+ const range = tryDecodeAnchoredRange(value.ref, cell.col, cell.row);
435
+ if (range === undefined)
436
+ continue;
437
+ const lo = axis === 'row' ? range.top : range.left;
438
+ const hi = axis === 'row' ? range.bottom : range.right;
439
+ const cuts = count > 0
440
+ ? start <= hi && end >= lo && !(start <= lo && end >= hi)
441
+ : lo < start && start <= hi;
442
+ if (cuts) {
443
+ const verb = count > 0 ? 'deleting' : 'inserting';
444
+ throw new AuthoringError(`${verb} at ${axis} ${start} would cut through the array formula in ${cell.address}, which fills ${value.ref}: Excel refuses to change part of an array, so move or delete the whole range`);
445
+ }
446
+ }
447
+ }
448
+ }
373
449
  #resetContent() {
374
450
  this.#rows.clear();
375
451
  this.#columns.clear();
376
452
  this.#rowProperties.clear();
377
- this.#merges.length = 0;
378
- this.#mergeRects.length = 0;
453
+ this.#merges.clear();
379
454
  this.#dataValidations.clear();
380
455
  this.#conditionalFormattings.clear();
456
+ this.#hyperlinks.clear();
381
457
  this.#tables.length = 0;
382
- this.#mergeIndex.invalidate();
383
458
  this.#extent.reset();
384
459
  }
385
460
  set model(model) {
461
+ const rehearsal = new Worksheet(this.name, this.id);
462
+ for (const facet of WORKSHEET_MODEL_FACETS)
463
+ facet.write(rehearsal, model);
386
464
  this.#resetContent();
387
465
  for (const facet of WORKSHEET_MODEL_FACETS)
388
466
  facet.write(this, model);
@@ -404,15 +482,14 @@ export class Worksheet {
404
482
  return this.#protection;
405
483
  }
406
484
  #cellAt(row, col) {
407
- let cols = this.#rows.get(row);
408
- if (cols === undefined) {
409
- cols = new Map();
410
- this.#rows.set(row, cols);
411
- }
412
- let cell = cols.get(col);
485
+ const cols = this.#rows.get(row);
486
+ let cell = cols?.get(col);
413
487
  if (cell === undefined) {
414
488
  cell = new Cell(row, col);
415
- cols.set(col, cell);
489
+ if (cols === undefined)
490
+ this.#rows.set(row, new Map([[col, cell]]));
491
+ else
492
+ cols.set(col, cell);
416
493
  }
417
494
  this.#extent.noteCell(row, col);
418
495
  return cell;
@@ -432,10 +509,21 @@ export class Worksheet {
432
509
  addPreservedReference: (reference) => {
433
510
  this.#preservedReferences.push(reference);
434
511
  },
512
+ setFormulaHost: (host) => {
513
+ this.#formulaHost = host;
514
+ },
515
+ spliceFormulas: (edit) => {
516
+ this.#edits.spliceFormulas(edit);
517
+ },
435
518
  restoreProtection: (protection) => {
436
519
  this.#protection = protection;
437
520
  },
438
521
  cellAt: (row, col) => this.#cellAt(row, col),
522
+ masterAt: (row, col) => {
523
+ const master = this.#merges.masterOf(row, col);
524
+ return this.#cellAt(master.row, master.col);
525
+ },
526
+ peekCell: (row, col) => this.#rows.get(row)?.get(col),
439
527
  rowPropertiesOf: (number) => this.#rowProperties.get(number),
440
528
  ensureRowProperties: (number) => {
441
529
  let properties = this.#rowProperties.get(number);
@@ -446,6 +534,10 @@ export class Worksheet {
446
534
  this.#extent.noteDeclaredRow(number);
447
535
  return properties;
448
536
  },
537
+ dropRowProperties: (number) => {
538
+ if (this.#rowProperties.delete(number))
539
+ this.#extent.invalidate();
540
+ },
449
541
  rowCells: (number) => {
450
542
  const cols = this.#rows.get(number);
451
543
  return cols ? [...cols].sort(([a], [b]) => a - b).map(([, cell]) => cell) : [];
@@ -460,6 +552,10 @@ export class Worksheet {
460
552
  this.#extent.noteDeclaredColumn(index);
461
553
  return properties;
462
554
  },
555
+ dropColumnProperties: (index) => {
556
+ if (this.#columns.delete(index))
557
+ this.#extent.invalidate();
558
+ },
463
559
  columnCells: (index) => {
464
560
  const cells = [];
465
561
  for (const number of [...this.#rows.keys()].sort((a, b) => a - b)) {
@@ -471,11 +567,32 @@ export class Worksheet {
471
567
  },
472
568
  };
473
569
  }
570
+ function filledDown(value, offset) {
571
+ if (isFormulaValue(value))
572
+ return { formula: translateFormula(value.formula, 0, offset) };
573
+ if (isArrayFormulaValue(value)) {
574
+ const formula = translateFormula(value.formula, 0, offset);
575
+ const decoded = tryDecodeRange(value.ref);
576
+ const range = decoded === undefined ? undefined : boundedRect(decoded);
577
+ if (range === undefined || range.bottom + offset > MAX_ROW)
578
+ return { formula };
579
+ const ref = encodeRange({ ...range, top: range.top + offset, bottom: range.bottom + offset });
580
+ return { shareType: 'array', formula, ref, ...(value.dynamic === true ? { dynamic: true } : {}) };
581
+ }
582
+ if (isSharedFormulaValue(value)) {
583
+ return value.formula === undefined
584
+ ? { sharedFormula: value.sharedFormula }
585
+ : { sharedFormula: value.sharedFormula, formula: translateFormula(value.formula, 0, offset) };
586
+ }
587
+ return value;
588
+ }
474
589
  function assertStartAndCount(verb, axis, start, count) {
475
- if (!Number.isInteger(start) || start < 1) {
476
- throw new RangeError(`${verb} start ${start} is out of bounds: ${axis}s start at 1`);
477
- }
590
+ assertAxisInBounds(axis, start);
478
591
  if (!Number.isInteger(count) || count < 0) {
479
592
  throw new RangeError(`${verb} count ${count} is invalid: it must be a non-negative integer`);
480
593
  }
481
594
  }
595
+ function assertSpliceFits(axis, start, insertCount) {
596
+ if (insertCount > 0)
597
+ assertAxisInBounds(axis, start + insertCount - 1);
598
+ }
@@ -1,4 +1,5 @@
1
1
  import { strFromU8 } from 'fflate';
2
+ import { isRelType } from '../rel-type.js';
2
3
  import { tokenSet } from '../token-set.js';
3
4
  import { boolStrict, localName, xmlEvents } from '../xml/xml-scan.js';
4
5
  import { CustomUiParseError } from './errors.js';
@@ -7,7 +8,7 @@ export const CUSTOMUI_2009_NAMESPACE = 'http://schemas.microsoft.com/office/2009
7
8
  export const CUSTOMUI_2007_REL_TYPE = 'http://schemas.microsoft.com/office/2006/relationships/ui/extensibility';
8
9
  export const CUSTOMUI_2010_REL_TYPE = 'http://schemas.microsoft.com/office/2007/relationships/ui/extensibility';
9
10
  export function isCustomUiRelType(type) {
10
- return type.endsWith('/ui/extensibility');
11
+ return isRelType(type, 'ui/extensibility');
11
12
  }
12
13
  const MAX_DEPTH = 256;
13
14
  const isKnownControlKind = tokenSet({
@@ -1,25 +1,32 @@
1
- export { type CellAddress, columnToNumber, decodeAddress, decodeRange, encodeAddress, type GridRect, MAX_COLUMN, MAX_ROW, numberToColumn, type RangeAddress, } from '../core/address.ts';
2
- export type { AutoFilter, CustomFilter, CustomFilterOperator, CustomFilterPredicate, FilterColumn, FilterCriteria, ValuesFilter, } from '../core/autofilter.ts';
1
+ export { type CellAddress, type CellPosition, columnToNumber, decodeAddress, decodeRange, encodeAddress, type GridRect, MAX_COLUMN, MAX_ROW, numberToColumn, type RangeAddress, } from '../core/address.ts';
2
+ export { type AutoFilter, type CustomFilter, type CustomFilterOperator, type CustomFilterPredicate, type FilterColumn, type FilterCriteria, isCustomFilterOperator, type ValuesFilter, } from '../core/autofilter.ts';
3
3
  export { Cell } from '../core/cell.ts';
4
4
  export { applyTint, type ColorResolutionContext, DEFAULT_INDEXED_COLORS, resolveColor, SYSTEM_INDEXED_COLORS, } from '../core/color-resolution.ts';
5
+ export { AxisHandle } from '../core/axis-handle.ts';
5
6
  export { Column } from '../core/column.ts';
7
+ export type { DateEpoch } from '../core/date.ts';
6
8
  export type { Comment, CommentThread, Mention, MentionRef, Person } from '../core/comment-thread.ts';
7
- export type { CfTimePeriod, CfValueObject, CfValueObjectType, ConditionalFormatting, ConditionalFormattingOperator, ConditionalFormattingRule, ConditionalFormattingType, IconSetType, } from '../core/conditional-formatting.ts';
8
- export type { DataValidation, DataValidationEntry, DataValidationErrorStyle, DataValidationOperator, DataValidationType, } from '../core/data-validation.ts';
9
- export { type AnchoredImage, type AnchorPoint, type Extent, type ImageAnchor, type ImageEditAs, isOneCellAnchor, type OneCellAnchor, type PortableImage, PX_TO_EMU, type TwoCellAnchor, type WorkbookImage, type WorksheetImages, } from '../core/image.ts';
10
- export { MAX_COLUMN_WIDTH, MAX_ROW_HEIGHT } from '../core/limits.ts';
11
- export type { HeaderFooter, PageBreak, PageMargins, PageOrder, PageOrientation, PageSetup, PrintOptions, } from '../core/page-setup.ts';
12
- export { type ParsedPivotField, type ParsedPivotSource, type ParsedPivotTable, type PivotCacheField, type PivotItem, type PivotMetric, type PivotNumericSummary, type PivotRecordCell, type PivotSourceKind, PivotTable, type PivotTableOptions, } from '../core/pivot-table.ts';
9
+ export { type CfIcon, type CfIconSetType, type CfTimePeriod, type CfValueObject, type CfValueObjectType, type ConditionalFormatting, type ConditionalFormattingOperator, type ConditionalFormattingRule, type ConditionalFormattingType, type DataBarAxisPosition, type DataBarDirection, type IconSetType, isCfIconSetType, isCfTimePeriod, isCfValueObjectType, isConditionalFormattingOperator, isConditionalFormattingType, isDataBarAxisPosition, isDataBarDirection, isIconSetType, } from '../core/conditional-formatting.ts';
10
+ export { type Hyperlink } from '../core/hyperlink.ts';
11
+ export { type DataValidation, type DataValidationEntry, type DataValidationErrorStyle, type DataValidationImeMode, type DataValidationOperator, type DataValidationType, isDataValidationErrorStyle, isDataValidationImeMode, isDataValidationOperator, isDataValidationType, } from '../core/data-validation.ts';
12
+ export type { AxisSplice } from '../core/grid-shift.ts';
13
+ export { type AnchoredImage, type AnchorPoint, type Extent, type ImageAnchor, type ImageCrop, type ImageEditAs, type ImageHyperlink, isImageEditAs, isOneCellAnchor, type OneCellAnchor, type PictureProperties, type PortableImage, PX_TO_EMU, type TwoCellAnchor, type WorkbookImage, type WorksheetImages, } from '../core/image.ts';
14
+ export type { ReadPackageOptions } from '../io/opc/read-options.ts';
15
+ export type { PixelAnchor } from '../core/worksheet-pictures.ts';
16
+ export { INVALID_SHEET_NAME_CHARS, MAX_COLUMN_WIDTH, MAX_ROW_HEIGHT, MAX_SHEET_NAME_LENGTH, MAX_TABLE_NAME_LENGTH, TABLE_NAME_PATTERN, } from '../core/limits.ts';
17
+ export { type HeaderFooter, isPageOrder, isPageOrientation, type PageBreak, type PageMargins, type PageOrder, type PageOrientation, type PageSetup, type PrintOptions, } from '../core/page-setup.ts';
18
+ export { type ParsedPivotField, type ParsedPivotSource, type ParsedPivotTable, type PivotCacheField, type PivotItem, type PivotMetric, type PivotNumericSummary, isDeclarablePivotSourceKind, type PivotRecordCell, type PivotSourceKind, PivotTable, type PivotTableOptions, } from '../core/pivot-table.ts';
13
19
  export type { PreservedPart, PreservedRelationship, PreservedRootReference, PreservedWorksheetReference, } from '../core/preserved.ts';
14
20
  export type { SheetProtection, SheetProtectionCredential, SheetProtectionFlags, SheetProtectionOptions, } from '../core/protection.ts';
15
21
  export { Range } from '../core/range.ts';
16
22
  export { Row } from '../core/row.ts';
17
- export type { Alignment, Border, BorderEdge, BorderStyle, CellStyle, Color, DifferentialStyle, Fill, FillPatternType, Font, FontScheme, FontVerticalAlignment, GradientFill, GradientStop, HorizontalAlignment, NamedCellStyle, PatternFill, Protection, TableStyleNamespace, TableStyleTable, UnderlineStyle, VerticalAlignment, } from '../core/style.ts';
18
- export { Table, type TableColumn, type TableColumnStyle, type TableOptions, type TableRegion, type TableStyleInfo, } from '../core/table.ts';
23
+ export { type Alignment, type Border, type BorderEdge, type BorderStyle, type CellContent, type CellStyle, type Color, type Fill, type FillPatternType, type Font, type FontScheme, type FontVerticalAlignment, type GradientFill, type GradientStop, type HorizontalAlignment, isBorderStyle, isFillPatternType, isFontScheme, isFontVerticalAlignment, isHorizontalAlignment, isNamedUnderlineStyle, isVerticalAlignment, type PatternFill, type Protection, type UnderlineStyle, type VerticalAlignment, } from '../core/style.ts';
24
+ export { Table, type TableColumn, type TableColumnStyle, isTotalsRowFunction, type TableGrid, type TableOptions, type TableRegion, type TableStyleInfo, type TotalsRowFunction, } from '../core/table.ts';
25
+ export type { DifferentialStyle, NamedCellStyle, TableStyleDefinition, TableStyleNamespace, TableStyleTable, } from '../core/workbook-styles.ts';
19
26
  export { isTableStyleElementType, STRIPE_ELEMENT_TYPES, TABLE_STYLE_ELEMENT_TYPES, type TableStyle, type TableStyleElement, type TableStyleElementType, } from '../core/table-style.ts';
20
27
  export { estimateWrappedLines } from '../core/text-metrics.ts';
21
- export { DEFAULT_THEME_COLOR_SCHEME, DEFAULT_THEME_FONTS, THEME_COLOR_SLOTS, type ThemeColorScheme, type ThemeColorSlot, type ThemeFontScheme, type ThemeOverrides, } from '../core/theme.ts';
22
- export { type CellValue, cellValueToText, coerceCellValue, type DataTableFormulaValue, detectValueType, ERROR_CODES, type ErrorCode, type ErrorValue, type FormulaResult, type FormulaValue, type HyperlinkValue, isDataTableFormulaValue, isErrorCode, isErrorValue, isFormulaValue, isHyperlinkValue, isRichTextValue, isSharedFormulaValue, type RichTextRun, type RichTextValue, richTextToPlain, type SharedFormulaValue, ValueType, } from '../core/value.ts';
23
- export { type AddImageOptions, type AddWorksheetOptions, DEFAULT_WORKBOOK_VIEW, type DefinedName, type PreservedWorkbookReference, Workbook, type WorkbookProperties, type WorkbookView, } from '../core/workbook.ts';
28
+ export { DEFAULT_THEME_COLOR_SCHEME, DEFAULT_THEME_FONTS, isThemeColorSlot, THEME_COLOR_SLOTS, type ThemeColorScheme, type ThemeColorSlot, type ThemeFontScheme, type ThemeOverrides, } from '../core/theme.ts';
29
+ export { type ArrayFormulaValue, type CellValue, cellValueToText, coerceCellValue, type DataTableFormulaValue, detectValueType, ERROR_CODES, type ErrorCode, type ErrorValue, type FormulaResult, type FormulaValue, isArrayFormulaValue, isDataTableFormulaValue, isErrorCode, isErrorValue, isFormulaValue, isRichTextValue, isSharedFormulaValue, type RichTextRun, type RichTextValue, richTextToPlain, type SharedFormulaValue, ValueType, } from '../core/value.ts';
30
+ export { type AddImageOptions, type AddWorksheetOptions, DEFAULT_WORKBOOK_VIEW, type DefinedName, type PreservedTheme, type PreservedWorkbookReference, Workbook, type WorkbookProperties, type WorkbookView, } from '../core/workbook.ts';
24
31
  export type { WorkbookProtection, WorkbookProtectionCredentialAttr, } from '../core/workbook-protection.ts';
25
- export { type CellModel, type ColumnProperties, type OutlineProperties, type RowInput, type RowProperties, type SheetView, type Visibility, Worksheet, type WorksheetModel, type WorksheetProperties, type WorksheetState, } from '../core/worksheet.ts';
32
+ export { type CellModel, type ColumnProperties, type OutlineProperties, type RowInput, type RowProperties, type SheetView, isVisibility, type Visibility, Worksheet, type WorksheetModel, type WorksheetProperties, type WorksheetState, } from '../core/worksheet.ts';
@@ -1,16 +1,23 @@
1
1
  export { columnToNumber, decodeAddress, decodeRange, encodeAddress, MAX_COLUMN, MAX_ROW, numberToColumn, } from '../core/address.js';
2
+ export { isCustomFilterOperator, } from '../core/autofilter.js';
2
3
  export { Cell } from '../core/cell.js';
3
4
  export { applyTint, DEFAULT_INDEXED_COLORS, resolveColor, SYSTEM_INDEXED_COLORS, } from '../core/color-resolution.js';
5
+ export { AxisHandle } from '../core/axis-handle.js';
4
6
  export { Column } from '../core/column.js';
5
- export { isOneCellAnchor, PX_TO_EMU, } from '../core/image.js';
6
- export { MAX_COLUMN_WIDTH, MAX_ROW_HEIGHT } from '../core/limits.js';
7
- export { PivotTable, } from '../core/pivot-table.js';
7
+ export { isCfIconSetType, isCfTimePeriod, isCfValueObjectType, isConditionalFormattingOperator, isConditionalFormattingType, isDataBarAxisPosition, isDataBarDirection, isIconSetType, } from '../core/conditional-formatting.js';
8
+ export {} from '../core/hyperlink.js';
9
+ export { isDataValidationErrorStyle, isDataValidationImeMode, isDataValidationOperator, isDataValidationType, } from '../core/data-validation.js';
10
+ export { isImageEditAs, isOneCellAnchor, PX_TO_EMU, } from '../core/image.js';
11
+ export { INVALID_SHEET_NAME_CHARS, MAX_COLUMN_WIDTH, MAX_ROW_HEIGHT, MAX_SHEET_NAME_LENGTH, MAX_TABLE_NAME_LENGTH, TABLE_NAME_PATTERN, } from '../core/limits.js';
12
+ export { isPageOrder, isPageOrientation, } from '../core/page-setup.js';
13
+ export { isDeclarablePivotSourceKind, PivotTable, } from '../core/pivot-table.js';
8
14
  export { Range } from '../core/range.js';
9
15
  export { Row } from '../core/row.js';
10
- export { Table, } from '../core/table.js';
16
+ export { isBorderStyle, isFillPatternType, isFontScheme, isFontVerticalAlignment, isHorizontalAlignment, isNamedUnderlineStyle, isVerticalAlignment, } from '../core/style.js';
17
+ export { Table, isTotalsRowFunction, } from '../core/table.js';
11
18
  export { isTableStyleElementType, STRIPE_ELEMENT_TYPES, TABLE_STYLE_ELEMENT_TYPES, } from '../core/table-style.js';
12
19
  export { estimateWrappedLines } from '../core/text-metrics.js';
13
- export { DEFAULT_THEME_COLOR_SCHEME, DEFAULT_THEME_FONTS, THEME_COLOR_SLOTS, } from '../core/theme.js';
14
- export { cellValueToText, coerceCellValue, detectValueType, ERROR_CODES, isDataTableFormulaValue, isErrorCode, isErrorValue, isFormulaValue, isHyperlinkValue, isRichTextValue, isSharedFormulaValue, richTextToPlain, ValueType, } from '../core/value.js';
20
+ export { DEFAULT_THEME_COLOR_SCHEME, DEFAULT_THEME_FONTS, isThemeColorSlot, THEME_COLOR_SLOTS, } from '../core/theme.js';
21
+ export { cellValueToText, coerceCellValue, detectValueType, ERROR_CODES, isArrayFormulaValue, isDataTableFormulaValue, isErrorCode, isErrorValue, isFormulaValue, isRichTextValue, isSharedFormulaValue, richTextToPlain, ValueType, } from '../core/value.js';
15
22
  export { DEFAULT_WORKBOOK_VIEW, Workbook, } from '../core/workbook.js';
16
- export { Worksheet, } from '../core/worksheet.js';
23
+ export { isVisibility, Worksheet, } from '../core/worksheet.js';
@@ -1,5 +1,6 @@
1
1
  export { CustomUiParseError } from '../customui/errors.ts';
2
2
  export { AuthoringError, InternalError, XlsxError, type XlsxErrorCode } from '../errors.ts';
3
+ export { CsvParseError } from '../io/csv/errors.ts';
3
4
  export { PackageReadError, type UnsupportedFormat, UnsupportedFormatError, } from '../io/opc/errors.ts';
4
5
  export { XlsbParseError } from '../io/xlsb/errors.ts';
5
6
  export { XlsxParseError } from '../io/xlsx/errors.ts';
@@ -1,5 +1,6 @@
1
1
  export { CustomUiParseError } from '../customui/errors.js';
2
2
  export { AuthoringError, InternalError, XlsxError } from '../errors.js';
3
+ export { CsvParseError } from '../io/csv/errors.js';
3
4
  export { PackageReadError, UnsupportedFormatError, } from '../io/opc/errors.js';
4
5
  export { XlsbParseError } from '../io/xlsb/errors.js';
5
6
  export { XlsxParseError } from '../io/xlsx/errors.js';
@@ -1,5 +1,5 @@
1
1
  export { editXlsxVbaAddReference, editXlsxVbaRemoveModule } from '../io/xlsx/edit-vba.ts';
2
- export { type ReadXlsxOptions, readXlsx } from '../io/xlsx/read.ts';
2
+ export { readXlsx } from '../io/xlsx/read.ts';
3
3
  export { type ReadSheetRowsOptions, readSheetRows, readWorkbookStream, } from '../io/xlsx/read-rows.ts';
4
4
  export { DEFAULT_THEME_XML, parseThemeColorScheme, parseThemeFontScheme, } from '../io/xlsx/theme-xml.ts';
5
5
  export { type WriteOptions, writeXlsx, writeXlsxAsync } from '../io/xlsx/write.ts';