@sheetxl/sdk 0.8.0-beta.1 → 0.8.0-beta.2

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 (353) hide show
  1. package/THIRD-PARTY-NOTICES.md +1 -1
  2. package/browser/cjs/4f5eoQQfV-V7LO2_.cjs +1 -0
  3. package/browser/cjs/BEnEDC1m546-gzWS.cjs +1 -0
  4. package/browser/cjs/CwCUa4IzGNGissLL.cjs +1 -0
  5. package/browser/cjs/{a0Z-SXs_N71CtqYb.cjs → Dg3GaW0QWwnlqetX.cjs} +1 -1
  6. package/browser/cjs/KWQPie2u7AP69web.cjs +93 -0
  7. package/browser/cjs/index.cjs +2 -2
  8. package/browser/esm/{B0HS42a7lga1k1U_.mjs → BJ9hcZAGY8Tj5_9L.mjs} +1 -1
  9. package/browser/esm/C8vpA2ZBtZf6w4nq.mjs +394 -0
  10. package/browser/esm/DDojiE2-oycJ7qGi.mjs +20 -0
  11. package/browser/esm/DEPT7zmpiMdZ-_qC.mjs +70253 -0
  12. package/browser/esm/DOvCi3lf49To36WP.mjs +8 -0
  13. package/browser/esm/{uyWBMSIxMlt8n5Z3.mjs → Dq3sc4B_HQHBrT5N.mjs} +2 -2
  14. package/browser/esm/index.mjs +871 -696
  15. package/browser/esm/{DlPMeIyxT9tG_WDk.mjs → trwZArJQQq7K9kL7.mjs} +2 -2
  16. package/licenses/dependencies.txt +204 -204
  17. package/node/esm/CGWsQOMWdnDeF4dX.mjs +8 -0
  18. package/node/esm/{Cku7XiUvw1xrRasi.mjs → CL9MI-b6D9BmtVXW.mjs} +1 -1
  19. package/node/esm/CressiwiIhxCVp1v.mjs +28 -0
  20. package/node/esm/O2cOO3xIynWUgOWe.mjs +403 -0
  21. package/node/esm/index.mjs +52356 -37345
  22. package/package.json +6 -7
  23. package/resources/locales/de/model.msg.json +45 -9
  24. package/resources/locales/en/model.msg.json +42 -9
  25. package/types/scripting-api.json +7093 -0
  26. package/types/scripting-enums.json +54 -8
  27. package/types/scripting.d.ts +7006 -1202
  28. package/types/src/anchored/AbstractAnchored.d.ts +18 -8
  29. package/types/src/anchored/AnchoredMap.d.ts +2 -0
  30. package/types/src/anchored/IAnchoredMap.d.ts +52 -4
  31. package/types/src/autoFill/AutoFill.d.ts +316 -32
  32. package/types/src/autoFill/IAutoFill.d.ts +232 -15
  33. package/types/src/border/{IBorder.d.ts → IBorders.d.ts} +41 -40
  34. package/types/src/border/index.d.ts +1 -1
  35. package/types/src/calculation/Calculation.d.ts +740 -35
  36. package/types/src/calculation/ExternalBookBindings.d.ts +118 -0
  37. package/types/src/calculation/FormulaText.d.ts +74 -0
  38. package/types/src/calculation/ICalculation.d.ts +318 -81
  39. package/types/src/calculation/INamedFormulasCollection.d.ts +5 -8
  40. package/types/src/calculation/NamedFormulaCollection.d.ts +139 -107
  41. package/types/src/calculation/NamedLambdaFunction.d.ts +28 -0
  42. package/types/src/calculation/TokenType.d.ts +9 -0
  43. package/types/src/calculation/Types.d.ts +83 -2
  44. package/types/src/calculation/_CloneBoundary.d.ts +80 -0
  45. package/types/src/calculation/compiler/ASTTypes.d.ts +58 -0
  46. package/types/src/calculation/compiler/CompilerUtils.d.ts +134 -12
  47. package/types/src/calculation/compiler/FormulaCompiler.d.ts +29 -4
  48. package/types/src/calculation/compiler/FormulaParser.d.ts +1 -2
  49. package/types/src/calculation/compiler/LiteTransform.d.ts +17 -0
  50. package/types/src/calculation/compiler/ParserUtils.d.ts +26 -1
  51. package/types/src/calculation/compiler/SRParser.d.ts +2 -1
  52. package/types/src/calculation/compiler/Types.d.ts +79 -9
  53. package/types/src/calculation/executor/CalcExecutor.d.ts +312 -33
  54. package/types/src/calculation/executor/CalcExecutorUtils.d.ts +43 -2
  55. package/types/src/calculation/executor/CircularReference.d.ts +2 -0
  56. package/types/src/calculation/formula/Formula.d.ts +58 -21
  57. package/types/src/calculation/formula/FormulaBlock.d.ts +124 -21
  58. package/types/src/calculation/formula/FormulaRecordView.d.ts +79 -0
  59. package/types/src/calculation/formula/IFormulaBlock.d.ts +261 -67
  60. package/types/src/calculation/formula/LambdaValue.d.ts +15 -16
  61. package/types/src/calculation/formula/LazyValue.d.ts +96 -0
  62. package/types/src/calculation/formula/TokenUtils.d.ts +25 -1
  63. package/types/src/calculation/formula/index.d.ts +1 -0
  64. package/types/src/calculation/functions/FunctionDeclarations.d.ts +31 -0
  65. package/types/src/calculation/functions/initializeFunctions.d.ts +15 -2
  66. package/types/src/calculation/grid/CalcGrid.d.ts +384 -158
  67. package/types/src/calculation/grid/CalcGridBackend.d.ts +450 -0
  68. package/types/src/calculation/grid/CalcGridProxy.d.ts +133 -0
  69. package/types/src/calculation/grid/CalcGridUtils.d.ts +62 -12
  70. package/types/src/calculation/grid/FormulaEntry.d.ts +129 -0
  71. package/types/src/calculation/grid/FormulaHost.d.ts +236 -0
  72. package/types/src/calculation/grid/ICalcGrid.d.ts +456 -143
  73. package/types/src/calculation/grid/_CalcRequest.d.ts +272 -0
  74. package/types/src/calculation/grid/index.d.ts +4 -0
  75. package/types/src/calculation/index.d.ts +2 -0
  76. package/types/src/calculation/spatial/ContentfulSpatialValue.d.ts +6 -2
  77. package/types/src/calculation/spatial/FormulaSpatialValue.d.ts +339 -11
  78. package/types/src/calculation/spatial/SpillEntry.d.ts +20 -5
  79. package/types/src/calculation/spatial/TouchedWindows.d.ts +86 -0
  80. package/types/src/calculation/spatial/index.d.ts +1 -0
  81. package/types/src/calculation/state/CalcInputs.d.ts +41 -0
  82. package/types/src/calculation/state/CalcNode.d.ts +141 -30
  83. package/types/src/calculation/state/CalcScope.d.ts +37 -0
  84. package/types/src/calculation/state/CalcState.d.ts +22 -1
  85. package/types/src/calculation/state/CalculationContext.d.ts +36 -2
  86. package/types/src/calculation/state/IContextContainer.d.ts +129 -27
  87. package/types/src/calculation/state/_PendingOverlayGrid.d.ts +163 -0
  88. package/types/src/calculation/state/_ReadObservedGrid.d.ts +74 -8
  89. package/types/src/calculation/state/index.d.ts +1 -0
  90. package/types/src/calculation/symbol/ExternalSheetSymbols.d.ts +80 -0
  91. package/types/src/calculation/symbol/ISymbolRegistry.d.ts +23 -0
  92. package/types/src/calculation/symbol/IndirectSymbolProvider.d.ts +16 -2
  93. package/types/src/calculation/symbol/SheetSymbolProvider.d.ts +63 -3
  94. package/types/src/calculation/symbol/SymbolRegistry.d.ts +20 -0
  95. package/types/src/calculation/symbol/index.d.ts +3 -2
  96. package/types/src/cell/ICell.d.ts +78 -23
  97. package/types/src/cell/ICellProtection.d.ts +50 -10
  98. package/types/src/cellRange/ICellRange.d.ts +329 -72
  99. package/types/src/cellRange/ICellRanges.d.ts +9 -7
  100. package/types/src/chart/Chart.d.ts +72 -2
  101. package/types/src/chart/ChartCollection.d.ts +26 -0
  102. package/types/src/chart/IChart.d.ts +162 -9
  103. package/types/src/chart/IChartCollection.d.ts +25 -0
  104. package/types/src/chart/_ChartXml.d.ts +70 -0
  105. package/types/src/chart/index.d.ts +1 -3
  106. package/types/src/collections/ArraysGrid.d.ts +1 -1
  107. package/types/src/collections/IGrid.d.ts +1 -1
  108. package/types/src/collections/ISparseGrid.d.ts +9 -0
  109. package/types/src/collections/ISpatialMap.d.ts +59 -21
  110. package/types/src/collections/ImmutableList.d.ts +28 -0
  111. package/types/src/collections/MixedTypedArrayList.d.ts +168 -108
  112. package/types/src/collections/OverlappingRangeIterator.d.ts +13 -17
  113. package/types/src/collections/RepeatingList.d.ts +7 -0
  114. package/types/src/collections/ScalarGrid.d.ts +50 -0
  115. package/types/src/collections/SparseGrid.d.ts +1 -1
  116. package/types/src/collections/SpatialMap.d.ts +13 -21
  117. package/types/src/collections/Tuple.d.ts +128 -16
  118. package/types/src/collections/_GridUtils.d.ts +19 -6
  119. package/types/src/collections/_RangeSweep.d.ts +97 -0
  120. package/types/src/collections/_SpatialUtils.d.ts +20 -2
  121. package/types/src/collections/index.d.ts +1 -0
  122. package/types/src/comment/Comment.d.ts +159 -0
  123. package/types/src/comment/CommentCollection.d.ts +40 -0
  124. package/types/src/comment/IComment.d.ts +319 -48
  125. package/types/src/comment/ICommentCollection.d.ts +90 -0
  126. package/types/src/comment/_CommentUtils.d.ts +28 -0
  127. package/types/src/comment/index.d.ts +1 -0
  128. package/types/src/condition/AnchoredConditional.d.ts +76 -17
  129. package/types/src/condition/BuiltInOperators/AbstractOperator.d.ts +8 -7
  130. package/types/src/condition/BuiltInOperators/EqualToOperator.d.ts +2 -1
  131. package/types/src/condition/BuiltInOperators/ExpressionOperator.d.ts +3 -6
  132. package/types/src/condition/BuiltInOperators/InSetOperator.d.ts +1 -1
  133. package/types/src/condition/BuiltinSelectors/BaseSelector.d.ts +7 -0
  134. package/types/src/condition/BuiltinSelectors/ListSelector.d.ts +9 -0
  135. package/types/src/condition/Condition.d.ts +16 -0
  136. package/types/src/condition/ICondition.d.ts +86 -33
  137. package/types/src/condition/_ConditionFormula.d.ts +152 -0
  138. package/types/src/condition/_ConditionUtils.d.ts +73 -10
  139. package/types/src/conditionalFormat/ConditionalFormat.d.ts +21 -10
  140. package/types/src/conditionalFormat/ConditionalFormatCollection.d.ts +19 -8
  141. package/types/src/conditionalFormat/IConditionalFormat.d.ts +5 -3
  142. package/types/src/conditionalFormat/IConditionalFormatCollection.d.ts +2 -0
  143. package/types/src/dataValidation/DataValidation.d.ts +50 -3
  144. package/types/src/dataValidation/DataValidationCollection.d.ts +20 -9
  145. package/types/src/dataValidation/IDataValidation.d.ts +119 -30
  146. package/types/src/dataValidation/IDataValidationCollection.d.ts +10 -2
  147. package/types/src/date/DateUtils.d.ts +20 -0
  148. package/types/src/date/_DateUtils.d.ts +91 -7
  149. package/types/src/externalBook/ExternalBookCollection.d.ts +145 -12
  150. package/types/src/externalBook/ExternalBookName.d.ts +96 -0
  151. package/types/src/externalBook/IExternalBook.d.ts +170 -18
  152. package/types/src/externalBook/IExternalBookCollection.d.ts +79 -7
  153. package/types/src/externalBook/index.d.ts +1 -0
  154. package/types/src/fill/IStroke.d.ts +1 -1
  155. package/types/src/filter/IFilter.d.ts +29 -4
  156. package/types/src/font/IFont.d.ts +17 -0
  157. package/types/src/history/IHistory.d.ts +3 -2
  158. package/types/src/i18n/LanguagePack.d.ts +12 -4
  159. package/types/src/index.d.ts +3 -0
  160. package/types/src/io/AbstractBackingStore.d.ts +24 -1
  161. package/types/src/io/ArrayBackingStore.d.ts +1 -1
  162. package/types/src/io/EmbeddedPart.d.ts +20 -0
  163. package/types/src/io/IEmbeddedPart.d.ts +63 -0
  164. package/types/src/io/IWorkbookIO.d.ts +185 -18
  165. package/types/src/io/WorkbookIO.d.ts +9 -0
  166. package/types/src/io/WorkbookOrigin.d.ts +20 -11
  167. package/types/src/io/WorkbookOriginProvider.d.ts +46 -0
  168. package/types/src/io/_XmlFragment.d.ts +49 -0
  169. package/types/src/io/index.d.ts +1 -0
  170. package/types/src/lib/file/file.browser.d.ts +19 -5
  171. package/types/src/lib/file/file.node.d.ts +5 -0
  172. package/types/src/lib/utils/_Utils.d.ts +11 -0
  173. package/types/src/lib/utils/utils.browser.d.ts +9 -3
  174. package/types/src/license/license-key.d.ts +27 -0
  175. package/types/src/listener/IListener.d.ts +12 -7
  176. package/types/src/listener/ListenerEmitter.d.ts +46 -5
  177. package/types/src/model/AbstractModel.d.ts +14 -5
  178. package/types/src/movable/Control.d.ts +57 -0
  179. package/types/src/movable/IControl.d.ts +84 -0
  180. package/types/src/movable/IMovable.d.ts +23 -1
  181. package/types/src/movable/IMovableCollection.d.ts +2 -0
  182. package/types/src/movable/Movable.d.ts +4 -6
  183. package/types/src/movable/MovableCollection.d.ts +7 -7
  184. package/types/src/movable/index.d.ts +4 -0
  185. package/types/src/named/AbstractNamed.d.ts +1 -1
  186. package/types/src/named/INamed.d.ts +4 -1
  187. package/types/src/named/INamedCollection.d.ts +26 -0
  188. package/types/src/named/NamedCollection.d.ts +16 -15
  189. package/types/src/numFmt/BuiltInFormats.d.ts +15 -7
  190. package/types/src/numFmt/IFormatEngine.d.ts +2 -0
  191. package/types/src/numFmt/NumfmtFormatEngine.d.ts +2 -0
  192. package/types/src/person/IPerson.d.ts +99 -0
  193. package/types/src/person/IPersonCollection.d.ts +51 -0
  194. package/types/src/person/Person.d.ts +32 -0
  195. package/types/src/person/PersonCollection.d.ts +49 -0
  196. package/types/src/person/index.d.ts +3 -0
  197. package/types/src/picture/IPicture.d.ts +2 -0
  198. package/types/src/picture/Picture.d.ts +2 -0
  199. package/types/src/pivot/IPivotTable.d.ts +107 -0
  200. package/types/src/pivot/IPivotTableCollection.d.ts +25 -0
  201. package/types/src/pivot/PivotTable.d.ts +57 -0
  202. package/types/src/pivot/PivotTableCollection.d.ts +25 -0
  203. package/types/src/pivot/index.d.ts +6 -0
  204. package/types/src/primitives/CompositeRangeStats.d.ts +2 -0
  205. package/types/src/primitives/Criteria.d.ts +1 -1
  206. package/types/src/primitives/LambdaBrand.d.ts +21 -0
  207. package/types/src/primitives/PrimitiveUtils.d.ts +56 -19
  208. package/types/src/primitives/Range.d.ts +102 -24
  209. package/types/src/primitives/RangeStats.d.ts +24 -1
  210. package/types/src/primitives/ReferenceRange.d.ts +42 -0
  211. package/types/src/primitives/Runtime.d.ts +15 -2
  212. package/types/src/primitives/stats/FrequencyStats.d.ts +9 -0
  213. package/types/src/primitives/stats/LookupIndex.d.ts +46 -0
  214. package/types/src/primitives/stats/SortedNumbers.d.ts +2 -0
  215. package/types/src/primitives/stats/index.d.ts +1 -0
  216. package/types/src/print/IPrint.d.ts +0 -22
  217. package/types/src/protectedRange/IProtectedRange.d.ts +4 -0
  218. package/types/src/protectedRange/IProtectedRangeCollection.d.ts +2 -0
  219. package/types/src/protectedRange/ProtectedRange.d.ts +1 -4
  220. package/types/src/protectedRange/ProtectedRangeCollection.d.ts +19 -8
  221. package/types/src/protection/DefaultProtection.d.ts +12 -1
  222. package/types/src/protection/IProtection.d.ts +36 -2
  223. package/types/src/reference/ReferenceUtils.d.ts +80 -0
  224. package/types/src/reference/index.d.ts +2 -0
  225. package/types/src/resource/IResource.d.ts +21 -1
  226. package/types/src/resource/IResourceCollection.d.ts +9 -1
  227. package/types/src/resource/ResourceCollection.d.ts +6 -6
  228. package/types/src/scripting/FunctionCollection.d.ts +41 -11
  229. package/types/src/scripting/IFunctionCollection.d.ts +41 -0
  230. package/types/src/scripting/IModule.d.ts +25 -0
  231. package/types/src/scripting/IModuleCollection.d.ts +17 -0
  232. package/types/src/scripting/IScript.d.ts +18 -0
  233. package/types/src/scripting/Module.d.ts +34 -6
  234. package/types/src/scripting/ModuleCollection.d.ts +17 -12
  235. package/types/src/scripting/Runtime.d.ts +15 -0
  236. package/types/src/scripting/Scripts.d.ts +2 -0
  237. package/types/src/scripting/TypedFunction.d.ts +151 -18
  238. package/types/src/scripting/_FunctionIndex.d.ts +5 -0
  239. package/types/src/scripting/_ModuleUtils.d.ts +11 -1
  240. package/types/src/scripting/_ScriptUtils.d.ts +3 -0
  241. package/types/src/scripting/declarations.browser.d.ts +10 -0
  242. package/types/src/scripting/declarations.d.ts +49 -0
  243. package/types/src/scripting/declarations.node.d.ts +9 -0
  244. package/types/src/scripting/index.d.ts +3 -0
  245. package/types/src/selection/IRangeSelection.d.ts +9 -4
  246. package/types/src/selection/RangeSelection.d.ts +2 -0
  247. package/types/src/shape/IShape.d.ts +41 -3
  248. package/types/src/shape/Shape.d.ts +10 -0
  249. package/types/src/shape/_ShapeXml.d.ts +28 -0
  250. package/types/src/sheet/CellRegion.d.ts +6 -0
  251. package/types/src/sheet/ICellContainerOptions.d.ts +50 -0
  252. package/types/src/sheet/ISheet.d.ts +224 -41
  253. package/types/src/sheet/ISheetCollection.d.ts +2 -5
  254. package/types/src/sheet/NamedCellRange.d.ts +16 -7
  255. package/types/src/sheet/Sheet.d.ts +749 -114
  256. package/types/src/sheet/SheetCell.d.ts +81 -21
  257. package/types/src/sheet/SheetCollection.d.ts +19 -8
  258. package/types/src/sheet/SheetRange.d.ts +62 -14
  259. package/types/src/sheet/SheetRanges.d.ts +4 -6
  260. package/types/src/sheet/_CellBuffer.d.ts +214 -0
  261. package/types/src/sheet/_InvalidSheetRange.d.ts +5 -5
  262. package/types/src/sheet/_ListenerAnchor.d.ts +104 -0
  263. package/types/src/sheet/_RangeStateSweep.d.ts +16 -0
  264. package/types/src/sheet/_ScalarListFactory.d.ts +61 -0
  265. package/types/src/sheet/_SheetAutoFillUtils.d.ts +74 -0
  266. package/types/src/sheet/_SheetAutoFitUtils.d.ts +2 -2
  267. package/types/src/sheet/_SheetEvents.d.ts +43 -0
  268. package/types/src/sheet/_SheetFilterUtils.d.ts +32 -1
  269. package/types/src/sheet/_SheetIntents.d.ts +250 -0
  270. package/types/src/sheet/_SheetMutations.d.ts +179 -59
  271. package/types/src/sheet/_SheetStateReader.d.ts +16 -10
  272. package/types/src/sheet/_SheetStateTypes.d.ts +57 -73
  273. package/types/src/sheet/_SheetUtils.d.ts +2 -18
  274. package/types/src/sheet/_WatchAnchor.d.ts +93 -0
  275. package/types/src/sheet/spatial/HeldFormulaEntry.d.ts +36 -0
  276. package/types/src/sheet/spatial/index.d.ts +1 -0
  277. package/types/src/sheet/style/SheetCellStyle.d.ts +91 -64
  278. package/types/src/sheet/style/SheetDirectStyle.d.ts +16 -5
  279. package/types/src/sheet/style/_Resolvers.d.ts +5 -3
  280. package/types/src/sheet/style/_StyleUtils.d.ts +37 -7
  281. package/types/src/sheetHeader/ISheetHeader.d.ts +2 -0
  282. package/types/src/sheetHeader/SheetHeader.d.ts +14 -0
  283. package/types/src/sheetProtection/ISheetProtection.d.ts +41 -7
  284. package/types/src/sheetProtection/SheetProtection.d.ts +12 -0
  285. package/types/src/sheetView/ISheetView.d.ts +45 -1
  286. package/types/src/sheetView/SheetView.d.ts +11 -0
  287. package/types/src/slicer/ISlicer.d.ts +2 -0
  288. package/types/src/slicer/Slicer.d.ts +2 -0
  289. package/types/src/sort/ISort.d.ts +2 -0
  290. package/types/src/string/IStringCollection.d.ts +5 -0
  291. package/types/src/string/StringCollection.d.ts +6 -6
  292. package/types/src/style/INamedStyleCollection.d.ts +72 -0
  293. package/types/src/style/IStyle.d.ts +30 -10
  294. package/types/src/style/IStyleCollection.d.ts +63 -42
  295. package/types/src/style/ITableStyleCollection.d.ts +89 -0
  296. package/types/src/style/NamedStyleCollection.d.ts +39 -0
  297. package/types/src/style/StyleCollection.d.ts +41 -5
  298. package/types/src/style/TableStyleCollection.d.ts +49 -0
  299. package/types/src/style/_BuiltInStyleDefs.d.ts +3 -3
  300. package/types/src/style/index.d.ts +4 -0
  301. package/types/src/table/AnchoredTable.d.ts +644 -68
  302. package/types/src/table/AutoTable.d.ts +5 -5
  303. package/types/src/table/ITable.d.ts +228 -30
  304. package/types/src/table/ITableCollection.d.ts +2 -0
  305. package/types/src/table/TableCollection.d.ts +19 -8
  306. package/types/src/table/_FilterField.d.ts +7 -5
  307. package/types/src/table/_NamedTable.d.ts +17 -1
  308. package/types/src/table/_NamedTableSource.d.ts +1 -0
  309. package/types/src/table/_SortField.d.ts +2 -0
  310. package/types/src/table/_TableColumn.d.ts +13 -2
  311. package/types/src/table/_TableMessages.d.ts +1 -0
  312. package/types/src/table/_TableUtils.d.ts +40 -0
  313. package/types/src/text/Bullet.d.ts +4 -0
  314. package/types/src/text/ITextFrame.d.ts +25 -1
  315. package/types/src/text/TextBoxAlignment.d.ts +15 -6
  316. package/types/src/text/TextFrame.d.ts +4 -0
  317. package/types/src/text/TextLine.d.ts +4 -0
  318. package/types/src/text/TextParagraph.d.ts +4 -0
  319. package/types/src/text/TextRun.d.ts +9 -0
  320. package/types/src/text/TextStacked.d.ts +83 -0
  321. package/types/src/text/index.d.ts +1 -0
  322. package/types/src/theme/ITheme.d.ts +2 -0
  323. package/types/src/theme/IThemeCollection.d.ts +2 -0
  324. package/types/src/theme/ThemeCollection.d.ts +8 -7
  325. package/types/src/transaction/ITransaction.d.ts +238 -36
  326. package/types/src/transaction/Transaction.d.ts +99 -11
  327. package/types/src/type/AbstractCollection.d.ts +101 -0
  328. package/types/src/type/ICollection.d.ts +117 -0
  329. package/types/src/type/ITypes.d.ts +9 -7
  330. package/types/src/type/index.d.ts +1 -0
  331. package/types/src/utils/_CSSUtils.d.ts +3 -3
  332. package/types/src/workbook/IWorkbook.d.ts +171 -40
  333. package/types/src/workbook/Workbook.d.ts +103 -7
  334. package/types/src/workbook/_WorkbookIntents.d.ts +36 -0
  335. package/types/src/workbookProtection/IWorkbookProtection.d.ts +7 -0
  336. package/types/src/workbookProtection/WorkbookProtection.d.ts +3 -0
  337. package/types/src/workbookView/IWorkbookView.d.ts +12 -0
  338. package/types/src/workbookView/WorkbookView.d.ts +5 -0
  339. package/browser/cjs/BatsV2UUraVDCRXm.cjs +0 -57
  340. package/browser/cjs/CUz53T65cRGQRgvv.cjs +0 -33
  341. package/browser/cjs/DU0kYUtdFa3jK-im.cjs +0 -1
  342. package/browser/cjs/Dv4yIPLV98M5zLHa.cjs +0 -1
  343. package/browser/esm/6JKSOvc5czaQB2Bj.mjs +0 -109
  344. package/browser/esm/BtuJ9AGzeURtAsGo.mjs +0 -51241
  345. package/browser/esm/DGU6sM25u0EWCKl1.mjs +0 -824
  346. package/browser/esm/f2G3QRgEbvFJcoa2.mjs +0 -4436
  347. package/node/esm/-pxdn3M3tc6PLHs7.mjs +0 -114
  348. package/node/esm/0n5bslM9jhO1JnI2.mjs +0 -843
  349. package/types/src/cellRange/_GraphNode.d.ts +0 -38
  350. package/types/src/dataValidation/_Utils.d.ts +0 -10
  351. package/types/src/sheet/listener/RangesListener.d.ts +0 -32
  352. package/types/src/sheet/listener/RangesListenerEntry.d.ts +0 -19
  353. package/types/src/sheet/listener/index.d.ts +0 -3
