@sheetxl/io-xlsx 0.8.0-beta.9 → 1.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 (205) hide show
  1. package/LICENSE.md +8 -7
  2. package/browser/esm/7rZlWcm56hn3Jmnk.mjs +7021 -0
  3. package/browser/esm/AZus_5slvoIVhf1u.mjs +10323 -0
  4. package/browser/esm/B9QfzGvsvg-V3utu.mjs +4632 -0
  5. package/browser/esm/{C-2KaUyV4gs-sDTZ.mjs → BIR_Si489gIkGOnc.mjs} +194 -144
  6. package/browser/esm/{DsSIg46AR7IFBN5N.mjs → BJFvc-i40R4rPZ5y.mjs} +939 -804
  7. package/browser/esm/{D-epcZSoKLbsAIaC.mjs → BX8Ebx4NC5zp7_3J.mjs} +3 -3
  8. package/browser/esm/{CxtFawTfwRTCC4Xr.mjs → Bnxw38IvtA04zXEE.mjs} +2 -2
  9. package/browser/esm/CfVhYH77KdrR3fEK.mjs +24 -0
  10. package/browser/esm/index.mjs +3 -4
  11. package/browser/esm/jIQks3Crw6jehdDU.mjs +2474 -0
  12. package/browser/esm/{CRrTMRdN_IcSA_pm.mjs → qc9hnuR2z-whY8YO.mjs} +3 -3
  13. package/browser/esm/wZGpmkMUubNjClhG.mjs +104 -0
  14. package/licenses/dependencies.txt +2 -2
  15. package/node/esm/{BsTMtvwpQoPNv95M.mjs → BNLHWJHyy5eB0P_4.mjs} +2 -2
  16. package/node/esm/CVtsY2F9A9NzEGLk.mjs +2478 -0
  17. package/node/esm/CoeQ0LO-nNXiowwv.mjs +7284 -0
  18. package/node/esm/CxY3iIYLXVhCebeV.mjs +4746 -0
  19. package/node/esm/D2CZy9TQM9h2uqBh.mjs +2562 -0
  20. package/node/esm/{BCr4lCI6qQXXN0K1.mjs → Dm0hvKcR4xb0TV_N.mjs} +3 -3
  21. package/node/esm/_IA1gQ-zFQYQSZSs.mjs +6957 -0
  22. package/node/esm/index.mjs +65 -28
  23. package/node/esm/{CBtj0-a4l2qux2hA.mjs → zZFe3mW0xjmobowq.mjs} +3 -3
  24. package/package.json +9 -10
  25. package/types/src/AutoFilterRules.d.ts +34 -44
  26. package/types/src/ConditionalFormatRules.d.ts +2 -2
  27. package/types/src/DataTableFormula.d.ts +26 -0
  28. package/types/src/DataValidationRules.d.ts +0 -5
  29. package/types/src/DefinedNameAttributes.d.ts +8 -0
  30. package/types/src/ExcelCalcStamp.d.ts +0 -36
  31. package/types/src/ExcelCompat.d.ts +15 -143
  32. package/types/src/ExcelFunctionFacts.d.ts +0 -272
  33. package/types/src/ExcelReservedNames.d.ts +0 -65
  34. package/types/src/KnownFonts.d.ts +37 -0
  35. package/types/src/LegacyFormula.d.ts +1 -46
  36. package/types/src/OOXMLExtensions.d.ts +24 -2
  37. package/types/src/PageLayoutAttributes.d.ts +8 -0
  38. package/types/src/Plugin.d.ts +15 -3
  39. package/types/src/ProtectionAttributes.d.ts +2 -2
  40. package/types/src/SheetKinds.d.ts +42 -0
  41. package/types/src/SheetViewAttributes.d.ts +4 -0
  42. package/types/src/SortExtent.d.ts +16 -0
  43. package/types/src/SourcePackage.d.ts +0 -44
  44. package/types/src/SparklineGroups.d.ts +52 -0
  45. package/types/src/Types.d.ts +13 -3
  46. package/types/src/XlsxHeader.d.ts +19 -0
  47. package/types/src/chart/ChartExXml.d.ts +38 -0
  48. package/types/src/chart/ChartPartXml.d.ts +47 -0
  49. package/types/src/chart/ChartSpaceXml.d.ts +37 -0
  50. package/types/src/chart/_XmlTree.d.ts +34 -0
  51. package/types/src/chart/_chartCodecs.d.ts +12 -0
  52. package/types/src/chart/_chartExCodecs.d.ts +7 -0
  53. package/types/src/chart/_chartExFold.d.ts +14 -0
  54. package/types/src/chart/_chartExMarkup.d.ts +236 -0
  55. package/types/src/chart/_chartExStyle.d.ts +13 -0
  56. package/types/src/chart/_codec.d.ts +78 -0
  57. package/types/src/chart/_drawingml.d.ts +10 -0
  58. package/types/src/chart/_xml.d.ts +70 -0
  59. package/types/src/pivot/PivotArea.d.ts +20 -0
  60. package/types/src/pivot/PivotCacheRead.d.ts +30 -0
  61. package/types/src/pivot/PivotCacheWrite.d.ts +23 -0
  62. package/types/src/pivot/PivotFilters.d.ts +29 -0
  63. package/types/src/pivot/PivotFormats.d.ts +60 -0
  64. package/types/src/pivot/PivotTableRead.d.ts +44 -0
  65. package/types/src/pivot/PivotTableWrite.d.ts +13 -0
  66. package/types/src/pivot/_PivotCacheXml.d.ts +48 -0
  67. package/types/src/pivot/_PivotTableXml.d.ts +23 -0
  68. package/types/src/reader/CellControls.d.ts +18 -0
  69. package/types/src/reader/DocumentPropertiesRead.d.ts +16 -0
  70. package/types/src/reader/DummyFunctionUnwrap.d.ts +43 -23
  71. package/types/src/reader/HeaderStyles.d.ts +15 -0
  72. package/types/src/reader/IsoDateCell.d.ts +20 -0
  73. package/types/src/reader/LibreOfficeDataTable.d.ts +12 -0
  74. package/types/src/reader/PivotButtons.d.ts +14 -0
  75. package/types/src/reader/PivotCellFormats.d.ts +22 -0
  76. package/types/src/reader/SlicerJoin.d.ts +26 -0
  77. package/types/src/reader/ZipReader.d.ts +1 -1
  78. package/types/src/reader/_SlicerRecord.d.ts +59 -0
  79. package/types/src/reader/dom/DOMTransformer.d.ts +2 -2
  80. package/types/src/reader/domVisitors/AppPropertiesVisitor.d.ts +13 -1
  81. package/types/src/reader/domVisitors/AutoFilterVisitor.d.ts +3 -11
  82. package/types/src/reader/domVisitors/ColorContainerVisitor.d.ts +8 -1
  83. package/types/src/reader/domVisitors/CommentVisitor.d.ts +2 -2
  84. package/types/src/reader/domVisitors/DrawingElementVisitor.d.ts +13 -6
  85. package/types/src/reader/domVisitors/DrawingGraphicFrameVisitor.d.ts +9 -0
  86. package/types/src/reader/domVisitors/DrawingGrpSpVisitor.d.ts +10 -7
  87. package/types/src/reader/domVisitors/DrawingPicVisitor.d.ts +22 -13
  88. package/types/src/reader/domVisitors/DrawingSpVisitor.d.ts +5 -5
  89. package/types/src/reader/domVisitors/DrawingVisitor.d.ts +4 -2
  90. package/types/src/reader/domVisitors/ExternalLinkVisitor.d.ts +1 -11
  91. package/types/src/reader/domVisitors/FeaturePropertyBagVisitor.d.ts +18 -0
  92. package/types/src/reader/domVisitors/FmtSchemeVisitor.d.ts +0 -11
  93. package/types/src/reader/domVisitors/FontSchemeVisitor.d.ts +3 -2
  94. package/types/src/reader/domVisitors/ObjectDefaultsVisitor.d.ts +11 -0
  95. package/types/src/reader/domVisitors/SheetColorContainerVisitor.d.ts +2 -2
  96. package/types/src/reader/domVisitors/SheetStyleVisitor.d.ts +26 -5
  97. package/types/src/reader/domVisitors/SlicerCacheDefinitionVisitor.d.ts +11 -2
  98. package/types/src/reader/domVisitors/SlicersVisitor.d.ts +9 -3
  99. package/types/src/reader/domVisitors/SortStateVisitor.d.ts +2 -2
  100. package/types/src/reader/domVisitors/ThreadedCommentsVisitor.d.ts +2 -2
  101. package/types/src/reader/domVisitors/TimelinesVisitor.d.ts +13 -0
  102. package/types/src/reader/domVisitors/WorkbookVisitor.d.ts +0 -9
  103. package/types/src/reader/domVisitors/_Dxfs.d.ts +10 -0
  104. package/types/src/reader/domVisitors/index.d.ts +6 -34
  105. package/types/src/reader/saxVisitors/ContentTypesVisitor.d.ts +1 -0
  106. package/types/src/reader/saxVisitors/SharedStringsVisitor.d.ts +31 -6
  107. package/types/src/reader/saxVisitors/WorksheetVisitor.d.ts +26 -8
  108. package/types/src/richValue/ErrorRichValueHandler.d.ts +22 -0
  109. package/types/src/richValue/IRichValueHandler.d.ts +109 -0
  110. package/types/src/richValue/LocalImageRichValueHandler.d.ts +18 -0
  111. package/types/src/richValue/RichDataParts.d.ts +69 -0
  112. package/types/src/richValue/RichRecordWriter.d.ts +61 -0
  113. package/types/src/richValue/RichValueHandlers.d.ts +25 -0
  114. package/types/src/richValue/RichValueResolver.d.ts +54 -0
  115. package/types/src/richValue/WebImageRichValueHandler.d.ts +37 -0
  116. package/types/src/richValue/index.d.ts +7 -0
  117. package/types/src/utils/DrawingMLText.d.ts +2 -2
  118. package/types/src/utils/FormControls.d.ts +79 -6
  119. package/types/src/utils/SharedNames.d.ts +13 -0
  120. package/types/src/utils/SpreadsheetFont.d.ts +38 -0
  121. package/types/src/utils/VmlNoteShapes.d.ts +25 -32
  122. package/types/src/utils/VmlNoteStyle.d.ts +25 -0
  123. package/types/src/utils/VmlPrefixes.d.ts +24 -0
  124. package/types/src/vba/VBAProject.d.ts +0 -19
  125. package/types/src/writer/EvaluationSheet.d.ts +5 -0
  126. package/types/src/writer/builder/OpcXmlUtils.d.ts +0 -8
  127. package/types/src/writer/builder/PackageBuilder.d.ts +2 -41
  128. package/types/src/writer/builder/Types.d.ts +18 -28
  129. package/types/src/writer/emitters/CommentsEmitter.d.ts +3 -3
  130. package/types/src/writer/emitters/DrawingEmitter.d.ts +2 -2
  131. package/types/src/writer/emitters/ExternalLinkEmitter.d.ts +0 -11
  132. package/types/src/writer/emitters/FeaturePropertyBagEmitter.d.ts +8 -0
  133. package/types/src/writer/emitters/LegacyDrawingEmitter.d.ts +4 -4
  134. package/types/src/writer/emitters/PivotTableEmitter.d.ts +30 -1
  135. package/types/src/writer/emitters/PropsCoreEmitter.d.ts +7 -2
  136. package/types/src/writer/emitters/PropsCustomEmitter.d.ts +15 -0
  137. package/types/src/writer/emitters/RichValuePartsEmitters.d.ts +36 -0
  138. package/types/src/writer/emitters/RichValueRelEmitter.d.ts +12 -0
  139. package/types/src/writer/emitters/RichValueStructureEmitter.d.ts +4 -3
  140. package/types/src/writer/emitters/RichValueTypesEmitter.d.ts +3 -2
  141. package/types/src/writer/emitters/RichValueWebImageEmitter.d.ts +24 -0
  142. package/types/src/writer/emitters/SharedStringsEmitter.d.ts +6 -3
  143. package/types/src/writer/emitters/SlicerEmitter.d.ts +132 -0
  144. package/types/src/writer/emitters/StylesEmitter.d.ts +35 -2
  145. package/types/src/writer/emitters/TableEmitter.d.ts +14 -0
  146. package/types/src/writer/emitters/WorkbookEmitter.d.ts +24 -2
  147. package/types/src/writer/emitters/WorksheetEmitter.d.ts +4 -3
  148. package/types/src/writer/utils/AutoFilter.d.ts +3 -3
  149. package/types/src/writer/utils/CellControlComplements.d.ts +29 -0
  150. package/types/src/writer/utils/DateSystem.d.ts +6 -0
  151. package/types/src/writer/utils/DefaultRows.d.ts +22 -0
  152. package/types/src/writer/utils/DrawMLUtils.d.ts +8 -6
  153. package/types/src/writer/utils/DummyFunction.d.ts +0 -25
  154. package/types/src/writer/utils/DxfCollector.d.ts +14 -11
  155. package/types/src/writer/utils/PrstGeomUtils.d.ts +11 -3
  156. package/types/src/writer/utils/RichValueCollector.d.ts +81 -129
  157. package/types/src/writer/utils/SheetStyleLayout.d.ts +86 -0
  158. package/types/src/writer/utils/TextUtils.d.ts +6 -1
  159. package/types/src/writer/utils/UnsupportedFunctions.d.ts +2 -2
  160. package/types/src/writer/utils/XfVariants.d.ts +61 -0
  161. package/browser/cjs/B0Ugu_crqQYpdfQz.cjs +0 -1
  162. package/browser/cjs/B6sirGz6w-Bm7Ofo.cjs +0 -1
  163. package/browser/cjs/BHM3_D9PsNURVAVy.cjs +0 -1
  164. package/browser/cjs/BHWdwAQ322YA8JAZ.cjs +0 -6
  165. package/browser/cjs/CeuX8p1aBuKTuagi.cjs +0 -2
  166. package/browser/cjs/D3EWCPfCu-qMOIGd.cjs +0 -1
  167. package/browser/cjs/DSM4q1dhVVXvsgby.cjs +0 -30
  168. package/browser/cjs/DiAHwNv2I8RHE9GY.cjs +0 -1
  169. package/browser/cjs/index.cjs +0 -1
  170. package/browser/cjs/wrpXlaSBGEicQf6_.cjs +0 -6
  171. package/browser/cjs/xQ6-wbTw5UzZUM1Y.cjs +0 -1
  172. package/browser/esm/Bu64BYvRAlVftMr1.mjs +0 -67
  173. package/browser/esm/CWt4fDYEbj2hvsl_.mjs +0 -3346
  174. package/browser/esm/Ccnxz-y2WBEgfvvh.mjs +0 -6498
  175. package/browser/esm/Dx64JMAGwNNDBkC1.mjs +0 -4928
  176. package/browser/esm/Sv4twwEJDb9dZ91h.mjs +0 -149
  177. package/node/esm/BPn5XBizKkwaUqXB.mjs +0 -4285
  178. package/node/esm/BVV11IlqF6Lmlv8D.mjs +0 -154
  179. package/node/esm/BiJEEgltJzx94zIR.mjs +0 -3433
  180. package/node/esm/CkmZuMvRTpva7eQu.mjs +0 -5074
  181. package/node/esm/j0RE2usgdljRw_gr.mjs +0 -2345
  182. package/types/src/legacyChart/OOXMLMappings.d.ts +0 -8
  183. package/types/src/legacyChart/OOXMLUtils.d.ts +0 -78
  184. package/types/src/legacyChart/ToOOXMLConverter.d.ts +0 -30
  185. package/types/src/reader/domVisitors/AxisVisitor.d.ts +0 -12
  186. package/types/src/reader/domVisitors/BarChartTypeVisitor.d.ts +0 -6
  187. package/types/src/reader/domVisitors/ChartSpaceVisitor.d.ts +0 -6
  188. package/types/src/reader/domVisitors/ChartTypeVisitor.d.ts +0 -7
  189. package/types/src/reader/domVisitors/ChartVisitor.d.ts +0 -7
  190. package/types/src/reader/domVisitors/DataLabelsVisitor.d.ts +0 -8
  191. package/types/src/reader/domVisitors/DataPointVisitor.d.ts +0 -6
  192. package/types/src/reader/domVisitors/LayoutVisitor.d.ts +0 -5
  193. package/types/src/reader/domVisitors/LegendEntryVisitor.d.ts +0 -5
  194. package/types/src/reader/domVisitors/LegendVisitor.d.ts +0 -5
  195. package/types/src/reader/domVisitors/MarkerVisitor.d.ts +0 -5
  196. package/types/src/reader/domVisitors/NegativeShapeVisitor.d.ts +0 -6
  197. package/types/src/reader/domVisitors/PlotAreaVisitor.d.ts +0 -5
  198. package/types/src/reader/domVisitors/RichValueDataVisitor.d.ts +0 -7
  199. package/types/src/reader/domVisitors/RichValueStructureVisitor.d.ts +0 -6
  200. package/types/src/reader/domVisitors/SeriesVisitor.d.ts +0 -8
  201. package/types/src/reader/domVisitors/TitleVisitor.d.ts +0 -9
  202. package/types/src/writer/emitters/ChartColorsEmitter.d.ts +0 -7
  203. package/types/src/writer/emitters/ChartEmitter.d.ts +0 -14
  204. package/types/src/writer/emitters/ChartStyleEmitter.d.ts +0 -46
  205. package/types/src/writer/utils/HiddenFormulaXfs.d.ts +0 -28
