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

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/B0AS8k-hrSCBUlUY.cjs +1 -0
  3. package/browser/cjs/B308aXzcAYr1GN1c.cjs +1 -0
  4. package/browser/cjs/B44p8LIyxG3GtaGC.cjs +93 -0
  5. package/browser/cjs/{a0Z-SXs_N71CtqYb.cjs → D6YaqporVrSewZpm.cjs} +1 -1
  6. package/browser/cjs/DjWcveVCs0NFiKep.cjs +1 -0
  7. package/browser/cjs/index.cjs +2 -2
  8. package/browser/esm/-OKDZ9cUBtkgD4Zr.mjs +20 -0
  9. package/browser/esm/8Nw0lKc4ISs7hEJT.mjs +70223 -0
  10. package/browser/esm/{DlPMeIyxT9tG_WDk.mjs → BmEEyMxNzlbXG98H.mjs} +2 -2
  11. package/browser/esm/BtdDRkWn-zCV3oic.mjs +394 -0
  12. package/browser/esm/DaCTT4vda0m8Fnxo.mjs +8 -0
  13. package/browser/esm/{B0HS42a7lga1k1U_.mjs → DvFKKE72ZA02l8iF.mjs} +1 -1
  14. package/browser/esm/{uyWBMSIxMlt8n5Z3.mjs → Z-dzbKvqaxll9l_t.mjs} +2 -2
  15. package/browser/esm/index.mjs +871 -696
  16. package/licenses/dependencies.txt +204 -204
  17. package/node/esm/{Cku7XiUvw1xrRasi.mjs → BpMTlTrJLWh_wJ5H.mjs} +1 -1
  18. package/node/esm/D5quDVovf1zjYBgJ.mjs +28 -0
  19. package/node/esm/DP0M3_S_dwLwRMiA.mjs +403 -0
  20. package/node/esm/DTHN_EkuOscW3f3B.mjs +8 -0
  21. package/node/esm/index.mjs +54375 -39377
  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 +7094 -0
  26. package/types/scripting-enums.json +54 -8
  27. package/types/scripting.d.ts +6985 -1171
  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