@@ -1,4 +1,4 @@
1
- import { FormulaError, IRange, Scalar, IRuntime } from '@sheetxl/primitives';
1
+ import { IRange, Scalar, IRuntime } from '@sheetxl/primitives';
2
2
  import { ITransaction } from '../transaction';
3
3
  import { IListener } from '../listener';
4
4
  import { IModel } from '../model';
@@ -6,6 +6,7 @@ import { IFunctionCollection } from '../scripting';
6
6
  import { ICellRange, ICellRanges } from '../cellRange';
7
7
  import { INamed } from '../named';
8
8
  import { INamedFormulasCollection } from './INamedFormulasCollection';
9
+ import { IExternalBookCollection } from '../externalBook';
9
10
  /**
10
11
  * Calculation is the process of computing formulas and then displaying the results
11
12
  * as values in the cells that contain the formulas.
@@ -35,17 +36,34 @@ export interface ICalculation extends IModel {
35
36
  */
36
37
  stop: () => Promise<void>;
37
38
  /**
38
- * Returns when all calculations are complete and there are no pending calculations.
39
+ * Resolves once the engine is running and idle: its calculation state is
40
+ * {@link ICalculation.CalculationState.Done}, or {@link ICalculation.CalculationState.Pending} in
41
+ * manual mode.
39
42
  *
40
43
  * @remarks
41
- * * This is useful when needing to ensure that the values in the calculation cycle are up-to-date.
42
- * * For streaming functions still will return the current value.
44
+ * * After it, every answer the engine owes has landed: a formula written before it reads as
45
+ * compiled, and its value is current (in automatic mode).
46
+ * * Manual mode does not wait for a recalculation nobody has asked for; call {@link calculate}.
47
+ * * A streaming or async function's result in flight is not waited for: its cell reads as the
48
+ * current value until the result arrives.
49
+ * * Starts the engine if it is {@link ICalculation.Status.Off}. An engine in
50
+ * {@link ICalculation.Status.Error} is not started; {@link start} tries again.
51
+ *
52
+ * @param options Pass `{ full: true }` to recalculate every grid rather than only the dirty ones.
43
53
  */