@@ -1,11 +1,11 @@
1
1
  /**
2
- * @license @sheetxl/io-xlsx - SheetXL - Import/Export from/to Excel - v0.8.0-beta.9
2
+ * @license @sheetxl/io-xlsx - SheetXL - Import/Export from/to Excel - v1.0.0
3
3
  *
4
4
  * (C) 2026-present SheetXL Inc. & Michael T. Ford
5
- * License: The license can be found at https://www.sheetxl.com/license.
5
+ * License: SheetXL EULA — https://www.sheetxl.com/eula
6
6
  */
7
7
  import { defineLazyModule as e } from "@sheetxl/utils";
8
- var t = [
8
+ var a = [
9
9
  208,
10
10
  207,
11
11
  17,
@@ -14,54 +14,91 @@ var t = [
14
14
  177,
15
15
  26,
16
16
  225
17
- ], a = async () => (await import("./BCr4lCI6qQXXN0K1.mjs")).OffCryptoEncryption, r = {
17
+ ], t = async () => (await import("./Dm0hvKcR4xb0TV_N.mjs")).OffCryptoEncryption, r = {
18
18
  key: "offcrypto",
19
19
  description: "Office Document Encryption",
20
20
  detect: async (e) => !!((e) => {
21
- if (e.byteLength < t.length) return !1;
22
- const a = new Uint8Array(e, 0, t.length);
23
- for (let e = 0; e < t.length; e++) if (a[e] !== t[e]) return !1;
21
+ if (e.byteLength < a.length) return !1;
22
+ const t = new Uint8Array(e, 0, a.length);
23
+ for (let e = 0; e < a.length; e++) if (t[e] !== a[e]) return !1;
24
24
  return !0;
25
- })(e) && (await a()).detect(e),
26
- decode: async (e, t) => (await a()).decode(e, t),
27
- encode: async (e, t) => (await a()).encode(e, t)
28
- }, o = e("io-xlsx:reader", () => import("./BiJEEgltJzx94zIR.mjs"), { tier: "common" }), i = e("io-xlsx:writer", () => import("./CkmZuMvRTpva7eQu.mjs"), { tier: "common" }), n = "Excel", s = "ExcelMacro", c = {
29
- key: n,
25
+ })(e) && (await t()).detect(e),
26
+ decode: async (e, a) => (await t()).decode(e, a),
27
+ encode: async (e, a) => (await t()).encode(e, a)
28
+ }, i = e("io-xlsx:reader", () => import("./CxY3iIYLXVhCebeV.mjs").then((e) => e.t)), o = e("io-xlsx:writer", () => import("./CoeQ0LO-nNXiowwv.mjs")), l = "Excel", n = "ExcelMacro", c = "ExcelTemplate", m = "ExcelMacroTemplate", s = [
29
+ l,
30
+ n,
31
+ c,
32
+ m
33
+ ], d = {
34
+ key: l,
30
35
  description: "Excel Workbook",
31
36
  mimeType: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
32
37
  exts: ["xlsx", "xls"],
33
- handler: async (e, t) => (await o.load()).readXLSX(e, t)
34
- }, l = {
35
- key: s,
38
+ handler: async (e, a) => (await i.load()).readXLSX(e, a)
39
+ }, p = {
40
+ key: n,
36
41
  description: "Excel Macro-Enabled Workbook",
37
42
  mimeType: "application/vnd.ms-excel.sheet.macroEnabled.12",
38
43
  exts: ["xlsm"],
39
- handler: async (e, t) => (await o.load()).readXLSX(e, t)
40
- }, m = {
41
- key: n,
44
+ handler: async (e, a) => (await i.load()).readXLSX(e, a)
45
+ }, x = {
46
+ key: c,
47
+ description: "Excel Template",
48
+ mimeType: "application/vnd.openxmlformats-officedocument.spreadsheetml.template",
49
+ exts: ["xltx"],
50
+ handler: async (e, a) => (await i.load()).readXLSX(e, a)
51
+ }, y = {
52
+ key: m,
53
+ description: "Excel Macro-Enabled Template",
54
+ mimeType: "application/vnd.ms-excel.template.macroEnabled.12",
55
+ exts: ["xltm"],
56
+ handler: async (e, a) => (await i.load()).readXLSX(e, a)
57
+ }, w = {
58
+ key: l,
42
59
  mimeType: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
43
60
  description: "Excel Workbook",
44
61
  exts: ["xlsx"],
45
- handler: async (e, t) => (await i.load()).writeXLSX(e, {
46
- ...t,
62
+ handler: async (e, a) => (await o.load()).writeXLSX(e, {
63
+ ...a,
47
64
  macroEnabled: !1
48
65
  })
49
- }, d = {
50
- key: s,
66
+ }, E = {
67
+ key: n,
51
68
  mimeType: "application/vnd.ms-excel.sheet.macroEnabled.12",
52
69
  description: "Excel Macro-Enabled Workbook",
53
70
  exts: ["xlsm"],
54
- handler: async (e, t) => (await i.load()).writeXLSX(e, {
55
- ...t,
71
+ handler: async (e, a) => (await o.load()).writeXLSX(e, {
72
+ ...a,
56
73
  macroEnabled: !0
57
74
  })
58
- }, p = {
75
+ }, h = {
76
+ key: c,
77
+ mimeType: "application/vnd.openxmlformats-officedocument.spreadsheetml.template",
78
+ description: "Excel Template",
79
+ exts: ["xltx"],
80
+ handler: async (e, a) => (await o.load()).writeXLSX(e, {
81
+ ...a,
82
+ macroEnabled: !1,
83
+ template: !0
84
+ })
85
+ }, f = {
86
+ key: m,
87
+ mimeType: "application/vnd.ms-excel.template.macroEnabled.12",
88
+ description: "Excel Macro-Enabled Template",
89
+ exts: ["xltm"],
90
+ handler: async (e, a) => (await o.load()).writeXLSX(e, {
91
+ ...a,
92
+ macroEnabled: !0,
93
+ template: !0
94
+ })
95
+ }, X = {
59
96
  name: "@sheetxl/io-xlsx",
60
- version: "0.8.0-beta.9",
97
+ version: "1.0.0",
61
98
  description: "XLSX I/O formats for SheetXL",
62
99
  author: "SheetXL",
63
100
  async register(e) {
64
- await e.registerReadFormat(c), await e.registerReadFormat(l), await e.registerWriteFormat(m), await e.registerWriteFormat(d), await e.registerEncryption(r);
101
+ await e.registerReadFormat(d), await e.registerReadFormat(p), await e.registerReadFormat(x), await e.registerReadFormat(y), await e.registerWriteFormat(w), await e.registerWriteFormat(E), await e.registerWriteFormat(h), await e.registerWriteFormat(f), await e.registerEncryption(r);
65
102
  }
66
103
  };
67
- export { p as IOPlugin, s as XLSM_FORMAT_KEY, n as XLSX_FORMAT_KEY };
104
+ export { s as EXCEL_FORMAT_KEYS, X as IOPlugin, n as XLSM_FORMAT_KEY, l as XLSX_FORMAT_KEY, m as XLTM_FORMAT_KEY, c as XLTX_FORMAT_KEY };
@@ -1,10 +1,10 @@
1
1
  /**
2
- * @license @sheetxl/io-xlsx - SheetXL - Import/Export from/to Excel - v0.8.0-beta.9
2
+ * @license @sheetxl/io-xlsx - SheetXL - Import/Export from/to Excel - v1.0.0
3
3
  *
4
4
  * (C) 2026-present SheetXL Inc. & Michael T. Ford
5
- * License: The license can be found at https://www.sheetxl.com/license.
5
+ * License: SheetXL EULA — https://www.sheetxl.com/eula
6
6
  */
7
- import { t } from "./BsTMtvwpQoPNv95M.mjs";
7
+ import { t } from "./BNLHWJHyy5eB0P_4.mjs";
8
8
  var e, r;
9
9
  function n(t, e) {
10
10
  if (e < 0 || e + 1 >= t.length) throw new RangeError(`toUInt16LE: Offset ${e} is out of bounds for buffer length ${t.length}. Needed 2 bytes.`);
package/package.json CHANGED
@@ -1,21 +1,20 @@
1
1
  {
2
2
  "name": "@sheetxl/io-xlsx",
3
3
  "description": "SheetXL - Import/Export from/to Excel",
4
- "version": "0.8.0-beta.9",
5
- "license": "SEE LICENSE IN <LICENSE>",
4
+ "version": "1.0.0",
5
+ "license": "SEE LICENSE IN LICENSE.md",
6
6
  "type": "module",
7
7
  "exports": {
8
8
  ".": {
9
9
  "types": "./types/index.d.ts",
10
10
  "browser": "./browser/esm/index.mjs",
11
11
  "node": "./node/esm/index.mjs",
12
- "import": "./browser/esm/index.mjs",
13
- "require": "./browser/cjs/index.cjs"
12
+ "default": "./browser/esm/index.mjs"
14
13
  }
15
14
  },
16
15
  "types": "./types/index.d.ts",
17
16
  "module": "./browser/esm/index.mjs",
18
- "main": "./browser/cjs/index.cjs",
17
+ "main": "./browser/esm/index.mjs",
19
18
  "sideEffects": false,
20
19
  "engines": {
21
20
  "node": ">=22"
@@ -45,11 +44,11 @@
45
44
  "utilities"
46
45
  ],
47
46
  "dependencies": {
48
- "@sheetxl/sdk": "^0.8.0-beta.9",
49
- "@sheetxl/utils": "^0.8.0-beta.9",
50
- "@xmldom/xmldom": "^0.9.10",
51
- "@zip.js/zip.js": "^2.8.34",
52
- "web-streams-polyfill": "^4.3.0",
47
+ "@sheetxl/sdk": "^1.0.0",
48
+ "@sheetxl/utils": "^1.0.0",
49
+ "@xmldom/xmldom": "^0.9.12",
50
+ "@zip.js/zip.js": "^2.24.0",
51
+ "web-streams-polyfill": "^4.5.1",
53
52
  "xml-formatter": "^3.7.0"
54
53
  }
55
54
  }
@@ -1,46 +1,37 @@
1
- import { ICondition } from '@sheetxl/sdk';
1
+ import { ICondition, ISort } from '@sheetxl/sdk';
2
2
  /**
3
3
  * The `dynamicFilter/@type` values that are a period (ST_DynamicFilterType less the two averages
4
4
  * and `null`). The SDK's `last7Days` is not among them.
5
5
  */
6
6
  export declare const DYNAMIC_FILTER_PERIODS: ReadonlySet<string>;
7
7
  /**
8
- * The condition a `dynamicFilter/@type` means: `aboveAverage` / `belowAverage` are the Average
9
- * operator, everything else a TimePeriod of that name. The element's `val` / `maxVal` are Excel's
10
- * cache of its last evaluation, never read.
8
+ * The condition a `dynamicFilter` means: `aboveAverage` / `belowAverage` are the Average operator,
9
+ * everything else a TimePeriod of that name. A period's `val` / `maxVal` are the window it was last
10
+ * evaluated over, which Excel holds until the filter is applied again
11
+ * (`probe-filter-dynamic-later-day`), so they read as its `anchorDate` ({@link periodAnchorOf}). An
12
+ * average's `val` is the average it last found, a cache that is not read.
11
13
  */
12
- export declare function dynamicFilterToJSON(type: string | null | undefined): ICondition.JSON;
14
+ export declare function dynamicFilterToJSON(type: string | null | undefined, val?: string | null, maxVal?: string | null): ICondition.JSON;
13
15
  /**
14
- * The border between OOXML's `customFilter` and the SDK's condition.
16
+ * The day a relative period was evaluated on, from the window a `dynamicFilter` spells it was
17
+ * evaluated over (`val`, its first day, and `maxVal`, the day after its last); `undefined` for a
18
+ * period the same whatever the day (`Q1`, `M10`), or a window not spelled.
15
19
  *
16
20
  * @remarks
17
- * `customFilter` is the third of OOXML's three condition systems, and the only one that had no
18
- * border of its own: the reader passed `@operator` straight through as an SDK operator name and
19
- * the writer switched SDK names against OOXML spellings. The two vocabularies overlap on exactly
20
- * `lessThan` and `greaterThan`, so those worked and the other four did not — `greaterThanOrEqual`
21
- * arrived as an operator no registry knew, and left again as `equal`.
22
- *
23
- * Both directions live in one file, as they do for data validations and conditional formats: they
24
- * are one table, and a mapping whose halves drift apart is the bug the round-trip corpus exists to
25
- * catch.
26
- *
27
- * Excel has no text operators here. Its text filters are `equal` / `notEqual` over a pattern packed
28
- * into `@val`: `abc*` begins with, `*abc` ends with, `*abc*` contains, and `~` before `*`, `?` or
29
- * `~` makes that character literal. The three shapes map onto the SDK's text operators; any other
30
- * pattern (`a*b`, `a?c`) has no operator and is carried under its OOXML spelling, inert, so a resave
31
- * writes it back as it arrived.
32
- *
33
- * A wildcard-free `equal` is Excel's values list with one item: it compares the text a cell shows
34
- * (P1, P5), and Excel itself stores it as `<filters><filter val>` on save. It reads as a one-item
35
- * `InSet { byDisplay: true }`, and `notEqual` as its negation; the SDK's `EqualTo` is value
36
- * equality and never comes from here (DESIGN-FILTER §3.2). Excel's `<>` criterion is `notEqual`
37
- * against one space (P7) and reads as `not(blank)`, display-shaped, since a string of spaces is
38
- * blank to it (§3.3).
39
- *
40
- * Value equality has no `customFilter` spelling. A value `EqualTo` on a number goes out as Excel's
41
- * own value test, `<customFilters and="1">` of `greaterThanOrEqual` and `lessThanOrEqual` with
42
- * the same operand, which Excel evaluates live; {@link foldComparisonPair} reads it back.
21
+ * Any day of the period holding that day gives the same window, so the day is one of them: the
22
+ * first of a `this` period, the day after a `last` one, the day before a `next` one, and the last
23
+ * of `yearToDate`, which ends on it.
43
24
  */
25
+ export declare function periodAnchorOf(type: string, val: string | undefined, maxVal: string | undefined): number | undefined;
26
+ /**
27
+ * The window a relative period covers when evaluated on `anchor`, as a `dynamicFilter` spells it:
28
+ * its first day and the day after its last, as serials in the workbook's date system; `null` for a
29
+ * period the same whatever the day. Weeks start on Sunday.
30
+ */
31
+ export declare function periodWindowOf(type: string, anchor: number, date1904: boolean): {
32
+ val: number;
33
+ maxVal: number;
34
+ } | null;
44
35
  /** A `customFilter` in OOXML's own shape. Reader input, writer output — never persisted. */
45
36
  export interface OOXMLCustomFilter {
46
37
  operator?: string | null;
@@ -62,8 +53,8 @@ export type FilterOperator = typeof FilterOperator[keyof typeof FilterOperator];
62
53
  */
63
54
  export declare function isCustomFilter(condition: ICondition.JSON | undefined | null): boolean;
64
55
  /**
65
- * The one string of an `InSet` that is Excel's `equal` criterion: by displayed text, one item,
66
- * no date groups and no blanks entry. `null` for any other list.
56
+ * The one string of an `inSet` that is Excel's `equal` criterion: under Display, one item, no
57
+ * date groups, no blanks entry and no other part to the set. `null` for any other list.
67
58
  */
68
59
  export declare function displayListItem(condition: ICondition.JSON | undefined | null): string | null;
69
60
  /**
@@ -79,15 +70,6 @@ export declare function escapeWildcards(text: string): string;
79
70
  * not read through here — they are a one-item values list, whose item is text.
80
71
  */
81
72
  export declare function valToParam(val: string | null | undefined): string | number | undefined;
82
- /**
83
- * A param or a values-list item as the text an attribute holds.
84
- *
85
- * @remarks
86
- * A typed value is written as `String(value)`, which is the text it shows only under `General`. A
87
- * value list (`InSet` without `byDisplay`) written this way reopens as a display list and keeps a
88
- * number under `0.00` only if it shows as `1.5`; the writer warns. (PLAN-FILTER Phase 4 spells a
89
- * value list as the texts the value shows in its column.)
90
- */
91
73
  export declare function paramToVal(param: unknown): string | undefined;
92
74
  /**
93
75
  * Reads a `customFilter` as a condition.
@@ -129,7 +111,15 @@ export declare function fromCondition(condition: ICondition.JSON | undefined | n
129
111
  * since `<filter val>` would compare the text a cell shows.
130
112
  *
131
113
  * @returns The item's text (`''` for "equals nothing", which is the blanks entry), or `null` when
132
- * the condition is not a plain `equalTo` over text or a boolean.
114
+ * the condition is not a plain `equalTo` over text or a boolean, under no selector or
115
+ * under Display.
133
116
  */
134
117
  export declare function toFilterItem(condition: ICondition.JSON | undefined | null): string | null;
118
+ /**
119
+ * The `sortCondition/@sortBy` for a sort's `sortOn`. Excel spells the fill `cellColor`; the other
120
+ * kinds are spelled the same. `value`, the default, is not written.
121
+ */
122
+ export declare function toSortBy(sortOn: ISort.SortOn | undefined): string | undefined;
123
+ /** The `sortOn` a `sortCondition/@sortBy` means; see {@link toSortBy}. */
124
+ export declare function fromSortBy(sortBy: string | null | undefined): ISort.SortOn | undefined;
135
125
  //# sourceMappingURL=AutoFilterRules.d.ts.map
@@ -1,4 +1,4 @@
1
- import { ICondition, IConditionalFormat, IStyle } from '@sheetxl/sdk';
1
+ import { ICondition, IConditionalFormat, ICellStyle } from '@sheetxl/sdk';
2
2
  /**
3
3
  * The border between OOXML's `cfRule` and the SDK's condition-canonical conditional format.
4
4
  *
@@ -29,7 +29,7 @@ export interface OOXMLCfRule {
29
29
  * and blank/error rules.
30
30
  */
31
31
  formulas?: string[];
32
- style?: IStyle.JSON;
32
+ style?: ICellStyle.JSON;
33
33
  scale?: IConditionalFormat.Scale;
34
34
  stopIfTrue?: boolean;
35
35
  pivot?: boolean;
@@ -0,0 +1,26 @@
1
+ import { IRange } from '@sheetxl/sdk';
2
+ export interface DataTableDefinition {
3
+ /** The result cells. */
4
+ ref: IRange.Coords;
5
+ /** The row input's address; absent for a one-input table down a column. */
6
+ rowInput?: string;
7
+ /** The column input's address; absent for a one-input table along a row. */
8
+ columnInput?: string;
9
+ /** The row input was deleted: the argument is `#REF!`. `rowInput` is its last address, if known. */
10
+ rowInputDeleted?: boolean;
11
+ /** The column input was deleted. */
12
+ columnInputDeleted?: boolean;
13
+ }
14
+ /** The `TABLE(...)` formula a definition is in the model, without the `=`, placed at `ref`'s top-left. */
15
+ export declare const toDataTableFormula: (table: DataTableDefinition) => string;
16
+ /**
17
+ * The definition a formula is, when the whole formula is one `TABLE(...)` call a file can hold as
18
+ * Excel's tag: two inputs that are each empty, `#REF!` or an unqualified cell, and two literal
19
+ * counts. `null` otherwise (a `TABLE` inside an expression, a computed count).
20
+ *
21
+ * @param text The formula text at the anchor, with or without the `=`.
22
+ * @param anchor The cell the formula sits in: the results' top-left.
23
+ */
24
+ export declare const parseDataTableFormula: (text: string, anchor: IRange.CellCoords) => DataTableDefinition | null;
25
+ export declare const dataTableAttributes: (table: DataTableDefinition) => Record<string, string>;
26
+ //# sourceMappingURL=DataTableFormula.d.ts.map
@@ -43,11 +43,6 @@ export type DvType = typeof DvType[keyof typeof DvType];
43
43
  * `$A$1:$A$5` are formula text by type, carried verbatim with no marker.
44
44
  */
45
45
  export declare function formulaToParam(text: string, type: string | undefined): Scalar;
46
- /**
47
- * The most characters Excel reads from a `dataValidation`'s `prompt`, `error`, `promptTitle` or
48
- * `errorTitle`. One more and Excel refuses to open the workbook at all (probe P5). Excel's own
49
- * authoring stops sooner (titles 32, prompt 254, error 225); the file is what matters here.
50
- */
51
46
  export declare const MAX_MESSAGE_LENGTH = 255;
52
47
  /**
53
48
  * `text` cut to {@link MAX_MESSAGE_LENGTH}, never splitting a surrogate pair; `warn` names the
@@ -0,0 +1,8 @@
1
+ /**
2
+ * `CT_DefinedName`'s attributes that SheetXL carries as `INamed.FileAttributes`, in schema order.
3
+ * `functionGroupId` is the one number among them.
4
+ */
5
+ export declare const DEFINED_NAME_TEXT_ATTRIBUTES: readonly ["customMenu", "description", "help", "statusBar", "shortcutKey"];
6
+ /** The boolean ones, in schema order. Only a set flag is kept or written; each defaults to off. */
7
+ export declare const DEFINED_NAME_FLAG_ATTRIBUTES: readonly ["function", "vbProcedure", "xlm", "publishToServer", "workbookParameter"];
8
+ //# sourceMappingURL=DefinedNameAttributes.d.ts.map
@@ -1,39 +1,3 @@
1
- /**
2
- * The Excel calculation-engine stamp this package is verified against.
3
- *
4
- * @remarks
5
- * The writer stamps a workbook that has no source of its own with these, and the reader's
6
- * calc-on-load policy compares a file's `calcId` against the same build. Raise the two together,
7
- * and only alongside the oracle they name.
8
- */
9
- /**
10
- * The `calcPr@calcId` of the Excel build this engine's results are verified against.
11
- *
12
- * @remarks
13
- * `calcId` is the version of the Excel calculation engine that last calculated a file. On open,
14
- * Excel trusts the stored values when the id is its own or newer and performs a FULL
15
- * recalculation when it is older or absent — which turns every citation of a closed external
16
- * book into `#REF!` (DESIGN-EXTERNAL-LINKS phase D). So a written workbook is stamped with the id
17
- * of the build this engine's results are verified against — the COM oracle, Excel 16.0, which
18
- * writes `191029` (`externalLinksNames.xlsx`, authored by it 2026-09-11) — and a source file's own
19
- * id is carried through unchanged, so a resave keeps exactly the trust the original had. A later
20
- * Excel, whose id is higher, recalculates on open as it does for its own older files.
21
- *
22
- * On read, a file whose id is absent or below this one is recalculated as Excel would.
23
- */
24
1
  export declare const EXCEL_CALC_ID_VERIFIED = "191029";
25
- /**
26
- * The `xcalcf:calcFeatures` extension written for a workbook that has no source list of its own —
27
- * the other half of the trust {@link EXCEL_CALC_ID_VERIFIED} buys.
28
- *
29
- * @remarks
30
- * Since 2018 Excel also records which calculation FEATURES the engine that last calculated the
31
- * file had (`microsoft.com:RD`, `Single`, `LET_WF`, …), and recalculates a file on open whose
32
- * list lacks any of its own — measured 2026-09-11 through the COM oracle: Excel's own resave of
33
- * `externalLinksNames.xlsx` opens with its stored values, and the same file with ONLY this
34
- * extension removed opens recalculated (`#REF!`, `#NAME?`), while removing `calcChain.xml` or
35
- * spelling a legacy cell `_xlfn.SINGLE(...)` changes nothing. The list is the one that Excel
36
- * build writes; a source file's own is carried through unchanged.
37
- */
38
2
  export declare const EXCEL_CALC_FEATURES_VERIFIED: string;
39
3
  //# sourceMappingURL=ExcelCalcStamp.d.ts.map
@@ -1,74 +1,8 @@
1
- import { IFunction, IRange, INamed, ISheet, ICalculation } from '@sheetxl/sdk';
2
- /**
3
- * The implicit-intersection translation between the modern (dynamic) formula model and what a
4
- * legacy xlsx `<f>` means — item 47's `ExcelCompat.ts`, born in io-xlsx
5
- * (DESIGN-FORMULA-DIALECT.md §3).
6
- *
7
- * Both directions live here, built on ONE site rule so they cannot drift (FORMULA-SEMANTICS §6.1
8
- * — after the read transform a divergence is a wrong VALUE, not non-canonical XML):
9
- *
10
- * - READ (rules 1/2): a plain `<f>` — no `t="array"`, no `cm` — has legacy semantics whatever its
11
- * age, and loading it means putting the `@` back where Excel would
12
- * (`=ABS(A1:A5)` → `=ABS(@A1:A5)`). The decision is per CELL, and the bit rides BESIDE the
13
- * formula exactly as it does on disk, never inside it: `cm=`/`t="array"` are cell attributes,
14
- * the reader records their extents in `sheet.formulaArray`, and the load asks per formula which
15
- * of {@link createCompatReadTransforms}' two transforms to run
16
- * (`ICalculation.FormulaTransformContext`).
17
- * - WRITE: the `cm="1"` + `t="array"` marker goes on every formula legacy intersection would
18
- * change — {@link hasIntersectionSite}, answered beside the formula by the dialect's `annotate`
19
- * ({@link registerXlsxFormulaDialect}) and read by `WorksheetEmitter`. On a formula written
20
- * PLAIN, an `@` the legacy read would put back is not spelled at all — Excel elides it and
21
- * spells `_xlfn.SINGLE` only where the read would not re-insert it
22
- * ({@link createCompatWriteTransform}).
23
- *
24
- * ### An unknown function is a range
25
- *
26
- * A call to a function Excel does not know (an add-in or user-defined function — `CASCADESPARKLINE`
27
- * from SpreadJS, `FOO`) has an unknown return, and Excel treats that as range-VALUED: the call
28
- * takes an `@` at the root and at every scalar site holding it, never on its own arguments, and
29
- * never inside a range-accepting slot. Measured `probe-unknown-function-intersect.ps1`
30
- * (2026-09-03): `=FOO(1)` opens as `=@FOO(1)`, `=ABS(FOO(1))` as `=ABS(@FOO(1))`,
31
- * `=IF(TRUE,FOO(1),2)` as `=@IF(TRUE,FOO(1),2)`, `=FOO(A1:A5)` as `=@FOO(A1:A5)`, while
32
- * `=SUM(FOO(1))`, `=SUMPRODUCT(FOO(A1:A5))` and `=N(FOO(1))` stay plain. The value is `#NAME?`
33
- * either way — what the rule decides is whether the file round-trips to the same TEXT, which
34
- * matters the day the function exists (the same file opened by the application that wrote it).
35
- *
36
- * ### Two kinds of arrayness, and only one of them is a site
37
- *
38
- * Being an array is not the same question as being intersected. Arrayness that comes from a
39
- * REFERENCE — a range, a spill anchor, a table reference, a defined name, an array-returning or
40
- * `valueReturn` call — is a site wherever a value-typed slot holds it, whatever encloses it.
41
- * Arrayness that comes from an inline array CONSTANT is not: legacy Excel LIFTS `{…}` and only
42
- * collapses it where one value is genuinely wanted, which is the cell root and whatever the root's
43
- * demand reaches through ({@link _childDemand}). That is the split `constants` carries through
44
- * {@link _isRangeValued}.
45
- *
46
- * Measured on plain-`<f>` opens, `probe-array-constant-intersection{,2}.ps1` (40 rows, 2026-08-17):
47
- * `={1,2,3}` opens as `=@{1,2,3}` and `=ABS({-1,-2,-3})` as `=ABS(@{-1,-2,-3})`, while
48
- * `=SUM(ABS({-1,-2,-3}))` opens UNTOUCHED at 6 — where the same shape over a range,
49
- * `=SUM(ABS(H1:H3))`, opens as `=SUM(ABS(@H1:H3))`. A name is reference-derived even when its body
50
- * is a constant, which is the pair that kills the simpler reading: `=SUM(ArrConst&0)` opens as
51
- * `=SUM(@ArrConst&0)` = 10 against `=SUM({1,2,3}&0)` = 0.
52
- *
53
- * ### Everything measured; facts OVERRIDE declarations
54
- *
55
- * Every per-function fact the rules below consult lives in the measured `ExcelFunctionFacts` map
56
- * (one row per name, probe provenance and slot addressing documented there). The registry's
57
- * declarations state what a BODY needs and serve as the DEFAULT; wherever Excel measurably
58
- * disagrees, the fact wins (CALC-ISSUES item 44: "use the measured list, not a derived
59
- * predicate"). Re-run the probes when adding a function — no test can detect a new function Excel
60
- * happens to disagree with.
61
- */
1
+ import { IFunction, IRange, INamed, IWorksheet, ICalculation } from '@sheetxl/sdk';
62
2
  /** Does any call in this tree name a function on Excel's volatile list
63
3
  * (`ExcelFunctionFact.volatile`)? (Defined-name bodies are not chased: Excel's `ca` reflects the
64
4
  * CELL's own formula text.) */
65
5
  export declare const hasVolatileCall: (root: ICalculation.FormulaNode | undefined) => boolean;
66
- /**
67
- * Does this tree call a function the registry does not know? An unknown call is what Excel's
68
- * `ca="1"` records on a cell that reached a user-defined function during its last calculation
69
- * (measured on every `FOO` cell of `probe-unknown-function-intersect.ps1`) — static here where
70
- * Excel's is a runtime fact, so a call on an untaken lazy branch is flagged too.
71
- */
72
6
  export declare const hasUnknownCall: (root: ICalculation.FormulaNode | undefined, ctx: CompatContext) => boolean;
73
7
  /** What the walks read of a function: its declared slots and return, and whether it is a built-in. */
74
8
  export interface CompatFunction {
@@ -110,31 +44,6 @@ export interface CompatContext {
110
44
  * every rule above traces to Excel's own insertion, not our reading of it.
111
45
  */
112
46
  export declare const insertImplicitIntersection: (root: ICalculation.FormulaNode, ctx: CompatContext) => ICalculation.FormulaNode;
113
- /**
114
- * The WRITE decision — whether legacy implicit intersection would change this formula's meaning,
115
- * which is the exact condition under which Excel writes `cm="1"` + `t="array"`.
116
- *
117
- * @remarks
118
- * A STATIC property of the formula, not the value: `=IF(FALSE,H1:H3,5)` computes `5` and is still
119
- * marked. The same rule as {@link insertImplicitIntersection} by construction: a formula is
120
- * marked exactly when the insertion would change it — plus one clause the insertion rule does not
121
- * share: a `call` node ANYWHERE marks, because immediate application does not exist in the legacy
122
- * dialect at all. Measured (`probe-lambda-call.xlsx`, every accepted case): Excel puts
123
- * `cm="1"` + `t="array"` on `SUM(LAMBDA(x,x+1)(3),1)` (call in an argument slot, scalar root),
124
- * `MyLam(3)`, `A1(3)`, `-LAMBDA(x,-x)(1)`, the curried and partial forms — all of them. Without
125
- * the marker Excel reads the cell back as a LEGACY formula and re-inserts `@` at the root and on
126
- * the lambda parameters (`=@LAMBDA(a,b,@a+@b)(1,2)`), which is exactly what the Excel-open gate
127
- * caught (verify-lambda-call-opens.ps1, 2026-08-13).
128
- *
129
- * "Marked exactly when the insertion would change it" is OUR rule, and Excel's marker is not
130
- * only that — measured `probe-sumproduct-monthyear.ps1` + `probe-slot-class-intersect2.ps1`
131
- * (2026-08-14): the same text entered through legacy `.Formula` saves PLAIN and through modern
132
- * `.Formula2` saves `cm="1" t="array"`, at identical values, on every array-scope shape here. So
133
- * Excel's marker also records the ENTRY CHANNEL, which we do not persist. We write the legacy
134
- * channel's answer, which is the self-consistent one: the file we emit reads back — by Excel and
135
- * by us — to the tree we emitted it from. Carrying a read-side "was marked" bit instead is the
136
- * open alternative.
137
- */
138
47
  export declare const hasIntersectionSite: (root: ICalculation.FormulaNode, ctx: CompatContext) => boolean;
139
48
  /** The reader's two READ transforms — see {@link createCompatReadTransforms}. */
140
49
  export interface CompatReadTransforms {
@@ -178,29 +87,6 @@ export interface XlsxFormulaAnnotation {
178
87
  }
179
88
  /** Where a save's emitters find the workbook's dialect (`EmitContext.getSharedStates`). */
180
89
  export declare const SHARED_STATE_XLSX_FORMULA_DIALECT = "xlsxFormulaDialect";
181
- /**
182
- * The xlsx formula dialect for one workbook: how this format spells formulas, applied to formula
183
- * TEXT, with no calculation involved (DESIGN-CALC-SERVICE §9).
184
- *
185
- * - READ: the on-disk legacy spellings (`_xlfn.`, `_xlws.`, `_xleta.`, `_xlpm.`, `SINGLE`,
186
- * `ANCHORARRAY`, `_TRO_*`, `_LONGTEXT`) unwrapped, and for a plain cell the implicit-intersection
187
- * `@` operators Excel would show, exactly where it would ({@link CompatReadTransforms.legacy});
188
- * an array anchor and a detached formula take the unwrap alone.
189
- * - WRITE: the legacy spellings on every formula, plus, for a plain cell, the elision of each `@`
190
- * the read would put back ({@link createCompatWriteTransform}).
191
- * - ANNOTATE: an {@link XlsxFormulaAnnotation}.
192
- *
193
- * Functions are answered from the built-in declarations, defined names from the workbook's names
194
- * as text; neither needs an engine.
195
- *
196
- * A DETACHED formula is one with no cell of its own: a defined name, a conditional format or data
197
- * validation operand, a cfvo value. Excel evaluates a condition body in CSE mode (nothing
198
- * intersects, measured `probe-cf-intersect.ps1`) and writes it plain with no `cm=`, so the
199
- * plain-cell `@` insertion and elision never apply to it — only the spelling does. That spelling
200
- * needs no names, so a dialect built with none ({@link createXlsxFormulaDialect}) answers
201
- * {@link readDetached} completely; it is what the reader hands the worksheet visitors before the
202
- * workbook's names have been read.
203
- */
204
90
  export interface XlsxFormulaDialect {
205
91
  /**
206
92
  * The tree of the model's canonical text written at `anchor`, in the shape the compiled tree
@@ -230,6 +116,15 @@ export interface XlsxFormulaDialect {
230
116
  /** A defined name's canonical text spelled for the file. */
231
117
  writeName(text: string): string;
232
118
  }
119
+ /**
120
+ * The external links a save writes, for {@link createXlsxFormulaDialect}.
121
+ */
122
+ export interface XlsxExternalBooks {
123
+ /** How many `<externalReference>` positions the file will have. */
124
+ count: number;
125
+ /** Called for each citation of a position past {@link count}, as it is written `#REF!`. */
126
+ onDangling?: (n: number) => void;
127
+ }
233
128
  /**
234
129
  * Builds the dialect for a workbook.
235
130
  *
@@ -239,14 +134,17 @@ export interface XlsxFormulaDialect {
239
134
  * @param tables The workbook's table names. A bare table name (`=Sales`) parses as a name; the
240
135
  * file spells it as the table's data body (`Sales[]`), so the writer has to know which names are
241
136
  * tables.
137
+ * @param externalBooks The links a save writes. With it, {@link XlsxFormulaDialect.spell} and
138
+ * {@link XlsxFormulaDialect.writeName} write a citation of any other position as `#REF!`; a reader
139
+ * omits it.
242
140
  */
243
- export declare function createXlsxFormulaDialect(names?: readonly INamed.JSON[] | null, tables?: readonly string[] | null): XlsxFormulaDialect;
141
+ export declare function createXlsxFormulaDialect(names?: readonly INamed.JSON[] | null, tables?: readonly string[] | null, externalBooks?: XlsxExternalBooks | null): XlsxFormulaDialect;
244
142
  /**
245
143
  * Rewrites a sheet's formulas, as the reader recorded them, into canonical text in place. Plain
246
144
  * versus marked is a per-CELL fact on disk (`cm=` / `t="array"` are cell attributes), answered
247
145
  * from the `formulaArray` extents the reader recorded.
248
146
  */
249
- export declare function readSheetFormulas(sheet: ISheet.JSON, dialect: XlsxFormulaDialect): void;
147
+ export declare function readSheetFormulas(sheet: IWorksheet.JSON, dialect: XlsxFormulaDialect): void;
250
148
  /**
251
149
  * The `@` nodes of a modern tree that the legacy read would put back on its own — the ones a
252
150
  * PLAIN `<f>` does not need to spell.
@@ -267,31 +165,5 @@ export declare function readSheetFormulas(sheet: ISheet.JSON, dialect: XlsxFormu
267
165
  * takes no insertion on read, so every `@` on it has to be explicit.
268
166
  */
269
167
  export declare const impliedIntersections: (root: ICalculation.FormulaNode, ctx: CompatContext) => Set<ICalculation.FormulaNode>;
270
- /**
271
- * The writer's complete WRITE transform for a CELL formula: the legacy spelling on every node
272
- * (`createLegacyWriteTransform`), plus — at the root of a formula that will be written plain —
273
- * the elision of every `@` the legacy read would put back.
274
- *
275
- * @remarks
276
- * Excel's own spelling of a modern `@`, measured `probe-at-elision.ps1` (2026-09-03): `=@A1:A5`
277
- * saves as `A1:A5`, `=ABS(@A1:A5)` as `ABS(A1:A5)`, `=@FOO(1)` as `FOO(1)`, `=@SEQUENCE(5)` as
278
- * `_xlfn.SEQUENCE(5)`; `_xlfn.SINGLE` appears only where the read would NOT re-insert —
279
- * `SUM(_xlfn.SINGLE(A1:A5))`, `SUMPRODUCT(ABS(_xlfn.SINGLE(A1:A5)))`, `_xlfn.SINGLE(SUM(1))`,
280
- * `_xlfn.SINGLE((A1:A5))`. A formula that still has a site after its `@`s are honored is a
281
- * MARKED cell (`cm="1"`) and keeps every `@` explicit (`=@ABS(A1:A5)` →
282
- * `_xlfn.SINGLE(ABS(A1:A5))` under `cm="1"`), because no insertion runs on it. The text is
283
- * therefore self-consistent in both readers: what comes back is the tree that went out.
284
- *
285
- * This is why the SpreadJS/add-in round trip closes: `=@CASCADESPARKLINE(...)` — the modern
286
- * form of the plain `<f>` the authoring application wrote — goes back out as that same plain
287
- * `<f>`, which is the only spelling the authoring application knows.
288
- *
289
- * Mechanics: the spelling runs in the SDK's own post-order walk (fresh nodes keep their trivia
290
- * that way), so by the root every `@` is already a `SINGLE` call. The root pass unwraps a VIEW of
291
- * the spelled tree to ask the modern-tree questions, maps each implied `@` of the view back to
292
- * the `SINGLE` node it came from, and drops those nodes copy-on-write — every untouched node
293
- * keeps its identity, and its whitespace. Defined names and array-anchored cells take the
294
- * spelling pass only (`WorkbookEmitter`'s write provider decides per block; names never run this).
295
- */
296
168
  export declare function createCompatWriteTransform(legacy: ICalculation.FormulaTransform, ctx: CompatContext): ICalculation.FormulaTransform;
297
169
  //# sourceMappingURL=ExcelCompat.d.ts.map