@@ -0,0 +1,80 @@
1
+ /**
2
+ * The clone boundary: a test mode that treats the model/engine crossing as if it were a wire
3
+ * (DESIGN-CALC-SERVICE §11, goal G1, plan step 6).
4
+ *
5
+ * @remarks
6
+ * Every request into a grid and every {@link ICalcGrid.Results} out of one passes through here.
7
+ * With the mode `off` - always, outside a test - it is an identity call and costs nothing.
8
+ *
9
+ * Two things it finds, and they are different:
10
+ *
11
+ * - What a walk can see: a function, a class instance, a value `structuredClone` refuses or
12
+ * silently downgrades. Each is recorded as a {@link Violation} with the PATH it sat at, which
13
+ * is the point: a payload that degrades silently fails somewhere else entirely, and the path
14
+ * is what names the field to convert.
15
+ * - What only running can see: a reference the two sides SHARE. A walk cannot tell a run array
16
+ * the sheet also holds from one minted for the message; a clone does, because the sides stop
17
+ * agreeing. That is what `clone` mode is for, and why `audit` alone is not the exit criterion.
18
+ *
19
+ * Not a boundary for READS. `getValues`, `getFormulas`, `getSnapshot` and the graph walks answer
20
+ * synchronously out of engine objects; making them push or await is §11's list, not this one.
21
+ * This covers what is already message-shaped.
22
+ *
23
+ * @internal Test-mode only. Deliberately not exported from the barrel.
24
+ */
25
+ export declare namespace CloneBoundary {
26
+ /**
27
+ * `off` is the default and the only mode outside a test.
28
+ *
29
+ * `audit` records what would not survive the crossing and passes the ORIGINAL through, so a
30
+ * suite stays green and the run produces the list. `clone` substitutes the
31
+ * `structuredClone` - the real wire - and is the exit criterion for "ready for a worker".
32
+ */
33
+ type Mode = 'off' | 'audit' | 'clone';
34
+ /** What a value at a path does to a `structuredClone`. */
35
+ type ViolationKind =
36
+ /** A function or a symbol: `structuredClone` throws. */
37
+ 'function'
38
+ /** A class instance: cloned as a plain object, its methods gone, and nothing says so. */
39
+ | 'live'
40
+ /** An `Error` subclass: clones to a bare `Error` - the subclass and its own fields are lost. */
41
+ | 'downgraded';
42
+ interface Violation {
43
+ /** Which crossing: `'request:setInputs'`, `'results:onCalculated'`, ... */
44
+ where: string;
45
+ /** Where in the payload, with array indices collapsed: `results.formulaInserts[].value`. */
46
+ path: string;
47
+ kind: ViolationKind;
48
+ /** The constructor name, or `'function'` / `'symbol'`. */
49
+ type: string;
50
+ }
51
+ /** Thrown by `clone` mode when the payload cannot be cloned at all. */
52
+ class BoundaryError extends Error {
53
+ readonly violations: readonly Violation[];
54
+ constructor(where: string, violations: readonly Violation[], cause: unknown);
55
+ }
56
+ /** Sets the mode. Anything but a known mode (including `undefined`) is `off`. */
57
+ const setMode: (mode: string | null | undefined) => void;
58
+ const getMode: () => Mode;
59
+ /**
60
+ * Called once per DISTINCT violation (a payload of 50000 cells reports its field once), so a
61
+ * host can write the run's list somewhere a test runner does not swallow.
62
+ */
63
+ const setListener: (listener: ((violation: Violation) => void) | null) => void;
64
+ /** Every distinct violation seen since the mode was set. */
65
+ const getViolations: () => readonly Violation[];
66
+ const clearViolations: () => void;
67
+ /**
68
+ * A request on its way to a grid.
69
+ *
70
+ * @param where The request's `type`, for the report.
71
+ */
72
+ const request: <T>(request: T, where: string) => T;
73
+ /**
74
+ * An {@link ICalcGrid.Results} on its way back: a resolution, or a record the engine pushed.
75
+ *
76
+ * @param where Which of the two, for the report.
77
+ */
78
+ const results: <T>(results: T, where: string) => T;
79
+ }
80
+ //# sourceMappingURL=_CloneBoundary.d.ts.map
@@ -43,6 +43,32 @@ export interface ASTNode<T extends TokenType = TokenType, V = any> {
43
43
  * @see {@link ICalculation.FormulaToken.evalIndex}
44
44
  */
45
45
  evalIndex?: number;
46
+ /**
47
+ * Compile-time: the implicit-intersection MODE this call is evaluated in — `true` VALUE mode
48
+ * (a multi-cell reference at a single-value slot intersects with the formula cell), `false`
49
+ * ARRAY mode (it reads its first cell). Set on `Function` and `Call` nodes by
50
+ * `CompilerUtils.annotateImplicitIntersect` (DESIGN-IMPLICIT-INTERSECTION §2).
51
+ */
52
+ implicitIntersect?: boolean;
53
+ /**
54
+ * Compile-time: under a first-cell DEMAND (a block whose every cell is its own 1x1 array-entered
55
+ * extent — a conditional-format body), only element `[0,0]` of this node's result is ever read,
56
+ * so a lift or an operator here builds that one element. Set on every node reachable from the
57
+ * root through elementwise positions by `CompilerUtils.annotateFirstCell`
58
+ * (DESIGN-LIFT-AND-DEMAND §2); inert unless the block evaluating the formula demands it.
59
+ */
60
+ firstCell?: boolean;
61
+ /**
62
+ * The ROOT only: the formula came from a LEGACY cell, so `annotateImplicitIntersect` gives its
63
+ * WHOLE tree value mode instead of deriving a mode per node. Carried in from the reader's
64
+ * transform (`ICalculation.FormulaNode.legacyIntersect`); never persisted.
65
+ */
66
+ legacyIntersect?: boolean;
67
+ /**
68
+ * Compile-time memo: whether this expression is statically array-valued (a range, an array
69
+ * literal, an array-returning call, an operator over one). Read by the mode annotation.
70
+ */
71
+ arrayValued?: boolean;
46
72
  /**
47
73
  * For live editing. We may need to add original start/end offsets to align?
48
74
  *
@@ -102,6 +128,38 @@ export interface ASTNode<T extends TokenType = TokenType, V = any> {
102
128
  * accepted cost — design §3.4); only the eager VALUE resolution is skipped.
103
129
  */
104
130
  deferredResolve?: boolean;
131
+ /**
132
+ * Set by the compiler on an argument node that binds to a `Lazy` parameter: the ENGINE hands the
133
+ * body a handle over this subtree instead of its value.
134
+ *
135
+ * @remarks
136
+ * The subtree is absent from the eager execution list (the same carve-out a `LAMBDA` body gets)
137
+ * and is evaluated only if the call's answer turns out to be the handle. An `Empty` argument is
138
+ * never marked — an omitted comma is a value the caller supplied, and it marshals as one.
139
+ */
140
+ lazyArg?: boolean;
141
+ /**
142
+ * Set by the compiler on every node WITHIN a lazy argument's subtree, the root included. What
143
+ * the execution-list carve-out reads.
144
+ */
145
+ inLazy?: boolean;
146
+ /**
147
+ * Set by the compiler on a call node that has at least one {@link lazyArg} — so the hot argument
148
+ * loop pays one boolean for a feature almost no call uses.
149
+ */
150
+ hasLazyArgs?: boolean;
151
+ /**
152
+ * Set by the compiler on the ROOT of a deferred subtree — a `LAMBDA` body or a {@link lazyArg} —
153
+ * to the post-order execution list of that subtree, the root included: the same shape as
154
+ * `CompiledFormula.executions`, for the piece of the formula the eager pass leaves out.
155
+ *
156
+ * @remarks
157
+ * A nested root's nodes are on the nested list, not this one (its root node is here, and
158
+ * evaluating it closes over or defers what is underneath). A bound name executes wherever it
159
+ * sits; an unbound name (`deferredResolve`) is on the list too, since the eager reference pass
160
+ * skips it and resolving it is what the deferral is for.
161
+ */
162
+ deferred?: ASTNode[];
105
163
  /**
106
164
  * If ast had an error.
107
165
  *
@@ -1,6 +1,6 @@
1
1
  import { FormulaError, IFunction, IRuntime } from '@sheetxl/primitives';
2
2
  import { ICalculation } from '../ICalculation';
3
- import { ISymbolRegistry } from '../symbol';
3
+ import { ISymbolRegistry, SheetCtx } from '../symbol';
4
4
  import { TokenType } from '../TokenType';
5
5
  import { CompiledFormula, ParseError } from './Types';
6
6
  import { ASTNode } from './ASTTypes';
@@ -62,6 +62,30 @@ export declare function normalizeStructuredRefs(ast: ASTNode): ASTNode;
62
62
  * @returns A new AST (structurally shared where unchanged).
63
63
  */
64
64
  export declare function rewriteThisRowToAt(ast: ASTNode): ASTNode;
65
+ /**
66
+ * Collapses a table reference with EMPTY brackets to the bare table name: `Table1[]` → `Table1`.
67
+ *
68
+ * @remarks
69
+ * Both are the data body. Excel accepts either on entry and shows the bare name; on disk it writes
70
+ * `Table1[]`, which is io-xlsx's spelling. Commit-path only, the boundary {@link rewriteThisRowToAt}
71
+ * observes. A reference with no table name (`[]`) and an unterminated one are left alone.
72
+ *
73
+ * @returns A new AST (structurally shared where unchanged).
74
+ */
75
+ export declare function collapseEmptyStructuredRefs(ast: ASTNode): ASTNode;
76
+ /**
77
+ * Gives an unqualified structured reference (`[@Qty]`, `[#All]`) its table name: `Table1[@Qty]`.
78
+ *
79
+ * @remarks
80
+ * Linking already bound it to the table at the formula's cell; this drops the typed image that kept
81
+ * the name out of the text. Every reference is stored qualified, as Excel writes it. Which ones show
82
+ * without the name is decided at display time, from where the formula sits.
83
+ *
84
+ * Commit-path only, the boundary {@link rewriteThisRowToAt} observes: an editor keeps what was typed.
85
+ *
86
+ * @returns A new AST (structurally shared where unchanged).
87
+ */
88
+ export declare function qualifyStructuredRefs(ast: ASTNode): ASTNode;
65
89
  /**
66
90
  * Sorts the items inside every `TableReference` into Excel's canonical order — section specifiers
67
91
  * in band order (`#All` | `#Headers`, `#Data`, `#Totals`), then the column selector.
@@ -81,6 +105,55 @@ export declare function rewriteThisRowToAt(ast: ASTNode): ASTNode;
81
105
  * @returns A new AST (structurally shared where unchanged).
82
106
  */
83
107
  export declare function reorderStructuredRefItems(ast: ASTNode): ASTNode;
108
+ /**
109
+ * Annotates every call node with its implicit-intersection MODE (DESIGN-IMPLICIT-INTERSECTION §2,
110
+ * measured on Excel 16.0 by `probe-ii-propagation{,2,3}.ps1`): `true` is VALUE mode, where a
111
+ * multi-cell reference at a single-value slot intersects with the formula cell; `false` is ARRAY
112
+ * mode, where it reads its first cell. The mode is INHERITED — a call evaluates its arguments in
113
+ * the mode it was given — and set at four places only:
114
+ *
115
+ * - the root: array mode when the root expression is statically array-valued (`=LINEST(..)`,
116
+ * `=TRANSPOSE(..)`, `=A1:A3+0`), value mode when it is scalar (`=SUM(..)`, `=INDEX(..,1,1)`);
117
+ * - an operand of an operator, or the argument at a lifting scalar slot, when that operand is
118
+ * array-valued (the lift needs the whole array);
119
+ * - a `LAMBDA` body, always;
120
+ * - an array-entered block, at evaluation (`CalculationContext.isImplicitIntersect`).
121
+ *
122
+ * A LEGACY (pre-dynamic-array) formula skips all four: its WHOLE tree is value mode, which is the
123
+ * era's own regime (DESIGN-IMPLICIT-INTERSECTION §2, `probe-ii-propagation3.ps1` §I —
124
+ * `=SUM(LINEST(y,x,ref)+0)` intersects in a legacy cell where the operator would otherwise give
125
+ * the call array mode). It changes the answer for the LINEST family's logical slots ALONE: every
126
+ * other legacy site Excel spells with an `@`, which the reader's transform has already inserted,
127
+ * and the two slots that take no `@` either read their first cell in both eras (`N`, `T`) or
128
+ * intersect in both (`AGGREGATE`'s `k`).
129
+ *
130
+ * "Array-valued" is static: a range or array literal, a call whose declared return is an array or
131
+ * a reference, an operator over one, a pass-through (`IF`, `IFERROR`, …) over one, `INDEX` with a
132
+ * zero, empty or array index, a name or a lambda application (unknown, so array — what Excel does
133
+ * at the root). The two runtime refinements Excel makes (`INDEX` on a CELL holding 0, and a
134
+ * defined name taking the mode of its reference site) are not modelled here.
135
+ */
136
+ export declare function annotateImplicitIntersect(root: ASTNode, getFunction: ((name: string) => IFunction | null) | null | undefined, legacy?: boolean): void;
137
+ /**
138
+ * Annotates the nodes whose result is read only at element `[0,0]` when the formula is evaluated
139
+ * under a first-cell demand (DESIGN-LIFT-AND-DEMAND §2, PLAN-CF-BODY-DEMAND step 3): the body of a
140
+ * block whose every cell is its own 1x1 array-entered extent, which is how Excel evaluates a
141
+ * conditional-format formula.
142
+ *
143
+ * @remarks
144
+ * The demand starts at the root and is INHERITED through elementwise positions only — an operator
145
+ * that is not a reference operator, a one-element paren, a lifting scalar slot, an `any` slot
146
+ * (`IF`/`IFS`/`SWITCH`/`CHOOSE` arms, which size and sample in the lift), a `LET` body. At each of
147
+ * those `[0,0]` of the output depends only on `[0,0]` of each operand, and `(0,0)` is never a pad,
148
+ * so computing one element is computing `[0,0]`. It stops (`false`) at every other position: a
149
+ * range, array, reference-only, lambda or flattened slot takes its argument whole (`SUM` still sees
150
+ * the array), and so do a reference operator, `@`, a name, a lambda body and a `LET` binding (a
151
+ * binding may be read under an aggregate).
152
+ *
153
+ * Idempotent and a property of the tree alone, so a compiled formula shared by several blocks
154
+ * carries it harmlessly: nothing reads it unless the block evaluating the formula demands it.
155
+ */
156
+ export declare function annotateFirstCell(root: ASTNode, getFunction: ((name: string) => IFunction | null) | null | undefined): void;
84
157
  export declare function compileAST(runtime: IRuntime, symbols: ISymbolRegistry | undefined, original: ASTNode, preserveExpression?: boolean, error?: ParseError | null, getFunction?: ((name: string) => IFunction | null) | null): CompiledFormula;
85
158
  /**
86
159
  * Convert a chevrotain error into a {@link FormulaError.Parse}.
@@ -278,6 +351,16 @@ export declare const findInvalidCallee: (root: ASTNode, getFunction: ((name: str
278
351
  * registry path stay exactly as they were.
279
352
  */
280
353
  export declare function rewriteUnknownFunctionCalls(root: ASTNode, getFunction: ((name: string) => IFunction | null) | null): ASTNode;
354
+ /**
355
+ * `bound` with `name` added last — an inner declaration replaces an outer one spelled the same
356
+ * (case-insensitively). Builds {@link ICalculation.FormulaTokenContext.bound}.
357
+ */
358
+ export declare function appendBound(bound: readonly ICalculation.BoundName[] | undefined, entry: ICalculation.BoundName): readonly ICalculation.BoundName[];
359
+ /**
360
+ * The declarations of a literal `LAMBDA(…)` node, as {@link ICalculation.BoundName.params}, or
361
+ * `undefined` for any other node.
362
+ */
363
+ export declare function lambdaParamsOf(node: ASTNode | undefined): ICalculation.BoundName['params'];
281
364
  /**
282
365
  * Annotates the `LET`/`LAMBDA` scopes in a parsed AST: each declaration position is marked a
283
366
  * BINDER and every use its scope covers is bound to that binder's slot.
@@ -308,6 +391,42 @@ export declare function rewriteUnknownFunctionCalls(root: ASTNode, getFunction:
308
391
  * name (it never reaches the resolver at all).
309
392
  */
310
393
  export declare function bindScopes(root: ASTNode, getFunction?: ((name: string) => IFunction | null) | null): ASTNode;
394
+ /**
395
+ * Re-reads every REFERENCE token in the formula as a NAME, when any `LET`/`LAMBDA` declaration
396
+ * position is a cell reference.
397
+ *
398
+ * @param root The parsed AST.
399
+ * @param getFunction Resolves a function name to its declaration; see {@link _binderKind}.
400
+ * @returns A new root, the SAME root when no declaration is reference-shaped, or a MESSAGE when
401
+ * the formula has to be refused at entry.
402
+ *
403
+ * @remarks
404
+ * `LET(A1,7,A1)` is 7 in Excel, and the consequence is far wider than the name that caused it:
405
+ * ONE reference-shaped declaration anywhere in a formula stops EVERY A1-style token in that
406
+ * formula from reading as a cell. It is not a scope rule and not a shadow — the switch covers the
407
+ * whole formula text, measured in every direction (probe-let-ref-names.ps1):
408
+ *
409
+ * | formula | Excel |
410
+ * | --- | --- |
411
+ * | `LET(BA1,7,BA1)` | 7 — the declaration resolves |
412
+ * | `LET(BA1,7,BA2)` | `#NAME?` — a token bound nowhere no longer names a cell |
413
+ * | `LET(BA1,BA2,BA1)` | `#NAME?` — the declaration's OWN value expression is included |
414
+ * | `BA2+LET(BA1,7,BA1)` | `#NAME?` — so is text BEFORE the `LET`, outside it |
415
+ * | `LET(BA1,7,BA1)+LET(q,1,q+BA2)` | `#NAME?` — and an unrelated SIBLING scope |
416
+ * | `LET(BA1,7,BA2,9,BA1+BA2)` | 16 — two declarations, both resolving |
417
+ * | `LET(BA1,7,BA2,9,SUM(BA1:BA2))` | `#VALUE!` — `7:9`, the range OPERATOR over two values |
418
+ *
419
+ * Excel refuses to create a defined name that looks like a cell reference, so a re-read token can
420
+ * only resolve to a `LET`/`LAMBDA` declaration; everything else is `#NAME?`, which is what the
421
+ * ordinary resolver answers once the node is a name. That is why this pass has no resolution of
422
+ * its own — it changes what the tokens ARE and lets `bindScopes` and the resolver do the rest.
423
+ *
424
+ * The one entry refusal is `$`: a name cannot contain one, so under the switch any `$` in an
425
+ * A1-style token makes the formula untypeable — in a declaration or in a use, on one axis or both
426
+ * (`LET(BA1,7,BA1+$BA$2)`, `LET(BA1,7,BA1+BA$2)`, `LET($BA$1,7,$BA$1)`;
427
+ * probe-let-ref-names2.ps1 §B).
428
+ */
429
+ export declare const retypeReferenceBinders: (root: ASTNode, getFunction?: ((name: string) => IFunction | null) | null) => ASTNode | string;
311
430
  /**
312
431
  * Finds a malformed `LET`/`LAMBDA` scope — a shape Excel refuses at ENTRY.
313
432
  *
@@ -328,19 +447,22 @@ export declare function bindScopes(root: ASTNode, getFunction?: ((name: string)
328
447
  * normalization a name comparison gets everywhere else.
329
448
  */
330
449
  export declare const findBinderViolation: (root: ASTNode, getFunction: ((name: string) => IFunction | null) | null) => string | null;
450
+ export declare function linkSymbols(ast: ASTNode, symbols: ISymbolRegistry, scope?: string | null, sheetCtx?: SheetCtx, home?: {
451
+ rowIndex: number;
452
+ colIndex: number;
453
+ } | null): ASTNode;
331
454
  /**
332
- * Visits the AST and links display names to stable IDs using the symbol registry.
333
- *
334
- * @param ast The root AST node to start the traversal.
335
- * @param symbols The symbol registry used to resolve display names to stable IDs.
336
- * @param scope The sheet this formula is written on, or `null`/omitted when there is none.
337
- * Only defined names need it, and only because they can be sheet-scoped: `MonthName` on January
338
- * and the same text on February are two different names when each sheet defines its own, so the
339
- * vantage is part of the question. Without it every reference binds to whichever definition
340
- * happened to win globally.
341
- * @returns The updated AST with linked symbols.
455
+ * The first structured reference Excel refuses at entry, after {@link linkSymbols}: an unqualified one
456
+ * (`[@Qty]`) whose formula is not in a table or whose table has no such column, and a qualified one
457
+ * naming a table that does not exist (`Nope[Qty]`) or a column its table does not have
458
+ * (`Table1[Nope]`).
459
+ *
460
+ * @remarks
461
+ * A bare name (`=Nope`) is not a structured reference and is not refused: it is `#NAME?`.
462
+ *
463
+ * @returns A message, or `null` when every structured reference names its table's columns.
342
464
  */
343
- export declare function linkSymbols(ast: ASTNode, symbols: ISymbolRegistry, scope?: string | null): ASTNode;
465
+ export declare function findUnboundTableReference(ast: ASTNode, symbols?: ISymbolRegistry): string | null;
344
466
  /**
345
467
  * Returns a new AST with every relative Cell node's coordinates shifted by (rowDelta, colDelta),
346
468
  * wrapping out-of-bounds results within [0, max) (Excel behavioral).
@@ -1,5 +1,5 @@
1
1
  import { IFunction, IRuntime } from '@sheetxl/primitives';
2
- import { ISymbolRegistry } from '../symbol';
2
+ import { ISymbolRegistry, SheetCtx } from '../symbol';
3
3
  import { ICalculation } from '../ICalculation';
4
4
  import { IFormulaCompiler, CompiledFormula } from './Types';
5
5
  import { FormulaParseOptions } from './FormulaParser';
@@ -37,13 +37,16 @@ export declare class FormulaCompiler implements IFormulaCompiler {
37
37
  private readonly _editing;
38
38
  constructor(options?: FormulaCompilerOptions);
39
39
  /** @inheritdoc IFormulaCompiler.compile */
40
- compile(runtime: IRuntime, rowIndex: number, colIndex: number, expression: string, symbols?: ISymbolRegistry, getFunction?: ((name: string) => IFunction | null) | null, scope?: string | null, formulaTransform?: ICalculation.FormulaTransform): CompiledFormula;
40
+ compile(runtime: IRuntime, rowIndex: number, colIndex: number, expression: string, symbols?: ISymbolRegistry, getFunction?: ((name: string) => IFunction | null) | null, scope?: string | null, legacyIntersect?: boolean, sheetCtx?: SheetCtx): CompiledFormula;
41
41
  /** @inheritdoc IFormulaCompiler.autoCorrect */
42
42
  autoCorrect(expression: string): string | null;
43
43
  /**
44
44
  * The zero-recovery parse-failure result: a compiled formula whose only token is the raw expression
45
45
  * as `unparsed`, evaluating to the parse error. Nothing is lost (the text round-trips), nothing is
46
46
  * spent — this is the calc profile's entire failure path, and editing's last resort.
47
+ *
48
+ * `partialTable` (editing only): an expression that is nothing but a structured reference being
49
+ * typed (`[@Co`) still gets its table tokens — no prefix parses, so recovery never reaches it.
47
50
  */
48
51
  private _compileUnparsed;
49
52
  /**
@@ -61,9 +64,31 @@ export declare class FormulaCompiler implements IFormulaCompiler {
61
64
  * Append the un-parseable `tail` to `tokens` as `unparsed` token(s): stamp the enclosing function
62
65
  * context (from the last token that has one) so a caret in the tail still resolves to the right
63
66
  * function + argument, and split off a trailing identifier run (`[A-Za-z_][A-Za-z0-9_]*` at a token
64
- * boundary, not glued to a preceding digit like `12abc`) as its own `isLookup` token, so a partial
65
- * name being typed can still drive autocomplete.
67
+ * boundary, not glued to a preceding digit like `12abc`) as its own `named` token — what it would
68
+ * parse as once the rest of the formula does — so a partial name being typed can still drive
69
+ * autocomplete.
70
+ *
71
+ * A tail ending inside a structured reference's brackets (`Sales[Co`) becomes that reference's
72
+ * tokens instead — see {@link appendPartialStructuredReference}.
66
73
  */
67
74
  private _appendUnparsedTail;
68
75
  }