44
- ready(): Promise<ICalculation.Status>;
54
+ ready(options?: ICalculation.CalculateOptions): Promise<ICalculation.Status>;
45
55
  /**
46
- * Returns the current status of the calculation engine.
56
+ * Returns the current status of the calculation engine: whether it is running at all.
47
57
  */
48
58
  getStatus(): ICalculation.Status;
59
+ /**
60
+ * Whether the running engine has work in hand - Excel's `Application.CalculationState`.
61
+ *
62
+ * @remarks
63
+ * Meaningful while {@link ICalculation.Status.Running}; `Calculating` while starting, `Done`
64
+ * otherwise. See {@link ICalculation.CalculationState}.
65
+ */
66
+ getCalculationState(): ICalculation.CalculationState;
49
67
  /**
50
68
  * Returns the functions available for the calculation engine.
51
69
  */
@@ -54,19 +72,40 @@ export interface ICalculation extends IModel {
54
72
  * Returns the named formulas available in the calculation engine.
55
73
  */
56
74
  getNamedFormulas(): INamedFormulasCollection;
75
+ /**
76
+ * The workbook's external books — the `[n]` a formula cites — in position order.
77
+ *
78
+ * @remarks
79
+ * Owned by the engine, as defined names are: a book is a symbol formulas bind into, and which
80
+ * formulas cite a book is the engine's index. Also reachable as `IWorkbook.getExternalBooks()`.
81
+ */
82
+ getExternalBooks(): IExternalBookCollection;
57
83
  /** @inheritdoc IFormulaContext.getRuntime */
58
84
  getRuntime(): IRuntime;
59
85
  /**
60
86
  * Parses a formula expression and returns a *transient* formula object.
61
87
  *
88
+ * @param expression The formula expression, with or without a leading `=`.
89
+ * @param coords Optional anchor coordinates.
90
+ * @param options Optional parse options.
91
+ *
62
92
  * @remarks
63
93
  * - This does **not** register the formula in the workbook or dependency graph.
94
+ * - The expression is read as storage text (English function names, `,` separators) unless
95
+ * `options.target` is `'display'` — text a user typed in their language and locale.
64
96
  * - Use it for:
65
97
  * - interactive editing (tooltips, watches, function help)
66
98
  * - condition / validation expressions
67
99
  * - ad-hoc “what-if” evaluations
100
+ *
101
+ * @example
102
+ * ```typescript
103
+ * calculation.createFormula('SUM(A1,1.5)');
104
+ * // With a German language pack active:
105
+ * calculation.createFormula('SUMME(A1;1,5)', undefined, { target: 'display' });
106
+ * ```
68
107
  */
69
- createFormula(expression: string, coords?: Partial<IRange.CellCoords>): ICalculation.IFormula;
108
+ createFormula(expression: string, coords?: Partial<IRange.CellCoords>, options?: ICalculation.CreateFormulaOptions): ICalculation.IFormula;
70
109
  /**
71
110
  * Evaluates a expression in the context of the sheet and returns the resulting value.
72
111
  *
@@ -75,8 +114,9 @@ export interface ICalculation extends IModel {
75
114
  *
76
115
  * @remarks
77
116
  * This is similar convenience method for `getCalculation().createFormula(expression).evaluate(options)`.
117
+ * The expression is read as storage text unless `options.target` is `'display'`.
78
118
  */
79
- evaluate(expression: string, options?: number | ICalculation.EvaluateOptions & Partial<IRange.CellCoords>): Promise<Scalar | IRange>;
119
+ evaluate(expression: string, options?: number | ICalculation.EvaluateOptions & Partial<IRange.CellCoords> & ICalculation.CreateFormulaOptions): Promise<Scalar | IRange>;
80
120
  /**
81
121
  * When the engine recalculates on its own — Excel's Calculation Options.
82
122
  *
@@ -141,6 +181,8 @@ export interface ICalculation extends IModel {
141
181
  * {@link IListener.ISource.addListeners}
142
182
  */
143
183
  addListeners(listeners: ICalculation.IListeners, options?: IListener.Options): IListener.Remove;
184
+ /** For runtime type checking. */
185
+ readonly isICalculation: true;
144
186
  }
145
187
  /**
146
188
  * {@inheritDoc ICalculation}
@@ -235,13 +277,27 @@ export declare namespace ICalculation {
235
277
  * `maxIterateChange` in the last sweep. Always `false` with iteration off.
236
278
  */
237
279
  isConverged(): boolean;
238
- /** How many sweeps the last evaluation ran — up to the workbook's `maxIterations`. */
280
+ /** How many sweeps the last evaluation ran — up to the workbook's `maxIteration`. */
239
281
  getIterationCount(): number;
240
282
  /**
241
- * The largest change any member made in the last sweep — what stopped the iteration when
242
- * {@link isConverged}, what it never got under when not. `0` with iteration off.
283
+ * The largest change any member of THIS cycle made in the last sweep — what stopped the
284
+ * iteration when {@link isConverged}, what it never got under when not. `0` with iteration off.
285
+ *
286
+ * @remarks
287
+ * Convergence is decided across every cycle at once, as Excel decides it, so a cycle can stop
288
+ * on the cap because a different one would not settle. This number is still its own.
243
289
  */
244
290
  getLastChange(): number;
291
+ /**
292
+ * The same for the sweep before the last, or `NaN` when there was only one (and with iteration
293
+ * off).
294
+ *
295
+ * @remarks
296
+ * Read beside {@link getLastChange} it says whether a run that hit the cap was getting
297
+ * anywhere: a change that shrank between the two sweeps settles at a higher `maxIteration`,
298
+ * one that held or grew does not settle at any.
299
+ */
300
+ getPreviousChange(): number;
245
301
  }