76
+ /**
77
+ * Append a structured reference still being typed at the end of `tail` — `Sales[`, `Sales[Co`,
78
+ * `Sales[#Da`, `Sales[[#This Row],[Co`, `[@Co` — as the tokens it will be once it closes, in the shape
79
+ * `generateFormulaTokens` gives a complete one: a `tableReference` for the name, `paren` tokens for every
80
+ * bracket, and a `tableColumn` / `tableSpecifier` per part whose value is an
81
+ * {@link ICalculation.TablePartRef} naming the table (`''` when unqualified).
82
+ *
83
+ * The unfinished part is marked `partial` with what may finish it, and a part not yet started — right
84
+ * after the `[` or `@` that opened it — is an empty token, so an editor completes from the tokens alone.
85
+ *
86
+ * The name may already sit in `tokens` as the `named` token the parsed prefix ended with; it is
87
+ * re-typed in place. Anything in `tail` before the reference is one `unparsed` token.
88
+ *
89
+ * @returns `false`, with `tokens` untouched, when the tail does not end inside a structured reference.
90
+ */
91
+ export declare function appendPartialStructuredReference(tokens: ICalculation.FormulaToken[], tail: string, context: ICalculation.FormulaTokenContext | undefined,
92
+ /** The display name of the table at the formula's cell, which an unqualified reference names. */
93
+ homeTable?: () => string | undefined): boolean;
69
94
  //# sourceMappingURL=FormulaCompiler.d.ts.map