246
302
  /**
247
303
  * Represents a formula that can be evaluated.
@@ -255,8 +311,27 @@ export declare namespace ICalculation {
255
311
  evaluate(options?: number | ICalculation.EvaluateOptions): Promise<Scalar | IRange>;
256
312
  /**
257
313
  * Returns the status.
314
+ *
315
+ * @remarks
316
+ * `Pending` for a formula the engine has not compiled yet (see {@link isCompiled}).
258
317
  */
259
318
  getCalculationStatus(): ICalculation.ResultStatus;
319
+ /**
320
+ * Whether the calculation engine has compiled this formula.
321
+ *
322
+ * @remarks
323
+ * A formula is model state: it is stored, and reads back, the moment it is set - in every
324
+ * engine state, a stopped or never-started one included. The COMPILED body arrives when the
325
+ * engine gets to it. Until then this is `false`; {@link getExpression} answers from the text as
326
+ * written, {@link getTokens} is empty, {@link getReferences} is `null`, a reference edit
327
+ * throws, and {@link evaluate} waits for a `Starting` engine and rejects on an `Off` one rather
328
+ * than starting it. The handle heals: it reads the engine's block the first time one exists, so
329
+ * one taken cold is fully functional once the engine has compiled the cell.
330
+ *
331
+ * A formula created detached ({@link ICalculation.createFormula}) or a defined name is
332
+ * compiled on creation and is always `true`.
333
+ */
334
+ isCompiled(): boolean;
260
335
  /**
261
336
  * Return the formula's expression — the text WITHOUT a leading `=`.
262
337
  *
@@ -267,11 +342,18 @@ export declare namespace ICalculation {
267
342
  * shape, which is what OOXML `<f>` and `<definedName>` hold and what {@link setExpression}
268
343
  * takes back, so read/modify/write needs no adjusting in between.
269
344
  *
270
- * Displaying a formula means prefixing `'=' +` — Excel's own API answers that prefixed form
271
- * (`Range.Formula`, `Name.RefersTo`) because ITS setters treat the `=` as the formula-ness
272
- * marker: assigning `Range.Formula = "SUM(1,2)"` stores text. Ours do not — every entry point
273
- * accepts the expression with or without it — so the prefix is presentation, and belongs at
274
- * the point of display rather than in a second accessor.
345
+ * The form with the leading `=` — what Excel's API answers (`Range.Formula`) and what a cell
346
+ * is entered with — is {@link ICell.getFormulaText}.
347
+ *
348
+ * The text is the storage form (English names, `,` separators) whatever language or locale is
349
+ * active. For the form a person reads or edits, pass `{ target: 'display' }`.
350
+ *
351
+ * @example
352
+ * ```typescript
353
+ * // With a German language pack active:
354
+ * formula.getExpression(); // 'SUM(A1,1.5)'
355
+ * formula.getExpression({ target: 'display' }); // 'SUMME(A1;1,5)'
356
+ * ```
275
357
  */
276
358
  getExpression(options?: ICalculation.FormulaTextOptions): string;
277
359
  /**
@@ -334,7 +416,7 @@ export declare namespace ICalculation {
334
416
  * This is the primary way to "refactor" a formula—for example, if a user
335
417
  * drags a highlighted range in the UI to a new location.
336
418
  */
337
- setReferenceAt(index: number, reference: ICellRange.Address, options?: string | ITransaction.OperationOptions): this;
419
+ setReferenceAt(index: number, reference: ICellRange.Address, options?: string | ITransaction.OperationOptions): Promise<this>;
338
420
  /**
339
421
  * Cycles the absolute/relative (`$`) style of the reference at the specified index.
340
422
  *
@@ -358,7 +440,7 @@ export declare namespace ICalculation {
358
440
  *
359
441
  * * This is the `F4 Cycle` behavior commonly found in spreadsheet editors.
360
442
  */
361
- setReferenceModeAt(index: number, side?: ICalculation.ReferenceSide, mode?: number, options?: string | ITransaction.OperationOptions): this;
443
+ setReferenceModeAt(index: number, side?: ICalculation.ReferenceSide, mode?: number, options?: string | ITransaction.OperationOptions): Promise<this>;
362
444
  /**
363
445
  * Returns true if the formula consists entirely of cell or range references and
364
446
  * range operators (`:`, ` `, `#`, etc.) with no function calls or computed expressions.
@@ -380,8 +462,10 @@ export declare namespace ICalculation {
380
462
  * - Named formulas where `isVolatile()` is true should not be used as
381
463
  * navigation targets even if `isReferenceOnly()` returns true, since their
382
464
  * resolved range may differ by context.
465
+ * - Asked of the engine: resolves in order behind the writes made before it, and `false`
466
+ * while the engine is `Off`.
383
467
  */
384
- isVolatile(): boolean;
468
+ isVolatile(): Promise<boolean>;
385
469
  /**
386
470
  * Return the formula as an array of tokenized values.
387
471
  *
@@ -408,8 +492,10 @@ export declare namespace ICalculation {
408
492
  * `null` when this formula is already {@link isValid | valid} or no safe correction exists.
409
493
  *
410
494
  * @remarks
411
- * Currently ONE deliberately narrow rule: append the missing trailing closers (`)`, `}`) —
412
- * `=SUM(A1:A2` → `=SUM(A1:A2)` — and only when the repaired text parses clean. A repair that
495
+ * Currently ONE deliberately narrow rule: append the missing trailing closers (`]`, `)`, `}`) —
496
+ * `=SUM(A1:A2` → `=SUM(A1:A2)`, `=SUM(Sales[Amount` → `=SUM(Sales[Amount])` — and only when the
497
+ * repaired text parses clean. Excel closes parens and braces but not a structured reference's
498
+ * brackets. A repair that
413
499
  * would still be invalid (`=SUM(` → `=SUM()` fails arity) is never returned, nor is anything
414
500
  * attempted for over-closed / interleaved brackets or an unterminated string. Never mutates
415
501
  * this formula. Interactive hosts call this at commit; programmatic writes (`setValue`, file
@@ -508,7 +594,7 @@ export declare namespace ICalculation {
508
594
  * index-aligned reference list (the `setReferenceAt` currency, `#REF!` slots included); this
509
595
  * is the graph answer.
510
596
  */
511
- getDirectPrecedents(): ICellRanges | null;
597
+ getDirectPrecedents(): Promise<ICellRanges | null>;
512
598
  /**
513
599
  * Everything upstream of this name — {@link getDirectPrecedents} walked to exhaustion.
514
600
  *
@@ -519,9 +605,10 @@ export declare namespace ICalculation {
519
605
  * CELL (`X = A1*2`, `A1 = SomeName`) is that cell's precedent, not this answer's — a tree
520
606
  * walk crosses it through the cell's own {@link ICell.getDirectPrecedents}.
521
607
  */
522
- getPrecedents(): ICellRanges | null;
608
+ getPrecedents(): Promise<ICellRanges | null>;
523
609
  /**
524
- * What references this SYMBOL — cells and names, one answer; `null` when nothing does.
610
+ * What references this SYMBOL — cells and names, one answer; `null` when nothing does. Asked of
611
+ * the engine, as {@link ICell.getDirectPrecedents} is.
525
612
  *
526
613
  * @remarks
527
614
  * **Symbol-level, not target-level.** `=SUM(Revenue)` is a dependent of `Revenue`;
@@ -546,7 +633,7 @@ export declare namespace ICalculation {
546
633
  * {@link ICell.getDirectDependents} does: a column of 400 formulas reading the name comes back
547
634
  * as one range. Name nodes lead, cells follow.
548
635
  */
549
- getDirectDependents(): ICellRanges | null;
636
+ getDirectDependents(): Promise<ICellRanges | null>;
550
637
  /**
551
638
  * The transitive downstream of this name — everything that would recalculate if its expression
552
639
  * changed, cells and names both.
@@ -561,17 +648,21 @@ export declare namespace ICalculation {
561
648
  * every cell downstream of either. A cycle terminates and reports the names on it, this one
562
649
  * included.
563
650
  */
564
- getDependents(): ICellRanges | null;
651
+ getDependents(): Promise<ICellRanges | null>;
565
652
  /**
566
653
  * Removes this named formula from its collection.
567
654
  */
568
655
  delete(): void;
569
656
  }
570
657
  /**
571
- * What a {@link FormulaTokenContext} names — the two constructs that open an argument
572
- * list, and the two registries that can resolve {@link FormulaTokenContext.name}.
658
+ * What a {@link FormulaTokenContext} names — the construct that opened the argument list.
659
+ *
660
+ * @remarks
661
+ * `'let'` and `'lambda'` are functions that also open a scope of {@link TokenType.Parameter} names;
662
+ * they are told apart here so an editor can find those names without matching a localized function
663
+ * name.
573
664
  */
574
- type FormulaTokenContextType = 'function' | 'table';
665
+ type FormulaTokenContextType = 'function' | 'table' | 'let' | 'lambda';
575
666
  /**
576
667
  * What a token sits INSIDE — the enclosing call and, for a token that is one, which argument.
577
668
  *
@@ -599,9 +690,39 @@ export declare namespace ICalculation {
599
690
  */
600
691
  argIndex: number;
601
692
  /**
602
- * Whether {@link name} is a function (`SUM(`) or a table (`Sales[`).
693
+ * Whether {@link name} is a function (`SUM(`), a table (`Sales[`), or a scope-opening `LET(` /
694
+ * `LAMBDA(`.
603
695
  */
604
696
  type: FormulaTokenContextType;
697
+ /**
698
+ * The `LET` / `LAMBDA` names in scope here, outermost first.
699
+ *
700
+ * @remarks
701
+ * In scope as the binder decides: a `LAMBDA` parameter in every later argument, a `LET` name from
702
+ * the argument after its value on. An inner declaration spelled the same (case-insensitively)
703
+ * replaces the outer one, with the inner spelling. Absent when no name is in scope.
704
+ */
705
+ bound?: readonly BoundName[];
706
+ }
707
+ /**
708
+ * A `LET` / `LAMBDA` name in scope — one entry of {@link FormulaTokenContext.bound}.
709
+ */
710
+ interface BoundName {
711
+ /** The name as declared. */
712
+ readonly name: string;
713
+ /**
714
+ * The parameters of the `LAMBDA` this name can be called as, in order.
715
+ *
716
+ * @remarks
717
+ * Present only for a `LET` name whose value is a literal `LAMBDA(…)` — `f` in
718
+ * `LET(f,LAMBDA(x,[y],x+y),f(1))`. Absent for a `LAMBDA` parameter, and for a `LET` name bound to
719
+ * anything else, including an expression that evaluates to a lambda (`IF(c,LAMBDA(…),LAMBDA(…))`).
720
+ * `optional` marks a bracketed declaration (`[y]`).
721
+ */
722
+ readonly params?: readonly {
723
+ readonly name: string;
724
+ readonly optional?: boolean;
725
+ }[];
605
726
  }
606
727
  /**
607
728
  * Which part of a reference a cell token is, relative to a range operator `:` — the signal
@@ -646,6 +767,43 @@ export declare namespace ICalculation {
646
767
  * Never set on a USE of the parameter, nor outside a `LAMBDA` declaration list.
647
768
  */
648
769
  readonly optional?: boolean;
770
+ /**
771
+ * `true` on a `parameter` token that DECLARES its name — `x` in `LET(x,1,x+1)`, `a` in
772
+ * `LAMBDA(a,a+1)` — rather than using it.
773
+ */
774
+ readonly declaration?: boolean;
775
+ }
776
+ /**
777
+ * The {@link FormulaToken.value} of a `tableColumn` or `tableSpecifier` token — one part inside a
778
+ * structured reference's brackets.
779
+ *
780
+ * @remarks
781
+ * A part's own brackets are `paren` tokens, like the reference's: `Sales[[#Data],[Qty]]` is
782
+ * `Sales` `[` `[` `#Data` `]` `,` `[` `Qty` `]` `]`, so a part token's `text` is the part alone.
783
+ */
784
+ interface TablePartRef {
785
+ /**
786
+ * The display name of the table the part belongs to.
787
+ *
788
+ * @remarks
789
+ * For an unqualified reference (`[@Qty]`), the table holding the formula's cell; `''` when there
790
+ * is none.
791
+ */
792
+ readonly table: string;
793
+ /**
794
+ * The column's display name, or the canonical specifier (`#Data`, `#This Row`).
795
+ */
796
+ readonly name: string;
797
+ /**
798
+ * Set only on the unfinished part of a structured reference still being typed — the part an
799
+ * editor completes — to what may finish it.
800
+ *
801
+ * @remarks
802
+ * `'column'` after `@` or once a column name has started; `'specifier'` once `#` is typed;
803
+ * `'any'` for a part not yet started. A part not yet started is an empty token (`text` `''`)
804
+ * right after the `[` or `@` that opened it.
805
+ */
806
+ readonly partial?: 'column' | 'specifier' | 'any';
649
807
  }
650
808
  /**
651
809
  * The {@link FormulaToken.value} of an error-REFERENCE token — `#REF!` or `#NAME?`, a reference
@@ -658,18 +816,19 @@ export declare namespace ICalculation {
658
816
  * (`PtgRefErr` vs `PtgRefErr3d`).
659
817
  *
660
818
  * Only error tokens that are REFERENCES take this shape. An error LITERAL (`#DIV/0!`, `#N/A`) is a
661
- * value, never scoped, and its `value` stays a plain {@link FormulaError}. Both arrive as
662
- * `type: 'error'`, so a consumer that wants the error either way reads `value.error ?? value`.
819
+ * value, never scoped, and its `value` is the label alone. Both arrive as `type: 'error'`, so a
820
+ * consumer that wants the label either way reads `value.error ?? value`, and
821
+ * `FormulaError.getBuiltInByLabel` turns it into the error.
663
822
  *
664
823
  * Reference-layer only: EVALUATION of a `#REF!` still produces the plain {@link FormulaError}, so
665
824
  * a cell value never holds one of these.
666
825
  */