@@ -4,7 +4,6 @@ import { ASTNode, ParseResult } from './ASTTypes';
4
4
  import { FormulaLexer, FormulaLexerOptions } from './FormulaLexer';
5
5
  import { CompilerLocale } from './CompilerLocale';
6
6
  import { SRParser } from './SRParser';
7
- import { ICalculation } from '../ICalculation';
8
7
  declare module 'chevrotain' {
9
8
  interface EmbeddedActionsParser {
10
9
  getLexerPosition(): number;
@@ -80,7 +79,7 @@ export declare class FormulaParser extends EmbeddedActionsParser {
80
79
  * none, so `=_xlfn.SUM(A1)` typed is an unknown name, as in Excel. Runs where the hardcoded
81
80
  * legacy visit used to run — no extra parse.
82
81
  */
83
- parse(rowIndex: number, colIndex: number, expression: string, formulaTransform?: ICalculation.FormulaTransform): ParseResult;
82
+ parse(rowIndex: number, colIndex: number, expression: string): ParseResult;
84
83
  /**
85
84
  * Parses a flat sequence of infix-operator / operand pairs, then folds them into a
86
85
  * left-associative AST using the precedence table in `ParserUtils.binaryOperatorsPrecedence`.
@@ -1,6 +1,13 @@
1
1
  import { ICalculation } from '../ICalculation';
2
2
  import { ISymbolRegistry } from '../symbol';
3
3
  import { ASTNode } from './ASTTypes';
4
+ /**
5
+ * The public node view of an internal AST — what {@link ICalculation.IFormula.getNode} answers.
6
+ *
7
+ * @param root The internal AST root.
8
+ * @param symbols The registry the AST was linked against.
9
+ */
10
+ export declare function toFormulaNode(root: ASTNode, symbols: ISymbolRegistry | null | undefined): ICalculation.FormulaNode;
4
11
  /**
5
12
  * Applies a public {@link ICalculation.FormulaTransform} to an internal AST.
6
13
  *
@@ -12,4 +19,14 @@ import { ASTNode } from './ASTTypes';
12
19
  * that identity to skip recompilation.
13
20
  */
14
21
  export declare function applyTransformToAST(root: ASTNode, transform: ICalculation.FormulaTransform, symbols?: ISymbolRegistry | null): ASTNode;
22
+ /**
23
+ * Walks a lite tree with a transform, post-order, and returns the transformed root: the SAME
24
+ * object when nothing changed.
25
+ */
26
+ export declare function transformFormulaNode(root: ICalculation.FormulaNode, transform: ICalculation.FormulaTransform): ICalculation.FormulaNode;
27
+ /**
28
+ * Rebuilds an AST from a lite tree: nodes a transform left alone come back as the AST nodes they
29
+ * were made from, replacements are built fresh.
30
+ */
31
+ export declare function fromFormulaNode(root: ICalculation.FormulaNode): ASTNode;
15
32
  //# sourceMappingURL=LiteTransform.d.ts.map
@@ -1,4 +1,5 @@
1
1
  import { FormulaError, IRange } from '@sheetxl/primitives';
2
+ import { ICalculation } from '../ICalculation';
2
3
  import { CompilerLocale } from './CompilerLocale';
3
4
  import { ASTNode, ASTVisitor, CellNode, FunctionNode } from './ASTTypes';
4
5
  /**
@@ -49,6 +50,21 @@ export declare function createTableReference(value: string, inputs: any[]): ASTN
49
50
  * word → canonical. Display re-imaging (`tokensToString`) re-localizes for a localized target.
50
51
  */
51
52
  export declare function createTableSpecifier(image: string, locale?: CompilerLocale): ASTNode;
53
+ /**
54
+ * A column name as a structured reference spells it: a `'` before each `[`, `]`, `#` and `'`,
55
+ * which is Excel's escape inside a column specifier. Without it a name holding a bracket cannot be
56
+ * referenced at all — the bracket would close the reference.
57
+ */
58
+ export declare function escapeColumnName(name: string): string;
59
+ /**
60
+ * The column name a specifier spells — the inverse of {@link escapeColumnName}.
61
+ *
62
+ * @remarks
63
+ * A `'` before anything else is a literal `'`, not a dangling escape: `#` and `'` were referenced
64
+ * unescaped long before the escape was read, and text written then still has to name the same
65
+ * column (`[Q#1]` and `[Q'#1]` are both `Q#1`).
66
+ */
67
+ export declare function unescapeColumnName(image: string): string;
52
68
  export declare function createTableColumn(image: string): ASTNode;
53
69
  export declare function createInfix(operator: string, left: ASTNode, right: ASTNode, isReference?: boolean): ASTNode;
54
70
  export declare function createPostfix(operator: string, input: ASTNode | null | undefined, isReference?: boolean): ASTNode;
@@ -108,11 +124,20 @@ export declare function createRefError(image?: string, locale?: CompilerLocale,
108
124
  export declare function createNameError(): ASTNode;
109
125
  /**
110
126
  * The plain error behind an `error` node/token value, whichever shape it is: an error REFERENCE
111
- * carries an {@link ICalculation.ErrorRef} (qualifier and all), an error LITERAL the bare
127
+ * carries an {@link ErrorReference} (qualifier and all), an error LITERAL the bare
112
128
  * {@link FormulaError}. Evaluation and precedent resolution want the error itself either way — an
113
129
  * `ErrorRef` never escapes the reference layer into a cell value.
114
130
  */
115
131
  export declare function errorOfValue(value: unknown): FormulaError.Known;
132
+ /**
133
+ * An `error` node's value as its TOKEN carries it: the error's canonical label for a literal, an
134
+ * {@link ICalculation.ErrorRef} for a reference. Plain data either way.
135
+ */
136
+ export declare function errorTokenValue(value: unknown): string | ICalculation.ErrorRef | undefined;
137
+ /**
138
+ * The error an `error` TOKEN names, from the label it carries ({@link errorTokenValue}).
139
+ */
140
+ export declare function errorOfTokenValue(value: unknown): FormulaError.Known | undefined;
116
141
  /**
117
142
  * Does an error token's `text` already carry its sheet qualifier (`Data!#REF!`)?
118
143
  *
@@ -29,9 +29,10 @@ export declare class SRParser extends EmbeddedActionsParser {
29
29
  /**
30
30
  * Parses a complete structured reference and returns a ParseResult.
31
31
  *
32
- * Accepts the full token image in either form:
32
+ * Accepts the full token image in any of three forms:
33
33
  * '[Column1]' — no table name (BracketedString token)
34
34
  * 'Table1[#Headers,[Col1]]' — with table name (TableReference token)
35
+ * '[1]!Table1[Col1]' — with an EXTERNAL book prefix, which belongs to the table NAME
35
36
  */
36
37
  parse(rowIndex: number, colIndex: number, expression: string): ParseResult;
37
38
  }
@@ -1,5 +1,5 @@
1
1
  import { IFunction, IRange, IRuntime } from '@sheetxl/primitives';
2
- import { ISymbolRegistry } from '../symbol';
2
+ import { ISymbolRegistry, SheetCtx } from '../symbol';
3
3
  import { ICalculation } from '../ICalculation';
4
4
  import { ASTNode, ASTVisitor } from './ASTTypes';
5
5
  /**
@@ -33,14 +33,19 @@ export interface IFormulaCompiler {
33
33
  */
34
34
  scope?: string | null,
35
35
  /**
36
- * A structural transform applied to the parsed tree before compilation (pre-link) — the READ
37
- * half of the dialect hook. A format reader (io-xlsx) supplies its legacy unwrap here; typed
38
- * text compiles without one.
36
+ * Compile in the legacy entry era: the whole tree evaluates in implicit-intersection value
37
+ * mode (`ICalculation.JSON.legacyIntersect`). A loaded block that is not an array anchor, in a
38
+ * calculation in that era; typed text compiles without it.
39
39
  */
40
- formulaTransform?: ICalculation.FormulaTransform): CompiledFormula;
40
+ legacyIntersect?: boolean,
41
+ /**
42
+ * How SHEET scopes bind — a body linked inside an external book names that book's sheets
43
+ * (`SheetCtx.book`). A committed cell formula passes nothing and may mint a link.
44
+ */
45
+ sheetCtx?: SheetCtx): CompiledFormula;
41
46
  /**
42
47
  * Excel-parity **Formula AutoCorrect** at the TEXT level: repair `expression` by appending the
43
- * trailing closers (`)` / `}`) its unmatched openers imply. Purely lexical — brackets inside
48
+ * trailing closers (`]` / `)` / `}`) its unmatched openers imply. Purely lexical — brackets inside
44
49
  * string literals / structured references never count (they lex as single tokens), and the repair
45
50
  * is NOT validated here: the caller re-compiles and accepts it only when it parses clean (see
46
51
  * `ICalculation.IFormula.autoCorrect`).
@@ -162,10 +167,24 @@ export interface CompiledFormula {
162
167
  */
163
168
  bindings: number[];
164
169
  /**
165
- * Represents all references as absolute ranges.
170
+ * Reusable scratch for resolving references to absolute ranges: ONE pre-allocated
171
+ * `IRange.Coords` per {@link referencesRelative} entry, mutated in place at each resolution.
166
172
  *
167
173
  * @remarks
168
- * A cache
174
+ * The invariant every consumer must keep: **slot `k` always means declared reference `k`**
175
+ * (`CompiledPrecedent.value` is the slot for a leaf), and a resolution overwrites EVERY field
176
+ * of the slot — bounds and `scope` (`null` when unscoped, never left over from a previous
177
+ * resolution). Both resolution passes go through `toSimpleAbsoluteRange`, so the slots carry
178
+ * NO `$` marks: nothing on the evaluation path reads them from a resolved-absolute coords,
179
+ * and `_appendRootPrecedents` requires their absence (it stamps `$` onto copies from the
180
+ * compiler's per-axis flags, and only ever sets). Indexing by anything else (an execute
181
+ * position, an eval index) makes one object stand for different references between passes,
182
+ * and any field written conditionally then leaks across them — a bare `$A4` once inherited a
183
+ * stale cross-sheet scope this way and dereferenced against the wrong grid.
184
+ *
185
+ * The objects are yielded to callers (`evaluations`, precedent lists) and are only valid
186
+ * until the block's next resolution — a consumer that retains one across evaluations (or an
187
+ * `await`) must copy it.
169
188
  */
170
189
  referencesAbsolute: IRange.Coords[];
171
190
  /**
@@ -191,6 +210,16 @@ export interface CompiledFormula {
191
210
  * Because we manage as cells but update as ranges we need to track the start and end of the references.
192
211
  */
193
212
  referenceIndices: number[];
213
+ /**
214
+ * Positions in {@link referenceIndices} (so in `getReferences()`) of the cell and range
215
+ * literals that are value operands, in text order - the cells an entered formula inherits its
216
+ * number format from. A literal at a reference-typed parameter, a name, a structured reference
217
+ * and a `#REF!` are not listed.
218
+ *
219
+ * @remarks
220
+ * A cache, computed once at compile time from {@link ast}.
221
+ */
222
+ formatReferenceIndices: number[];
194
223
  /**
195
224
  * The formula's editor tokens (syntax highlighting, function/argument hints). Computed lazily and
196
225
  * cached on first call — most compiles (grid cells) never need them. On a parse failure this returns
@@ -223,7 +252,7 @@ export interface CompiledFormula {
223
252
  * @remarks
224
253
  * A cache, computed once at compile time from {@link ast}. What `IFormulaContext.filterTotals`
225
254
  * needs to answer per CELL, and computing it here is what keeps that answer free: the alternative
226
- * is re-inspecting a neighbour's formula on every recalculation of every enclosing total.
255
+ * is re-inspecting a neighbor's formula on every recalculation of every enclosing total.
227
256
  *
228
257
  * "Anywhere in its tree", not "is the outermost call" — measured, `=SUM(SUBTOTAL(9,A1:A3))` is
229
258
  * excluded from an enclosing SUBTOTAL exactly as a bare `=SUBTOTAL(9,A1:A3)` is. Resolved through
@@ -231,6 +260,47 @@ export interface CompiledFormula {
231
260
  * `_xlfn.`-prefixed one both answer correctly.
232
261
  */
233
262
  hasTotals: boolean;
263
+ /**
264
+ * Whether the formula names a VOLATILE function anywhere in its tree — the cell recalculates on
265
+ * every pass, whether or not that call is ever reached.
266
+ *
267
+ * @remarks
268
+ * Volatility is otherwise marked at RUNTIME, by the body (`IFormulaContext.markVolatile`), which
269
+ * was equivalent while every argument was evaluated. It stopped being equivalent with lazy
270
+ * arguments: `=IF(TRUE,1,RAND())` never runs `RAND` and would silently stop recalculating.
271
+ * Excel keeps it volatile — measured 2026-09-07, `probe-lazy-args.ps1` P1: the cell costs a full
272
+ * recalculation on every idle F9, for `RAND`, `NOW` and `OFFSET` alike, in an arm no branch
273
+ * selects. So the mark is a property of the formula TEXT and is collected here.
274
+ *
275
+ * The declaration answers it (`Volatile<T>` on the return), so a UDF counts exactly as a
276
+ * built-in does and no list of names lives in the engine. `IFormulaContext.markVolatile()`
277
+ * remains on the context for a function that cannot declare — it is not how a built-in says it.
278
+ */
279
+ hasVolatile: boolean;
280
+ /**
281
+ * Whether every cell of a block running this formula whose RELATIVE inputs are all blank must
282
+ * evaluate to the same value within one pass — so the engine may evaluate one of them and share
283
+ * the answer (PLAN-WATCHES-BLANK-AWARE §4).
284
+ *
285
+ * @remarks
286
+ * A property of the formula TEXT, like {@link hasVolatile}, and `false` whenever the text shows
287
+ * the answer could depend on which cell is asking: an implicit intersection, a name, an
288
+ * expression callee, or a function the registry does not know. `TODAY()` and `NOW()` are
289
+ * accepted: volatile, but one value per pass. So are `RAND()` and every function taking a
290
+ * reference (`ROW()`, `OFFSET`, `FORMULATEXT`, the `SUMIF` family): whether the body reads a
291
+ * position (or draws) is a per-cell READ (`CalcScope.perCellRead`) that the pass sees when it
292
+ * evaluates the representative, not a property of the text. The block adds its own gates (a
293
+ * precedent template, not array-entered) and the pass its run-time ones (no dynamic read, no
294
+ * per-cell read, a scalar result); this is only the half that can be known from the text.
295
+ */
296
+ isBlankCacheable: boolean;
297
+ /**
298
+ * {@link isBlankCacheable} for a block evaluated in ARRAY mode throughout — every cell its own
299
+ * 1x1 array-entered extent (a conditional-format body). The same refusals less the value-mode
300
+ * one: with nothing intersecting, a value-or-range slot over a multi-cell reference reads the
301
+ * same cells at every cell.
302
+ */
303
+ isBlankCacheableArray: boolean;
234
304
  /**
235
305
  * Indicates if the formula is reference-only (i.e. it only returns a range and does not return a scalar value).
236
306
  */