667
826
  interface ErrorRef {
668
827
  /**
669
- * The error the dead reference resolves to — `#REF!` (deleted cells) or `#NAME?` (a stored
670
- * unresolvable name).
828
+ * The canonical label of the error the dead reference resolves to — `#REF!` (deleted cells) or
829
+ * `#NAME?` (a stored unresolvable name).
671
830
  */
672
- readonly error: FormulaError.Known;
831
+ readonly error: string;
673
832
  /**
674
833
  * The sheet name for a qualified error reference (`Data!#REF!`).
675
834
  *
@@ -682,6 +841,12 @@ export declare namespace ICalculation {
682
841
  }
683
842
  /**
684
843
  * Represents a portion of a formula for rendering typical in an editor.
844
+ *
845
+ * @remarks
846
+ * A token is plain data — no functions, no class instances — so a token array survives
847
+ * `JSON.stringify` and `structuredClone`, and can cross a worker or process boundary. What the parse
848
+ * knows about a token (its {@link FormulaToken.context}, the names in scope there, what an unfinished
849
+ * part may become) is carried on the token in that form, so every consumer reads the same answer.
685
850
  */
686
851
  interface FormulaToken {
687
852
  /**
@@ -693,10 +858,12 @@ export declare namespace ICalculation {
693
858
  *
694
859
  * @remarks
695
860
  * Reference tokens are structured — a `cell` token carries {@link IRange.FixableCellCoords},
696
- * a `named` token a {@link NamedRef}, and an error REFERENCE token (`#REF!`, `#NAME?`) an
861
+ * a `named` or `parameter` token a {@link NamedRef}, a `tableColumn` or `tableSpecifier` token a
862
+ * {@link TablePartRef}, and an error REFERENCE token (`#REF!`, `#NAME?`) an
697
863
  * {@link ErrorRef}, each holding its own sheet qualifier (`coords.scope` / `ref.scope`) so
698
864
  * serializers can re-emit `Sheet1!…`. Most other tokens (operators, function names, separators)
699
- * carry a string; literals carry their parsed value (number, boolean, error).
865
+ * carry a string; literals carry their parsed value (number, boolean), an error literal its
866
+ * canonical label (`#DIV/0!`).
700
867
  */
701
868
  value: string | IRange.FixableCellCoords | NamedRef | ErrorRef | any;
702
869
  /**
@@ -727,31 +894,17 @@ export declare namespace ICalculation {
727
894
  */
728
895
  evalIndex?: number;
729
896
  /**
730
- * `true` when this token is part of a reference *literal* — a cell (`A1`), a range operator that
731
- * binds one (`:`, ` `, `#`, `@`), a named reference, or a structured-reference part. Lets an editor
732
- * color the whole reference span (operators included) without enumerating token types.
733
- *
734
- * @remarks
735
- * Distinct from merely having a {@link referenceIndex}: a function that *returns* a reference (e.g.
736
- * `INDEX`, `OFFSET`) carries a `referenceIndex` but is **not** a reference literal, so `isReference`
737
- * is absent on its `function` token. Color by `referenceIndex` only when `isReference` is `true`.
738
- */
739
- isReference?: boolean;
740
- /**
741
- * `true` when this token is a **name-completion candidate** — an identifier that could be resolved
742
- * against the function / named-reference / table registries: a function name, a named reference, a
743
- * table reference, or a partial identifier still being typed (a trailing run in an `unparsed` tail).
744
- * The sibling of {@link isReference}: it lets an editor decide, from the caret's token alone, that an
745
- * autocomplete list belongs here — without re-scanning the raw text. Use the token's `text` as the
746
- * prefix to filter. Absent on non-candidate tokens (numbers, strings, cells, operators, punctuation).
747
- */
748
- isLookup?: boolean;
749
- /**
750
- * Indicates that the token is part of a reference.
897
+ * The reference *literal* this token is part of, as an offset into
898
+ * {@link ICalculation.IFormula.getReferences}. Tokens sharing an index are one reference span — an
899
+ * editor colors them as one unit.
751
900
  *
752
901
  * @remarks
753
- * * Multiple tokens can be part of the same reference.
754
- * * The referenceIndex will be the offset of the range in the {@link ICalculation.IFormula.getReferences} array.
902
+ * * Carried by a cell (`A1`), the range operator joining two cells (`:` in `A1:B2`), a spill anchor
903
+ * (`#`), an error reference (`#REF!`), and every part of a structured reference (`Sales[Col]`,
904
+ * brackets included).
905
+ * * Absent on a named reference (names stay uncolored, as in Excel), on a function that *returns* a
906
+ * reference (`INDEX`, `OFFSET`), and on an operator whose operands are not both cells
907
+ * (`A1:INDEX(…)`, `@A1`).
755
908
  */
756
909
  referenceIndex?: number;
757
910
  /**
@@ -806,10 +959,15 @@ export declare namespace ICalculation {
806
959
  * reference, a structured-reference part).
807
960
  */
808
961
  readonly isReference?: boolean;
962
+ /**
963
+ * The ROOT only: this formula came from a LEGACY (pre-dynamic-array) cell, so its whole tree
964
+ * evaluates in implicit-intersection VALUE mode.
965
+ */
966
+ readonly legacyIntersect?: boolean;
809
967
  }
810
968
  /**
811
- * A structural transform over a formula's AST — a visitor applied where formulas serialize
812
- * ({@link ISheet.ToJSONOptions.formulaTransform | toJSON}) or parse.
969
+ * A structural transform over a formula's tree: a visitor a file format applies to formula
970
+ * text as it reads or writes it ({@link FormulaText.transform}).
813
971
  *
814
972
  * @remarks
815
973
  * Called once for every node, children before parents (depth-first). Return a replacement
@@ -826,6 +984,21 @@ export declare namespace ICalculation {
826
984
  * side-effect free and no-op-safe on a partially parsed (errored) tree.
827
985
  */
828
986
  type FormulaTransform = (node: FormulaNode, parent: FormulaNode | undefined) => FormulaNode | void;
987
+ /**
988
+ * Who a formula's text is for.
989
+ *
990
+ * @remarks
991
+ * - `'storage'` — the form files, APIs and re-parses use: English function names, `,` argument
992
+ * separators, `.` decimals, English boolean and error words, and an external book as its `[n]`
993
+ * position. It reads the same in every language and locale.
994
+ * - `'display'` — the form a person reads and edits: function names, booleans, errors and
995
+ * structured-reference specifiers from the active language pack, separators from the workbook
996
+ * locale, and an external book as its own path (`'C:\dir\[Book.xlsx]Sheet1'!A1`).
997
+ *
998
+ * The same choice applies to text going in: {@link ICalculation.createFormula} reads storage
999
+ * text unless told the text is display.
1000
+ */
1001
+ type FormulaTarget = 'storage' | 'display';
829
1002
  /**
830
1003
  * Options for evaluating a formula.
831
1004
  */
@@ -862,14 +1035,30 @@ export declare namespace ICalculation {
862
1035
  * scalar unless {@link alwaysReturnRange} is set.
863
1036
  * - A cell whose evaluation errors carries the error as that cell's value; other
864
1037
  * cells are unaffected.
865
- * - Cells evaluate sequentially — an async cell (a formula hitting an async function)
866
- * settles before the next cell starts.
1038
+ * - Evaluated by the engine, in one pass, exactly as a formula filled across the shape.
867
1039
  * - Honored by temporary formulas ({@link ICalculation.evaluate} /
868
1040
  * {@link ICalculation.createFormula}); a committed cell formula ignores it.
869
1041
  * - Often used for "preview this formula over this region" or batched
870
1042
  * validation of an expression over a condition range.
871
1043
  */
872
1044
  block?: IRange.Coords;
1045
+ /**
1046
+ * With {@link block}: evaluate each cell of the block as an array-entered formula whose extent
1047
+ * is that one cell.
1048
+ *
1049
+ * @remarks
1050
+ * This is how a conditional-format or data-validation formula is evaluated. Nothing
1051
+ * implicitly intersects — a range reads as the whole array wherever it appears — and each
1052
+ * cell keeps the top-left value of its own result, the way an array-entered formula fits its
1053
+ * result to its extent. So `$J$1:$J$9="x"` answers `J1="x"` in every cell, while
1054
+ * `SUM(IF($J$1:$J$9="x",1,0))>1` still sums the whole array.
1055
+ *
1056
+ * By default a cell whose result is an array spills, as a formula filled across the block
1057
+ * would.
1058
+ *
1059
+ * @defaultValue `false`
1060
+ */
1061
+ arrayFirstCell?: boolean;
873
1062
  /**
874
1063
  * If specified, the result will always be returned as an `IRange`,
875
1064
  * even when the logical result is a single scalar value.
@@ -901,21 +1090,29 @@ export declare namespace ICalculation {
901
1090
  */
902
1091
  evalIndex?: number;
903
1092
  /**
904
- * If `true`, function names are returned in CANONICAL (English) form — the
905
- * persistence/interchange representation (files, clipboard interchange, APIs).
906
- * Default `false` = display form, localized via the active language pack
907
- * (I18N-DESIGN.md Plane 3).
1093
+ * Who the text is for.
908
1094
  *
909
- * @defaultValue `false`
1095
+ * @defaultValue `'storage'`
1096
+ *
1097
+ * @remarks
1098
+ * Pass `'display'` for text a person reads or edits. See {@link FormulaTarget}.
910
1099
  */
911
- canonical?: boolean;
1100
+ target?: FormulaTarget;
1101
+ }
1102
+ /**
1103
+ * Options for parsing formula text ({@link ICalculation.createFormula}, {@link ICalculation.evaluate}).
1104
+ */
1105
+ interface CreateFormulaOptions {
912
1106
  /**
913
- * A structural transform applied to the compiled AST before imaging — how a format
914
- * exporter (e.g. xlsx) applies its version-compatibility spellings.
1107
+ * What form the text is in.
915
1108
  *
916
- * @see {@link FormulaTransform}
1109
+ * @defaultValue `'storage'`
1110
+ *
1111
+ * @remarks
1112
+ * Pass `'display'` for text a person typed or read in their language and locale. See
1113
+ * {@link FormulaTarget}.
917
1114
  */
918
- formulaTransform?: FormulaTransform;
1115
+ target?: FormulaTarget;
919
1116
  }
920
1117
  interface Events extends IModel.Events {
921
1118
  /**
@@ -943,6 +1140,10 @@ export declare namespace ICalculation {
943
1140
  * Called when the calculation status has changed.
944
1141
  */
945
1142
  onStatusChange?(source: ICalculation): void;
1143
+ /**
1144
+ * Called when the calculation state has changed - see {@link ICalculation.getCalculationState}.
1145
+ */
1146
+ onCalculationStateChange?(source: ICalculation): void;
946
1147
  /**
947
1148
  * Called when a calculation is completed.
948
1149
  */
@@ -968,11 +1169,14 @@ export declare namespace ICalculation {
968
1169
  */
969
1170
  const Status: {
970
1171
  /**
971
- * The calculation engine is in manual mode and will only update cell values when a calculation is explicitly triggered.
1172
+ * The calculation engine is running: it follows the model and answers for it. Whether it has
1173
+ * work in hand is its calculation state (`getCalculationState()`), not this.
972
1174
  */
973
- readonly Ready: "ready";
1175
+ readonly Running: "running";
974
1176
  /**
975
- * The calculation engine has encountered an error and is unable to perform calculations.
1177
+ * The calculation engine failed to start and is unable to perform calculations. Unusable as
1178
+ * {@link ICalculation.Status.Off} is, but {@link ICalculation.ready} does not start it again;
1179
+ * {@link ICalculation.start} does.
976
1180
  * This status represents engine-level errors, separate from cell-level errors (which are represented as Scalar.Error values).
977
1181
  */
978
1182
  readonly Error: "error";
@@ -993,6 +1197,26 @@ export declare namespace ICalculation {
993
1197
  /**
994
1198
  * Represents the calculation mode of the engine, which determines when and how formulas are recalculated.
995
1199
  */
1200
+ /**
1201
+ * Whether the running engine has work in hand - Excel's `XlCalculationState`.
1202
+ */
1203
+ const CalculationState: {
1204
+ /**
1205
+ * Nothing is out of date and nothing is in flight.
1206
+ */
1207
+ readonly Done: "done";
1208
+ /**
1209
+ * Work is in hand: a pass running or owed, or answers the engine owes the model that have not
1210
+ * landed.
1211
+ */
1212
+ readonly Calculating: "calculating";
1213
+ /**
1214
+ * Changes have been made that need a recalculation, and none will run until one is asked for:
1215
+ * manual mode between an edit and {@link ICalculation.calculate}.
1216
+ */
1217
+ readonly Pending: "pending";
1218
+ };
1219
+ type CalculationState = typeof CalculationState[keyof typeof CalculationState];
996
1220
  const CalculationMode: {
997
1221
  /**
998
1222
  * In automatic calculation mode, the calculation engine automatically recalculates all dependent formulas
@@ -1020,9 +1244,9 @@ export declare namespace ICalculation {
1020
1244
  * @remarks
1021
1245
  * With it off a reference cycle evaluates to `0` and is reported as unresolved. With it on the
1022
1246
  * cells of the cycle are re-evaluated in turn, each read seeing the latest value, until no cell
1023
- * moved by {@link maxChange} or {@link maxIterations} sweeps ran — and the results persist into
1247
+ * moved by {@link maxChange} or {@link maxIteration} sweeps ran — and the results persist into
1024
1248
  * the next recalculation, which re-runs every cycle the way it re-runs `NOW()`: `=A1+1` in A1 is
1025
- * a counter that advances by `maxIterations` per recalc. A cycle that stops on the sweep cap is
1249
+ * a counter that advances by `maxIteration` per recalc. A cycle that stops on the sweep cap is
1026
1250
  * still reported ({@link ICircularReference.isConverged}); a converged one is not.
1027
1251
  *
1028
1252
  * Office Scripts calls the count `maxIteration`; the file format `iterateCount` / `iterateDelta`.
@@ -1037,7 +1261,7 @@ export declare namespace ICalculation {
1037
1261
  *
1038
1262
  * @defaultValue `100`
1039
1263
  */
1040
- maxIterations: number;
1264
+ maxIteration: number;
1041
1265
  /**
1042
1266
  * Sweeps stop early once every cell in the cycle moved by less than this. A non-numeric
1043
1267
  * change (text, error) never counts as settled.
@@ -1106,6 +1330,19 @@ export declare namespace ICalculation {
1106
1330
  scope?: string;
1107
1331
  }
1108
1332
  interface JSON {
1333
+ /**
1334
+ * The unmarked formulas were entered before dynamic arrays: every formula that is not an
1335
+ * array anchor evaluates in legacy implicit-intersection mode, where each call takes one
1336
+ * value from a range argument in a single-value slot.
1337
+ *
1338
+ * @remarks
1339
+ * What an xlsx file means by a plain `<f>`: Excel marks the formulas that need the dynamic
1340
+ * reading (`cm=` and `t="array"`, which load as `formulaArray`) and everything else is
1341
+ * legacy. Nothing in a formula's text says its era, so it is carried here, once for the
1342
+ * workbook, the way the file carries it. Content authored in the app leaves it unset. A
1343
+ * sheet pasted into another workbook takes that workbook's era.
1344
+ */
1345
+ legacyIntersect?: boolean;
1109
1346
  /**
1110
1347
  * Indicates whether the workbook has completed its last calculation cycle.
1111
1348
  *
@@ -1174,7 +1411,7 @@ export declare namespace ICalculation {
1174
1411
  * @remarks
1175
1412
  * This value is only used if `iterate` is set to `true`.
1176
1413
  */
1177
- maxIterations?: number;
1414
+ maxIteration?: number;
1178
1415
  /**
1179
1416
  * Defines the maximum change between iterations that must be reached before the iterative calculation stops.
1180
1417
  *