@sheetxl/sdk 0.8.0-beta.10 → 0.8.0-beta.12

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 (522) hide show
  1. package/README.md +1 -1
  2. package/browser/esm/{CYyv6uGjo10ig5FP.mjs → -Jx-jNHmtIQQfLvK.mjs} +1 -1
  3. package/browser/esm/{CdLZWVcH8cncBUPJ.mjs → 2WuhYrIpYmOR5H73.mjs} +110 -261
  4. package/browser/esm/{Cqr3knDsBvoVZ6MN.mjs → 2mIwPy2D2JUX-9wx.mjs} +2 -2
  5. package/browser/esm/B3wf5vZCsWfWsDbj.mjs +12 -0
  6. package/browser/esm/{BzLfNyc6OOShIErH.mjs → BIHrHjRGWVlJglcp.mjs} +2 -2
  7. package/browser/esm/{C9B0djuUarfNdoj0.mjs → BTFBedJMRWGvZyCE.mjs} +1 -1
  8. package/browser/esm/{Btg43M1Bf-ENDreu.mjs → BdCJNawfifyPupCP.mjs} +1 -1
  9. package/browser/esm/{ClB5ix51roQOpZEr.mjs → Bg5Di9GLNAkbqQ1P.mjs} +2877 -2067
  10. package/browser/esm/BnC4-27Igwb8oDf2.mjs +1552 -0
  11. package/browser/esm/{DhKkrCVASZ6Isvz6.mjs → Bt8_m94tBdks209L.mjs} +1 -1
  12. package/browser/esm/{zqJOaweiXE9D8RY1.mjs → BudSIfXBAsTxvu-K.mjs} +31835 -40812
  13. package/browser/esm/C9u8FUewte5ugUjH.mjs +5132 -0
  14. package/browser/esm/{Di58Ji1n--3Mgc_2.mjs → CBYMTDzMf1Vh7pkw.mjs} +1 -1
  15. package/browser/esm/CNdjyofiRu6CYOrr.mjs +12835 -0
  16. package/browser/esm/{Dtoyt8q5RyGAlxCp.mjs → CRkYR-siY2C994KV.mjs} +1 -1
  17. package/browser/esm/CTe2qfmIUEad6FJv.mjs +199 -0
  18. package/browser/esm/CUzYuYTTGsChC_kZ.mjs +8422 -0
  19. package/browser/esm/CdEO8CEee6lEhabA.mjs +117 -0
  20. package/browser/esm/CfRqiPDg6RBTg1EN.mjs +367 -0
  21. package/browser/esm/CndRBvVfQUJIYRRj.mjs +193 -0
  22. package/browser/esm/{Y79I7Sm8kjaYexhf.mjs → CwOPLXU3-9ZHGyOT.mjs} +1 -1
  23. package/browser/esm/{CjsUGJEQSbGjnH6R.mjs → Cxjxk0ncRKx80I-w.mjs} +1 -1
  24. package/browser/esm/D2RZh0O9neOsyLAE.mjs +281 -0
  25. package/browser/esm/{De175LygU7ot4nQm.mjs → D64dM68B1pKYFzdP.mjs} +2 -2
  26. package/browser/esm/{o8MFgcVXns987D6_.mjs → D9xNz46kAfXMZzp4.mjs} +6 -6
  27. package/browser/esm/{BcHmrKHwMMOlzc9_.mjs → DK899HhWX1HINMC1.mjs} +55 -55
  28. package/browser/esm/DPhGQLNGmDZwODwJ.mjs +395 -0
  29. package/browser/esm/DVroRnhi-5IDXNgM.mjs +210 -0
  30. package/browser/esm/{Bk7xxbdDpa7-sIwd.mjs → DZiivy0NmO1Vnyzk.mjs} +2 -2
  31. package/browser/esm/{CZ5oa92wZEAXebgk.mjs → DgrAuRD2qr2DvFeJ.mjs} +78 -68
  32. package/browser/esm/{D4uVlrG0xEFctsSM.mjs → DobHLF6VjHr7Xi40.mjs} +285 -67
  33. package/browser/esm/{CSx9ed1JOs7K5BXO.mjs → DwZCT7DZiiXoTweg.mjs} +2 -2
  34. package/browser/esm/DwwR3O2sEZApPSTF.mjs +86 -0
  35. package/browser/esm/Tah7cnFb_HNZdLtj.mjs +128 -0
  36. package/browser/esm/{BEAY9XgKNx-bakXW.mjs → fXWUMDhZ5yMSO629.mjs} +1 -1
  37. package/browser/esm/{BqskM7wA8oPfFQue.mjs → hCQJcmIzPDxDEv2q.mjs} +2 -2
  38. package/browser/esm/index.mjs +1294 -1008
  39. package/browser/esm/{Cgd5BnM3hg9RyUel.mjs → qO-ujUrgq6H3TQix.mjs} +1 -1
  40. package/browser/esm/w6Jea0TiclPrYZ2M.mjs +1703 -0
  41. package/browser/esm/yuhcOYw6SHQ-RCm3.mjs +114 -0
  42. package/licenses/dependencies.txt +75 -75
  43. package/node/esm/-TA0MneBDKdGhsib.mjs +8668 -0
  44. package/node/esm/B-HUPAcqvK0eeeCz.mjs +134 -0
  45. package/node/esm/BL2iiEoqxDEV2Xrg.mjs +8320 -0
  46. package/node/esm/{C6ZXsNyLXI6zA63X.mjs → BNXLOEddJ6O9gYws.mjs} +9 -9
  47. package/node/esm/{BH1v-E4Ro3bR7Znw.mjs → BSvOluusoDM4z_dx.mjs} +151 -302
  48. package/node/esm/{CD9wbvufChVYYkrI.mjs → BskP3b8vUoIOGLY6.mjs} +2 -2
  49. package/node/esm/{CnSQ7MTXAUAyBOoS.mjs → Btw4148Ot8ifhNc1.mjs} +285 -64
  50. package/node/esm/{B6D7sSetrcOWLsKj.mjs → C14-R6tifRh7pc0p.mjs} +1 -1
  51. package/node/esm/C99zzq8DImQXi4BQ.mjs +133 -0
  52. package/node/esm/{BtuY37FumvLE7EBo.mjs → CBuEu5Jk-LfaDy-H.mjs} +176 -166
  53. package/node/esm/{DdFgXl-Ux2cMBTs_.mjs → CG-qBU5BAaVz7e-P.mjs} +1 -1
  54. package/node/esm/CPI58duc0j0a-HpJ.mjs +115 -0
  55. package/node/esm/CRt3vXe6YmXzqk3H.mjs +406 -0
  56. package/node/esm/{CUUoseJmFsCf82bb.mjs → C_aL7CGS1lrNn1Ng.mjs} +1 -1
  57. package/node/esm/{D7MfcID2Wf6l6VpC.mjs → C_xf5Bz30VqiJjXn.mjs} +1 -1
  58. package/node/esm/CiIymQN6aJCul62g.mjs +610 -0
  59. package/node/esm/{B9ljpEIZg6wOTzRE.mjs → Ci_zLYmCD7e-C79O.mjs} +1 -1
  60. package/node/esm/{Bqd62L8KFgdS0Vou.mjs → CkRYLed8Mmn3giNg.mjs} +2 -2
  61. package/node/esm/D3ptRKzASqBut1DE.mjs +117 -0
  62. package/node/esm/{DefYISWfdZJFx57m.mjs → D4ROK9UwDpS6jO3Z.mjs} +1 -1
  63. package/node/esm/D8hO07ToAibIuniw.mjs +13014 -0
  64. package/node/esm/{Bh4dv6tMjXX3X4nI.mjs → DUTmDHbFbhLDT4F3.mjs} +1 -1
  65. package/node/esm/{DCplLG93GfTs1vNw.mjs → DV5CU37aEbFbWFL0.mjs} +1 -1
  66. package/node/esm/{CUQi5ZtMO02nhG0W.mjs → DdoiuKg9BKubtF1V.mjs} +1 -1
  67. package/node/esm/DggQ23jKMpwhENfa.mjs +372 -0
  68. package/node/esm/DhS6yWjrrSNIJMsn.mjs +1033 -0
  69. package/node/esm/{DMD12JUh7HJw2-jl.mjs → DhTya_mhmN53vskv.mjs} +1 -1
  70. package/node/esm/Dn1M7YWi25DeeYUb.mjs +210 -0
  71. package/node/esm/DrCf6ITcBhVOFpRj.mjs +86 -0
  72. package/node/esm/{BN9j8V9gCExMjVtJ.mjs → DxazKtROyaI51dWl.mjs} +1 -1
  73. package/node/esm/{MiU4rDOiocmJ-9Ry.mjs → Q_S1g46ZOTrdhTae.mjs} +1 -1
  74. package/node/esm/Vocy-I9dKzZMr0Ct.mjs +59323 -0
  75. package/node/esm/ZXPFcsT2zrALCZux.mjs +289 -0
  76. package/node/esm/eimUGjiIP-b8HiM6.mjs +199 -0
  77. package/node/esm/icn2nX5Z8e_3mNAv.mjs +12 -0
  78. package/node/esm/index.mjs +2808 -65678
  79. package/node/esm/lGJ42sHqg5if2bba.mjs +1770 -0
  80. package/node/esm/{Bsx9uijd4X_SKV3L.mjs → pYtP7wPyS96NQyXS.mjs} +51 -51
  81. package/package.json +6 -7
  82. package/resources/contents.json +120 -0
  83. package/resources/fonts/arial-bold-italic.hinted.json +125 -0
  84. package/resources/fonts/arial-bold-italic.metrics.json +13 -13
  85. package/resources/fonts/arial-bold-italic.rows.json +9 -0
  86. package/resources/fonts/arial-bold.hinted.json +125 -0
  87. package/resources/fonts/arial-bold.metrics.json +12 -12
  88. package/resources/fonts/arial-bold.rows.json +9 -0
  89. package/resources/fonts/arial-italic.hinted.json +125 -0
  90. package/resources/fonts/arial-italic.metrics.json +13 -13
  91. package/resources/fonts/arial-italic.rows.json +9 -0
  92. package/resources/fonts/arial-regular.hinted.json +125 -0
  93. package/resources/fonts/arial-regular.metrics.json +12 -12
  94. package/resources/fonts/arial-regular.rows.json +9 -0
  95. package/resources/fonts/calibri-bold-italic.hinted.json +122 -0
  96. package/resources/fonts/calibri-bold-italic.metrics.json +2 -2
  97. package/resources/fonts/calibri-bold-italic.rows.json +9 -0
  98. package/resources/fonts/calibri-bold.hinted.json +122 -0
  99. package/resources/fonts/calibri-bold.metrics.json +1 -1
  100. package/resources/fonts/calibri-bold.rows.json +9 -0
  101. package/resources/fonts/calibri-italic.hinted.json +121 -0
  102. package/resources/fonts/calibri-italic.metrics.json +2 -2
  103. package/resources/fonts/calibri-italic.rows.json +9 -0
  104. package/resources/fonts/calibri-regular.hinted.json +121 -0
  105. package/resources/fonts/calibri-regular.metrics.json +1 -1
  106. package/resources/fonts/calibri-regular.rows.json +9 -0
  107. package/resources/fonts/cambria-bold-italic.hinted.json +105 -0
  108. package/resources/fonts/cambria-bold-italic.metrics.json +26 -26
  109. package/resources/fonts/cambria-bold-italic.rows.json +9 -0
  110. package/resources/fonts/cambria-bold.hinted.json +108 -0
  111. package/resources/fonts/cambria-bold.metrics.json +19 -19
  112. package/resources/fonts/cambria-bold.rows.json +9 -0
  113. package/resources/fonts/cambria-italic.hinted.json +102 -0
  114. package/resources/fonts/cambria-italic.metrics.json +23 -23
  115. package/resources/fonts/cambria-italic.rows.json +9 -0
  116. package/resources/fonts/cambria-regular.hinted.json +110 -0
  117. package/resources/fonts/cambria-regular.metrics.json +18 -18
  118. package/resources/fonts/cambria-regular.rows.json +9 -0
  119. package/resources/fonts/contents.json +280 -0
  120. package/resources/fonts/courier-new-bold-italic.hinted.json +11 -0
  121. package/resources/fonts/courier-new-bold-italic.metrics.json +12 -12
  122. package/resources/fonts/courier-new-bold-italic.rows.json +9 -0
  123. package/resources/fonts/courier-new-bold.hinted.json +11 -0
  124. package/resources/fonts/courier-new-bold.metrics.json +12 -12
  125. package/resources/fonts/courier-new-bold.rows.json +9 -0
  126. package/resources/fonts/courier-new-italic.hinted.json +11 -0
  127. package/resources/fonts/courier-new-italic.metrics.json +12 -12
  128. package/resources/fonts/courier-new-italic.rows.json +9 -0
  129. package/resources/fonts/courier-new-regular.hinted.json +11 -0
  130. package/resources/fonts/courier-new-regular.metrics.json +12 -12
  131. package/resources/fonts/courier-new-regular.rows.json +9 -0
  132. package/resources/fonts/times-new-roman-bold-italic.hinted.json +125 -0
  133. package/resources/fonts/times-new-roman-bold-italic.metrics.json +15 -15
  134. package/resources/fonts/times-new-roman-bold-italic.rows.json +9 -0
  135. package/resources/fonts/times-new-roman-bold.hinted.json +125 -0
  136. package/resources/fonts/times-new-roman-bold.metrics.json +12 -12
  137. package/resources/fonts/times-new-roman-bold.rows.json +9 -0
  138. package/resources/fonts/times-new-roman-italic.hinted.json +125 -0
  139. package/resources/fonts/times-new-roman-italic.metrics.json +16 -16
  140. package/resources/fonts/times-new-roman-italic.rows.json +9 -0
  141. package/resources/fonts/times-new-roman-regular.hinted.json +125 -0
  142. package/resources/fonts/times-new-roman-regular.metrics.json +16 -16
  143. package/resources/fonts/times-new-roman-regular.rows.json +9 -0
  144. package/resources/locales/de/model.msg.json +93 -9
  145. package/resources/locales/en/model.msg.json +95 -10
  146. package/types/scripting-api.json +10809 -8021
  147. package/types/scripting-enums.json +201 -44
  148. package/types/scripting.d.ts +17030 -8666
  149. package/types/src/.generated/wasm/fonts.d.ts +161 -0
  150. package/types/src/.generated/wasm/fonts_bg.inline.d.ts +3 -0
  151. package/types/src/.generated/wasm/sdk.d.ts +122 -0
  152. package/types/src/.generated/wasm/sdk_bg.inline.d.ts +3 -0
  153. package/types/src/address/AddressUtils.d.ts +10 -1
  154. package/types/src/address/_StructuredAddress.d.ts +58 -0
  155. package/types/src/anomalies/_Anomalies.d.ts +109 -0
  156. package/types/src/anomalies/_FocusTable.d.ts +11 -0
  157. package/types/src/anomalies/_FormulaChecks.d.ts +133 -0
  158. package/types/src/anomalies/_LabelChecks.d.ts +21 -0
  159. package/types/src/anomalies/_LiteralChecks.d.ts +35 -0
  160. package/types/src/anomalies/_SeriesChecks.d.ts +13 -0
  161. package/types/src/border/IBorders.d.ts +16 -0
  162. package/types/src/calculation/Calculation.d.ts +139 -371
  163. package/types/src/calculation/ExternalBookBindings.d.ts +2 -3
  164. package/types/src/calculation/FormulaLiterals.d.ts +2 -1
  165. package/types/src/calculation/FormulaText.d.ts +18 -2
  166. package/types/src/calculation/ICalculation.d.ts +133 -18
  167. package/types/src/calculation/INamedFormulasCollection.d.ts +4 -0
  168. package/types/src/calculation/NamedFormulaCollection.d.ts +293 -22
  169. package/types/src/calculation/_CloneBoundary.d.ts +1 -1
  170. package/types/src/calculation/_FormulaToolkit.d.ts +9 -0
  171. package/types/src/calculation/_TableExtent.d.ts +60 -0
  172. package/types/src/calculation/compiler/ASTTypes.d.ts +6 -2
  173. package/types/src/calculation/compiler/CompilerUtils.d.ts +17 -0
  174. package/types/src/calculation/compiler/ParserUtils.d.ts +16 -0
  175. package/types/src/calculation/compiler/Types.d.ts +9 -1
  176. package/types/src/calculation/engine/CalcBackend.d.ts +953 -0
  177. package/types/src/calculation/engine/index.d.ts +10 -0
  178. package/types/src/calculation/executor/CalcExecutor.d.ts +94 -24
  179. package/types/src/calculation/executor/CalcExecutorUtils.d.ts +23 -1
  180. package/types/src/calculation/executor/_WhatIf.d.ts +50 -0
  181. package/types/src/calculation/formula/Formula.d.ts +9 -0
  182. package/types/src/calculation/formula/FormulaBlock.d.ts +10 -3
  183. package/types/src/calculation/formula/IFormulaBlock.d.ts +21 -0
  184. package/types/src/calculation/formula/LambdaValue.d.ts +5 -3
  185. package/types/src/calculation/functions/FunctionDeclarations.d.ts +5 -1
  186. package/types/src/calculation/functions/_DataTableFunction.d.ts +14 -0
  187. package/types/src/calculation/functions/expandDeclaration.d.ts +15 -0
  188. package/types/src/calculation/functions/initializeFunctions.d.ts +0 -12
  189. package/types/src/calculation/grid/CalcGrid.d.ts +44 -10
  190. package/types/src/calculation/grid/CalcGridBackend.d.ts +35 -27
  191. package/types/src/calculation/grid/CalcGridProxy.d.ts +2 -2
  192. package/types/src/calculation/grid/CalcGridUtils.d.ts +12 -3
  193. package/types/src/calculation/grid/FormulaHost.d.ts +51 -6
  194. package/types/src/calculation/grid/ICalcGrid.d.ts +48 -15
  195. package/types/src/calculation/grid/_CalcRequest.d.ts +28 -6
  196. package/types/src/calculation/grid/_CellValueRun.d.ts +21 -0
  197. package/types/src/calculation/spatial/FormulaSpatialValue.d.ts +29 -2
  198. package/types/src/calculation/spatial/SpillEntry.d.ts +16 -2
  199. package/types/src/calculation/state/CalcNode.d.ts +0 -1
  200. package/types/src/calculation/state/CalcScope.d.ts +44 -6
  201. package/types/src/calculation/state/CalcState.d.ts +36 -4
  202. package/types/src/calculation/state/CalculationContext.d.ts +30 -3
  203. package/types/src/calculation/state/DeferredCalls.d.ts +260 -0
  204. package/types/src/calculation/state/IContextContainer.d.ts +32 -0
  205. package/types/src/calculation/state/_PendingOverlayGrid.d.ts +6 -0
  206. package/types/src/calculation/state/_WhatIfLayer.d.ts +91 -0
  207. package/types/src/calculation/toolkit/FormulaLiteralReader.d.ts +4 -0
  208. package/types/src/calculation/toolkit/FormulaTextParser.d.ts +10 -0
  209. package/types/src/calculation/toolkit/FunctionDeclarationTable.d.ts +4 -0
  210. package/types/src/calculation/toolkit/index.d.ts +12 -0
  211. package/types/src/cell/ICell.d.ts +302 -34
  212. package/types/src/cell/ICellHeader.d.ts +7 -6
  213. package/types/src/cell/ICellProtection.d.ts +1 -1
  214. package/types/src/cellControl/CellControl.d.ts +67 -0
  215. package/types/src/cellControl/CellControlCollection.d.ts +29 -0
  216. package/types/src/cellControl/CellControlRegistry.d.ts +47 -0
  217. package/types/src/cellControl/ICellControl.d.ts +99 -0
  218. package/types/src/cellControl/ICellControlCollection.d.ts +67 -0
  219. package/types/src/cellControl/index.d.ts +4 -0
  220. package/types/src/cellRange/ICellHeaderRange.d.ts +6 -9
  221. package/types/src/cellRange/ICellHeaderRanges.d.ts +5 -0
  222. package/types/src/cellRange/ICellRange.d.ts +525 -110
  223. package/types/src/cellRange/ICellRanges.d.ts +12 -6
  224. package/types/src/chart/Chart.d.ts +217 -15
  225. package/types/src/chart/ChartCollection.d.ts +7 -2
  226. package/types/src/chart/IChart.d.ts +1921 -35
  227. package/types/src/chart/IChartCollection.d.ts +27 -2
  228. package/types/src/chart/_ChartParts.d.ts +1066 -0
  229. package/types/src/chart/_ChartSource.d.ts +47 -0
  230. package/types/src/chart/createChart.d.ts +26 -0
  231. package/types/src/chart/index.d.ts +4 -0
  232. package/types/src/chart/kinds/ChartKind.d.ts +252 -0
  233. package/types/src/chart/kinds/_Area.d.ts +3 -0
  234. package/types/src/chart/kinds/_Bar.d.ts +4 -0
  235. package/types/src/chart/kinds/_BoxWhisker.d.ts +4 -0
  236. package/types/src/chart/kinds/_Bubble.d.ts +3 -0
  237. package/types/src/chart/kinds/_Funnel.d.ts +4 -0
  238. package/types/src/chart/kinds/_Hierarchy.d.ts +31 -0
  239. package/types/src/chart/kinds/_Histogram.d.ts +4 -0
  240. package/types/src/chart/kinds/_HitKinds.d.ts +23 -0
  241. package/types/src/chart/kinds/_Line.d.ts +4 -0
  242. package/types/src/chart/kinds/_OfPie.d.ts +4 -0
  243. package/types/src/chart/kinds/_Pie.d.ts +4 -0
  244. package/types/src/chart/kinds/_Placeholder.d.ts +6 -0
  245. package/types/src/chart/kinds/_Radar.d.ts +4 -0
  246. package/types/src/chart/kinds/_Scatter.d.ts +8 -0
  247. package/types/src/chart/kinds/_Sunburst.d.ts +4 -0
  248. package/types/src/chart/kinds/_Surface.d.ts +4 -0
  249. package/types/src/chart/kinds/_Treemap.d.ts +4 -0
  250. package/types/src/chart/kinds/_Waterfall.d.ts +18 -0
  251. package/types/src/chart/kinds/_builtIns.d.ts +11 -0
  252. package/types/src/chart/layout/ChartLayout.d.ts +829 -0
  253. package/types/src/chart/layout/TextMeasurer.d.ts +38 -0
  254. package/types/src/chart/layout/_HitGeometry.d.ts +50 -0
  255. package/types/src/chart/layout/_HitTest.d.ts +36 -0
  256. package/types/src/chart/layout/_Layout.d.ts +25 -0
  257. package/types/src/chart/layout/_LayoutUtils.d.ts +97 -0
  258. package/types/src/chart/math/BoxStats.d.ts +35 -0
  259. package/types/src/chart/math/DateUnitCalcs.d.ts +80 -0
  260. package/types/src/chart/math/DisplayUnits.d.ts +53 -0
  261. package/types/src/chart/math/Histogram.d.ts +48 -0
  262. package/types/src/chart/math/OrdUnitCalcs.d.ts +166 -0
  263. package/types/src/chart/math/Treemap.d.ts +28 -0
  264. package/types/src/chart/math/Trendlines.d.ts +71 -0
  265. package/types/src/chart/math/UnitCalcs.d.ts +98 -0
  266. package/types/src/chart/model/ChartModel.d.ts +681 -0
  267. package/types/src/chart/model/_ChartType.d.ts +14 -0
  268. package/types/src/chart/model/_Edits.d.ts +489 -0
  269. package/types/src/chart/model/_Grouping.d.ts +83 -0
  270. package/types/src/chart/model/_Inference.d.ts +52 -0
  271. package/types/src/chart/model/_ModelFacts.d.ts +112 -0
  272. package/types/src/chart/model/_NewChart.d.ts +208 -0
  273. package/types/src/chart/model/_OfPie.d.ts +18 -0
  274. package/types/src/chart/resolve/_LegacyStyles.d.ts +48 -0
  275. package/types/src/chart/resolve/_Resolve.d.ts +61 -0
  276. package/types/src/chart/resolve/_ResolvedChart.d.ts +447 -0
  277. package/types/src/collections/ISparseGrid.d.ts +11 -2
  278. package/types/src/collections/MixedTypedArrayList.d.ts +8 -2
  279. package/types/src/collections/RTree.d.ts +116 -36
  280. package/types/src/collections/SparseGrid.d.ts +9 -11
  281. package/types/src/collections/SpatialMap.d.ts +2 -8
  282. package/types/src/collections/SpatialMap3D.d.ts +2 -0
  283. package/types/src/collections/index.d.ts +1 -1
  284. package/types/src/comment/Comment.d.ts +32 -9
  285. package/types/src/comment/IComment.d.ts +41 -4
  286. package/types/src/comment/_NoteBox.d.ts +19 -2
  287. package/types/src/condition/AnchoredConditional.d.ts +30 -4
  288. package/types/src/condition/ICondition.d.ts +3 -2
  289. package/types/src/conditionalFormat/ConditionalFormat.d.ts +9 -3
  290. package/types/src/conditionalFormat/IConditionalFormat.d.ts +4 -3
  291. package/types/src/dataValidation/DataValidation.d.ts +1 -1
  292. package/types/src/dataValidation/DataValidationCollection.d.ts +4 -1
  293. package/types/src/dataValidation/IDataValidation.d.ts +1 -1
  294. package/types/src/dataValidation/IDataValidationCollection.d.ts +24 -0
  295. package/types/src/documentProperties/DocumentProperties.d.ts +66 -0
  296. package/types/src/documentProperties/ICustomProperty.d.ts +69 -0
  297. package/types/src/documentProperties/IDocumentProperties.d.ts +110 -0
  298. package/types/src/documentProperties/index.d.ts +3 -0
  299. package/types/src/externalBook/IExternalBook.d.ts +3 -4
  300. package/types/src/fetch/Fetcher.d.ts +15 -0
  301. package/types/src/fetch/IFetcher.d.ts +47 -0
  302. package/types/src/fetch/_WorkbookFetch.d.ts +43 -0
  303. package/types/src/fetch/index.d.ts +3 -0
  304. package/types/src/fill/IFill.d.ts +7 -0
  305. package/types/src/fill/IFillable.d.ts +47 -0
  306. package/types/src/fill/IStroke.d.ts +15 -1
  307. package/types/src/fill/PaintUtils.d.ts +24 -0
  308. package/types/src/fill/index.d.ts +2 -0
  309. package/types/src/font/AdvanceBuilder.d.ts +34 -0
  310. package/types/src/font/AdvanceTable.d.ts +128 -14
  311. package/types/src/font/CanvasAdvanceBuilder.d.ts +54 -0
  312. package/types/src/font/FontCapture.d.ts +4 -0
  313. package/types/src/font/FontCollection.d.ts +53 -2
  314. package/types/src/font/FontPlatform.d.ts +20 -0
  315. package/types/src/font/FontUtils.d.ts +5 -0
  316. package/types/src/font/IFont.d.ts +191 -61
  317. package/types/src/font/IFontCollection.d.ts +20 -14
  318. package/types/src/font/IFontStyle.d.ts +207 -0
  319. package/types/src/font/TableFileAdvanceBuilder.d.ts +9 -0
  320. package/types/src/font/_FontUtils.d.ts +11 -4
  321. package/types/src/font/_FontsVersion.d.ts +7 -0
  322. package/types/src/font/index.d.ts +1 -3
  323. package/types/src/font/platform.browser.d.ts +15 -0
  324. package/types/src/font/platform.node.d.ts +5 -0
  325. package/types/src/group/Group.d.ts +5 -0
  326. package/types/src/group/GroupMovableCollection.d.ts +4 -0
  327. package/types/src/history/IHistory.d.ts +19 -2
  328. package/types/src/hyperlink/IHyperlink.d.ts +17 -1
  329. package/types/src/hyperlink/_Hyperlink.d.ts +4 -1
  330. package/types/src/index.d.ts +4 -0
  331. package/types/src/license/LicenseManager.d.ts +21 -0
  332. package/types/src/license/_Utils.d.ts +18 -1
  333. package/types/src/license/runtime.browser.d.ts +5 -0
  334. package/types/src/license/runtime.node.d.ts +10 -0
  335. package/types/src/listener/IListener.d.ts +14 -2
  336. package/types/src/listener/ListenerEmitter.d.ts +11 -3
  337. package/types/src/movable/IMovable.d.ts +28 -15
  338. package/types/src/movable/IMovableCollection.d.ts +1 -1
  339. package/types/src/movable/Movable.d.ts +12 -1
  340. package/types/src/movable/MovableCollection.d.ts +7 -3
  341. package/types/src/movable/_InsertableCollection.d.ts +16 -5
  342. package/types/src/named/INamed.d.ts +30 -0
  343. package/types/src/named/INamedCollection.d.ts +38 -2
  344. package/types/src/named/NamedCollection.d.ts +34 -4
  345. package/types/src/numFmt/NumberFormatParser.d.ts +5 -0
  346. package/types/src/outline/IOutline.d.ts +1 -1
  347. package/types/src/outline/Outline.d.ts +2 -2
  348. package/types/src/picture/IPicture.d.ts +98 -1
  349. package/types/src/picture/Picture.d.ts +15 -7
  350. package/types/src/pivot/IPivotTable.d.ts +2 -2
  351. package/types/src/pivot/PivotTable.d.ts +5 -5
  352. package/types/src/primitives/AsyncValue.d.ts +58 -0
  353. package/types/src/primitives/ReferenceRange.d.ts +2 -2
  354. package/types/src/print/IPageLayout.d.ts +635 -0
  355. package/types/src/print/PageLayout.d.ts +258 -0
  356. package/types/src/print/index.d.ts +1 -1
  357. package/types/src/protectedRange/IProtectedRange.d.ts +2 -2
  358. package/types/src/protection/IProtection.d.ts +6 -0
  359. package/types/src/protection/PasswordHasher.d.ts +13 -0
  360. package/types/src/resource/IResource.d.ts +9 -0
  361. package/types/src/resource/IResourceCollection.d.ts +4 -0
  362. package/types/src/resource/Resource.d.ts +2 -0
  363. package/types/src/resource/_AddResource.d.ts +13 -0
  364. package/types/src/richData/CellImage.d.ts +95 -0
  365. package/types/src/richData/Hyperlink.d.ts +49 -0
  366. package/types/src/richData/IRichDataCollection.d.ts +76 -0
  367. package/types/src/richData/IRichDataKind.d.ts +66 -0
  368. package/types/src/richData/RichArray.d.ts +42 -0
  369. package/types/src/richData/RichDataCollection.d.ts +23 -0
  370. package/types/src/richData/RichDataRegistry.d.ts +89 -0
  371. package/types/src/richData/RichDataValues.d.ts +20 -0
  372. package/types/src/richData/RichRecord.d.ts +68 -0
  373. package/types/src/richData/RichText.d.ts +59 -0
  374. package/types/src/richData/index.d.ts +9 -0
  375. package/types/src/scripting/FunctionArguments.d.ts +17 -1
  376. package/types/src/scripting/FunctionCollection.d.ts +8 -0
  377. package/types/src/scripting/IModule.d.ts +3 -3
  378. package/types/src/scripting/IScript.d.ts +2 -2
  379. package/types/src/scripting/ITypedFunction.d.ts +1 -1
  380. package/types/src/scripting/Scripts.d.ts +10 -0
  381. package/types/src/scripting/TypedFunction.d.ts +2 -0
  382. package/types/src/scripting/declarations.d.ts +3 -0
  383. package/types/src/selection/ChartElementSelection.d.ts +39 -0
  384. package/types/src/selection/IChartElementSelection.d.ts +103 -0
  385. package/types/src/selection/IItemSelection.d.ts +131 -0
  386. package/types/src/selection/IMovableSelection.d.ts +6 -34
  387. package/types/src/selection/IRangeSelection.d.ts +4 -4
  388. package/types/src/selection/ItemSelection.d.ts +49 -0
  389. package/types/src/selection/MovableSelection.d.ts +11 -30
  390. package/types/src/selection/RangeSelection.d.ts +4 -4
  391. package/types/src/selection/index.d.ts +3 -0
  392. package/types/src/shape/IShape.d.ts +2 -1
  393. package/types/src/shape/IShapeStyle.d.ts +5 -31
  394. package/types/src/shape/ITextBoxStyle.d.ts +85 -0
  395. package/types/src/shape/ShapeStyleUtils.d.ts +13 -1
  396. package/types/src/shape/_Connectors.d.ts +9 -9
  397. package/types/src/shape/_ShapeStyle.d.ts +9 -0
  398. package/types/src/shape/index.d.ts +1 -0
  399. package/types/src/sheet/CellRegion.d.ts +37 -3
  400. package/types/src/sheet/ICellContainerOptions.d.ts +6 -0
  401. package/types/src/sheet/IOpaqueSheet.d.ts +46 -0
  402. package/types/src/sheet/ISheet.d.ts +81 -1078
  403. package/types/src/sheet/IWorksheet.d.ts +1521 -0
  404. package/types/src/sheet/{ISheetCollection.d.ts → IWorksheetCollection.d.ts} +37 -12
  405. package/types/src/sheet/NamedCellRange.d.ts +2 -2
  406. package/types/src/sheet/NamedRange.d.ts +2 -2
  407. package/types/src/sheet/OpaqueSheet.d.ts +114 -0
  408. package/types/src/sheet/SheetCell.d.ts +40 -27
  409. package/types/src/sheet/SheetRange.d.ts +50 -13
  410. package/types/src/sheet/SheetRanges.d.ts +14 -12
  411. package/types/src/sheet/{Sheet.d.ts → Worksheet.d.ts} +591 -171
  412. package/types/src/sheet/WorksheetCollection.d.ts +39 -0
  413. package/types/src/sheet/_CellBuffer.d.ts +11 -1
  414. package/types/src/sheet/_CopyUtils.d.ts +13 -6
  415. package/types/src/sheet/_IgnoredErrors.d.ts +46 -0
  416. package/types/src/sheet/_InvalidSheetRange.d.ts +3 -2
  417. package/types/src/sheet/_Kinds.d.ts +34 -0
  418. package/types/src/sheet/_Labels.d.ts +38 -0
  419. package/types/src/sheet/_ListenerAnchor.d.ts +7 -1
  420. package/types/src/sheet/_RangeStateSweep.d.ts +2 -3
  421. package/types/src/sheet/_ScalarListFactory.d.ts +55 -7
  422. package/types/src/sheet/_SheetAutoFillUtils.d.ts +3 -3
  423. package/types/src/sheet/_SheetAutoFitUtils.d.ts +3 -3
  424. package/types/src/sheet/_SheetChangeEvent.d.ts +72 -0
  425. package/types/src/sheet/_SheetCoords.d.ts +3 -3
  426. package/types/src/sheet/_SheetEvents.d.ts +1 -1
  427. package/types/src/sheet/_SheetFilterUtils.d.ts +6 -6
  428. package/types/src/sheet/_SheetIntents.d.ts +32 -14
  429. package/types/src/sheet/_SheetMessages.d.ts +1 -1
  430. package/types/src/sheet/_SheetMutations.d.ts +11 -9
  431. package/types/src/sheet/_SheetSortUtils.d.ts +2 -2
  432. package/types/src/sheet/_SheetStateReader.d.ts +18 -0
  433. package/types/src/sheet/_SheetStateTypes.d.ts +80 -9
  434. package/types/src/sheet/_SheetUtils.d.ts +20 -19
  435. package/types/src/sheet/_WatchAnchor.d.ts +15 -2
  436. package/types/src/sheet/clipboard/RangeClipboardItems.d.ts +4 -4
  437. package/types/src/sheet/clipboard/SheetHTMLTableParser.d.ts +3 -3
  438. package/types/src/sheet/clipboard/SheetHTMLTableWriter.d.ts +3 -3
  439. package/types/src/sheet/index.d.ts +5 -2
  440. package/types/src/sheet/style/SheetCellStyle.d.ts +67 -86
  441. package/types/src/sheet/style/SheetDirectStyle.d.ts +3 -3
  442. package/types/src/sheet/style/SheetNamedStyle.d.ts +2 -0
  443. package/types/src/sheet/style/_DigitWidth.d.ts +7 -0
  444. package/types/src/sheet/style/_Resolvers.d.ts +3 -2
  445. package/types/src/sheet/style/_StyleUtils.d.ts +7 -43
  446. package/types/src/sheetHeader/ISheetHeader.d.ts +2 -2
  447. package/types/src/sheetHeader/SheetCellHeader.d.ts +2 -0
  448. package/types/src/sheetHeader/SheetCellHeaderRange.d.ts +2 -0
  449. package/types/src/sheetHeader/SheetCellHeaderRanges.d.ts +2 -0
  450. package/types/src/sheetHeader/SheetHeader.d.ts +7 -6
  451. package/types/src/sheetHeader/_HeaderUtils.d.ts +2 -3
  452. package/types/src/sheetProtection/{ISheetProtection.d.ts → IWorksheetProtection.d.ts} +28 -28
  453. package/types/src/sheetProtection/WorksheetProtection.d.ts +51 -0
  454. package/types/src/sheetProtection/index.d.ts +1 -1
  455. package/types/src/sheetView/{ISheetView.d.ts → IWorksheetView.d.ts} +168 -61
  456. package/types/src/sheetView/WorksheetView.d.ts +139 -0
  457. package/types/src/sheetView/_SheetViewUtils.d.ts +5 -3
  458. package/types/src/sheetView/index.d.ts +1 -1
  459. package/types/src/slicer/ISlicer.d.ts +2 -2
  460. package/types/src/sort/ISort.d.ts +35 -5
  461. package/types/src/style/ICellStyle.d.ts +56 -44
  462. package/types/src/style/_BuiltInStyleDefs.d.ts +4 -3
  463. package/types/src/table/AnchoredTable.d.ts +23 -7
  464. package/types/src/table/AutoTable.d.ts +1 -1
  465. package/types/src/table/ITable.d.ts +32 -19
  466. package/types/src/table/_NamedTable.d.ts +3 -3
  467. package/types/src/table/_NamedTableSource.d.ts +2 -2
  468. package/types/src/text/IText.d.ts +4 -51
  469. package/types/src/text/TextEngine.d.ts +34 -0
  470. package/types/src/text/TextFrame.d.ts +4 -2
  471. package/types/src/text/TextRun.d.ts +3 -2
  472. package/types/src/text/TextWrapper.d.ts +32 -26
  473. package/types/src/text/_TextUtils.d.ts +5 -5
  474. package/types/src/text/_TextWrapperFallback.d.ts +49 -0
  475. package/types/src/text/impl/TabStrategy.d.ts +3 -1
  476. package/types/src/text/richtext/IRichText.d.ts +16 -2
  477. package/types/src/text/richtext/index.d.ts +0 -1
  478. package/types/src/theme/ITheme.d.ts +108 -7
  479. package/types/src/theme/ThemeCollection.d.ts +5 -0
  480. package/types/src/theme/_OfficeFontScheme.d.ts +8 -0
  481. package/types/src/transaction/ITransaction.d.ts +20 -1
  482. package/types/src/transaction/Transaction.d.ts +8 -1
  483. package/types/src/transaction/_BatchHandle.d.ts +118 -0
  484. package/types/src/type/AbstractCollection.d.ts +4 -13
  485. package/types/src/type/ICollection.d.ts +17 -4
  486. package/types/src/type/IProperties.d.ts +1 -1
  487. package/types/src/utils/_CSSUtils.d.ts +1 -1
  488. package/types/src/wasm/_fontsWasm.d.ts +7 -0
  489. package/types/src/wasm/_sdkWasm.d.ts +1 -1
  490. package/types/src/wasm/fontsWasm.d.ts +32 -0
  491. package/types/src/wasm/index.d.ts +1 -0
  492. package/types/src/wasm/loader.browser.d.ts +9 -0
  493. package/types/src/wasm/loader.node.d.ts +9 -0
  494. package/types/src/wasm/sdkWasm.d.ts +6 -3
  495. package/types/src/workbook/IWorkbook.d.ts +269 -39
  496. package/types/src/workbook/Workbook.d.ts +102 -25
  497. package/types/src/workbook/WorkbookRange.d.ts +2 -2
  498. package/types/src/workbook/WorkbookRanges.d.ts +3 -3
  499. package/types/src/workbook/_WorkbookIntents.d.ts +2 -2
  500. package/types/src/workbook/_WorkbookMessages.d.ts +5 -0
  501. package/types/src/workbookView/IWorkbookView.d.ts +82 -0
  502. package/types/src/workbookView/WorkbookView.d.ts +21 -0
  503. package/browser/esm/BbSmt62FpFIpoVzu.mjs +0 -392
  504. package/browser/esm/BgcZ-CoTbMfmyDJL.mjs +0 -412
  505. package/browser/esm/DOMHmhYzPcLVcpAW.mjs +0 -7
  506. package/browser/esm/DUvUK61b2_4pf4tG.mjs +0 -484
  507. package/node/esm/CCouEwT37f08qO3V.mjs +0 -7
  508. package/node/esm/CImNvdz1iP-lUlro.mjs +0 -610
  509. package/node/esm/CT0CN82y0_Qgoryk.mjs +0 -7568
  510. package/node/esm/DHUADiCmxNQS1ARz.mjs +0 -417
  511. package/node/esm/Ds0d8zXzmgOu3MGx.mjs +0 -403
  512. package/types/src/chart/_ChartXml.d.ts +0 -70
  513. package/types/src/collections/OverlappingRangeIterator.d.ts +0 -87
  514. package/types/src/collections/_RangeSweep.d.ts +0 -97
  515. package/types/src/font/CanvasFontMeasurer.d.ts +0 -25
  516. package/types/src/font/FontKitFontMeasurer.d.ts +0 -11
  517. package/types/src/font/SimpleFontMeasurer.d.ts +0 -4
  518. package/types/src/print/IPrint.d.ts +0 -212
  519. package/types/src/sheet/SheetCollection.d.ts +0 -29
  520. package/types/src/sheetProtection/SheetProtection.d.ts +0 -51
  521. package/types/src/sheetView/SheetView.d.ts +0 -122
  522. package/types/src/text/richtext/IStyledFont.d.ts +0 -330
@@ -0,0 +1,953 @@
1
+ import { IRange, IFormulaContext, IRuntime, Scalar } from '@sheetxl/primitives';
2
+ import { FunctionProvider } from '@sheetxl/scripting';
3
+ import { AbstractModel, IModel } from '../../model';
4
+ import { ITransaction } from '../../transaction';
5
+ import { IRichDataKind } from '../../richData/IRichDataKind';
6
+ import { ISpatialMap, ISpatialQuery, ISpatialMap3D, ISparseGrid } from '../../collections';
7
+ import { IExternalBookCollection } from '../../externalBook';
8
+ import { ICalculation } from '../ICalculation';
9
+ import { NamedNodeInfo } from '../Types';
10
+ import { TableExtent } from '../_TableExtent';
11
+ import { IFormulaCompiler } from '../compiler';
12
+ import { FormulaBlockResolvers, IFormulaBlock, FormulaImager } from '../formula';
13
+ import { CalculationContext } from '../state/CalculationContext';
14
+ import { IContextContainer, CalcNode, CalcScope } from '../state';
15
+ import { DeferredCalls, DeferredCall } from '../state/DeferredCalls';
16
+ import { AsyncValue } from '../../primitives/AsyncValue';
17
+ import { PrecedentSpatialValue, PrecedentKind } from '../spatial';
18
+ import { FormulaSpatialValue } from '../spatial/FormulaSpatialValue';
19
+ import { CalcExecutor } from '../executor/CalcExecutor';
20
+ import { WhatIfTable } from '../executor/_WhatIf';
21
+ import { CalcGridBackend } from '../grid/CalcGridBackend';
22
+ import { ICalcGrid, FormulaHost } from '../grid';
23
+ import { CalcRequest, CalcResponse, CalcGridSpec, TableSymbols, NameSymbols } from '../grid/_CalcRequest';
24
+ import { ExternalBookBindings, ExternalNamedItem } from '../ExternalBookBindings';
25
+ import { ISymbolRegistry } from '../symbol';
26
+ /**
27
+ * The calculation backend: the engine's store and everything kept in it, and the container its
28
+ * grids, formulas and executor work against (DESIGN-CALC-SERVICE §5).
29
+ *
30
+ * @remarks
31
+ * Made by the first `start()` from the loaded engine module, and kept across a stop and a restart.
32
+ * Its history is its own (§13.13): every model commit has a mirror here, a request lands under the
33
+ * model's operation or savepoint it was made in, and a revert names a model commit. The model's ids
34
+ * are known to it through one map, landing to engine commit.
35
+ *
36
+ * What it asks of the calculation that made it is {@link CalcBackend.Callbacks}, and nothing else.
37
+ */
38
+ export declare class CalcBackend extends AbstractModel<CalcBackend.State> implements IContextContainer {
39
+ protected _callbacks: CalcBackend.Callbacks;
40
+ protected _runtime: IRuntime;
41
+ protected _richData: IRichDataKind.Context;
42
+ protected _symbols: ISymbolRegistry;
43
+ protected _resolvers: FormulaBlockResolvers;
44
+ protected _getSheetIndex: ((sheetName?: string) => number) | null;
45
+ protected _legacyIntersect: boolean;
46
+ protected _gridOptions: Partial<CalcGridBackend.ConstructorOptions>;
47
+ protected _calculation: ICalculation;
48
+ protected _context: CalculationContext & IFormulaContext;
49
+ protected _calcExecutor: CalcExecutor;
50
+ /** The cache as grids and the cached names as virtual grids — see {@link ExternalBookBindings}. */
51
+ protected _externalBindings: ExternalBookBindings;
52
+ protected _calcScope: CalcScope;
53
+ protected _cycleId: number;
54
+ protected _staticEpoch: number;
55
+ protected _precedentEpoch: number;
56
+ protected _epochSeenFormulas: ISpatialMap3D<FormulaSpatialValue> | null;
57
+ protected _epochSeenPrecedents: ISpatialMap3D<PrecedentSpatialValue> | null;
58
+ protected _epochSeenDynamics: Map<FormulaSpatialValue, ISpatialMap.Entry<PrecedentSpatialValue>[]> | null;
59
+ protected _volatiles: Set<CalcNode>;
60
+ protected _deferred: DeferredCalls;
61
+ protected _calculatedCommitId: string | null;
62
+ protected _calculatedEngineId: string | null;
63
+ /** The engine holds grids: from a start's boot until a stop. */
64
+ protected _holdsGrids: boolean;
65
+ protected _engineIds: Map<string, string>;
66
+ protected _landingOf: Map<string, string>;
67
+ protected _mirroredId: string | null;
68
+ protected _lastRevert: {
69
+ commitId: string;
70
+ regions: Map<string, IRange.Coords[]>;
71
+ } | null;
72
+ protected _symbolIndex: Map<string, IRange.Coords[]> | null;
73
+ protected _symbolIndexOf: ISpatialMap3D<FormulaSpatialValue> | null;
74
+ private _sheetsDerived;
75
+ private _tablesDerived;
76
+ private _namesDerived;
77
+ /**
78
+ * The grid registry and the grid maps as the batch {@link applyHeld} applies has written them,
79
+ * held here and written to the state once when the batch ends.
80
+ *
81
+ * @remarks
82
+ * Outside a batch each registration and each publish copies the whole map into a state of its
83
+ * own, so that every snapshot stays what it was. Inside the start batch that is one copy per
84
+ * grid over every grid, and a load whose defined names each compile into a grid of their own
85
+ * (thousands, in a legacy file) made the start quadratic in them - in time, and in the copies the
86
+ * batch's commit kept alive until it ended. `null` outside a batch.
87
+ */
88
+ private _collecting;
89
+ /**
90
+ * The names whose readers a drain recompiles ({@link recompileNamed}) or marks
91
+ * ({@link invalidateNamed}), gathered until that drain: each is one scan of every formula, and
92
+ * a load wires every name it holds in one batch.
93
+ */
94
+ private _recompileNamedPending;
95
+ private _invalidateNamedPending;
96
+ constructor(options: CalcBackend.ConstructorOptions);
97
+ /** Initializes the context: the function registry the backend calls through. */
98
+ initialize(): ReturnType<CalculationContext['_initialize']>;
99
+ /** The context every formula block evaluates in. */
100
+ getContext(): CalculationContext & IFormulaContext;
101
+ /** {@inheritDoc IContextContainer.getRuntime} */
102
+ getRuntime(): IRuntime;
103
+ /** {@inheritDoc IContextContainer.getRichDataContext} */
104
+ getRichDataContext(): IRichDataKind.Context;
105
+ /** {@inheritDoc IContextContainer.getScope} */
106
+ getScope(): CalcScope;
107
+ /** {@inheritDoc IContextContainer.getDeferred} */
108
+ getDeferred(): DeferredCalls;
109
+ /**
110
+ * The settle pass (DESIGN-ASYNC §4.5): a change with no write, for every call whose latest
111
+ * moved since the last one.
112
+ *
113
+ * @remarks
114
+ * A cell whose formula is its one call reads the latest through its holder: the model is told
115
+ * the cell's value as it reads now, its pending status clears, and its dependents are marked
116
+ * dirty — never the cell itself. A cell whose formula is more than its call is marked dirty
117
+ * itself, and its next evaluation serves each site its call. One settle pass follows, seeded from
118
+ * what was marked and nothing else, and vends the repaints with its results.
119
+ *
120
+ * A call whose owner's cell no longer names it — the cell was edited, or its version is not the
121
+ * current one — settles into that version's holder and nothing here.
122
+ */
123
+ protected _settle(): void;
124
+ /**
125
+ * Cancels every call `cover` covers (`ICalculation.cancelAsync`, DESIGN-ASYNC §4.6): each is
126
+ * closed and its `onCancel` runs. Each owner whose cell still names its call re-evaluates in a
127
+ * settle pass: served the closed call, it shows what it did and is no longer pending.
128
+ *
129
+ * @returns The settle pass, or `null` when nothing was cancelled.
130
+ */
131
+ cancelAsync(cover: true | string | IRange.Coords): Promise<ICalculation.Status> | null;
132
+ /**
133
+ * A call's result as a cell can hold it (`DeferredCalls.Normalize`): an array becomes a range
134
+ * as a body's array return does, a one-cell range its scalar, a jagged array `#VALUE!`.
135
+ */
136
+ protected _normalizeResult(value: unknown): unknown;
137
+ /**
138
+ * The holder at a cell: the engine grid's value there, else the entry of the spill anchored
139
+ * there (an anchor cell holds its first element; the spill's entry carries the holder). `null`
140
+ * for a cell with neither.
141
+ */
142
+ protected _holderAt(gridId: string, row: number, column: number): AsyncValue<DeferredCall> | null;
143
+ protected _settleNow(): void;
144
+ /** {@inheritDoc IContextContainer.createFormulaBlock} */
145
+ createFormulaBlock(gridId: string, context: IFormulaContext, expression: string, rowIndex: number, colIndex: number, editing?: ICalculation.FormulaTarget, legacyIntersect?: boolean): IFormulaBlock;
146
+ /** {@inheritDoc IContextContainer.getSymbols} */
147
+ getSymbols(): ISymbolRegistry;
148
+ /**
149
+ * {@inheritDoc IContextContainer.resolveScope}
150
+ *
151
+ * @remarks
152
+ * Bound: a reference range is handed it as a function of its own.
153
+ */
154
+ resolveScope: (scope: string) => string | undefined;
155
+ /** {@inheritDoc IContextContainer.getSheetIndex} */
156
+ getSheetIndex(sheetName?: string): number;
157
+ /** {@inheritDoc IContextContainer.getSheetCount} */
158
+ getSheetCount(): number;
159
+ /** {@inheritDoc IContextContainer.getSheetIds} */
160
+ getSheetIds(): readonly string[];
161
+ /** {@inheritDoc IContextContainer.getSheetSpanIds} */
162
+ getSheetSpanIds(scopeId: string): string[] | null;
163
+ /** {@inheritDoc IContextContainer.getFormulas} */
164
+ getFormulas(): ISpatialMap3D<FormulaSpatialValue>;
165
+ /** {@inheritDoc IContextContainer.setFormulas} */
166
+ setFormulas(spatial: ISpatialMap3D<FormulaSpatialValue>): void;
167
+ /** {@inheritDoc IContextContainer.getPrecedents} */
168
+ getPrecedents(): ISpatialMap3D<PrecedentSpatialValue>;
169
+ /** {@inheritDoc IContextContainer.setPrecedents} */
170
+ setPrecedents(spatial: ISpatialMap3D<PrecedentSpatialValue>): void;
171
+ /** {@inheritDoc IContextContainer.getDynamics} */
172
+ getDynamics(): Map<FormulaSpatialValue, ISpatialMap.Entry<PrecedentSpatialValue>[]>;
173
+ /** {@inheritDoc IContextContainer.setDynamics} */
174
+ setDynamics(map: Map<FormulaSpatialValue, ISpatialMap.Entry<PrecedentSpatialValue>[]>): void;
175
+ /** {@inheritDoc IContextContainer.addDynamicPrecedent} */
176
+ addDynamicPrecedent(node: CalcNode, range: IRange.Coords | undefined, kind: PrecedentKind): void;
177
+ /** {@inheritDoc IContextContainer.evaluateWhatIf} */
178
+ evaluateWhatIf(table: WhatIfTable): Scalar[][];
179
+ /** {@inheritDoc IContextContainer.getVolatiles} */
180
+ getVolatiles(): Set<CalcNode>;
181
+ /** {@inheritDoc IContextContainer.isLegacyIntersect} */
182
+ isLegacyIntersect(): boolean;
183
+ /** {@inheritDoc IContextContainer.getGridValues} */
184
+ getGridValues(gridId: string): ISparseGrid<Scalar>;
185
+ /** {@inheritDoc IContextContainer.getIncrementalUpdates} */
186
+ getIncrementalUpdates(gridId: string): ICalcGrid.IncrementalUpdates | null;
187
+ /** {@inheritDoc IContextContainer.registerGrid} */
188
+ registerGrid(grid: CalcGridBackend): void;
189
+ /** {@inheritDoc IContextContainer.unregisterGrid} */
190
+ unregisterGrid(gridId: string): void;
191
+ /** The grids by id, as the open batch has them, else as the state does. */
192
+ protected _gridsAll(): Map<string, CalcGridBackend>;
193
+ /**
194
+ * Writes the grid registry: a copy of its own in the state, or the open batch's copy, which
195
+ * reaches the state when the batch ends. See {@link _collecting}.
196
+ */
197
+ private _writeGridsAll;
198
+ /** {@link _writeGridsAll}, for the grid maps. */
199
+ private _writeGridMaps;
200
+ /**
201
+ * Runs `batch` with the grid registry and maps collected, and writes them to the state once after;
202
+ * its requests share one clone key (see {@link getHeldCloneKey}) unless the caller set one.
203
+ *
204
+ * @remarks
205
+ * A held batch's, and a burst of defined-name compiles' (`NamedFormulaCollection._materializeMany`):
206
+ * both make many grids under one engine operation, and without this each grid's registration is
207
+ * a write that copies a registry holding an entry per sheet and per compiled name.
208
+ * @internal
209
+ */
210
+ _collectingGrids<R>(batch: () => R): R;
211
+ /** {@inheritDoc IContextContainer.getGrid} */
212
+ getGrid(gridId: string): CalcGridBackend | null;
213
+ /** {@inheritDoc IContextContainer.markDirty} */
214
+ markDirty(dirtyRegions: ISpatialMap.Entry[]): boolean;
215
+ /** {@inheritDoc IContextContainer.getDirtyGrid} */
216
+ getDirtyGrid(gridId: string): ISpatialQuery;
217
+ /** {@inheritDoc IContextContainer.calculateGrid} */
218
+ calculateGrid(gridId: string, options?: ICalculation.CalculateOptions): Promise<ICalculation.Status>;
219
+ /** {@inheritDoc IContextContainer.requestCalculateGrid} */
220
+ requestCalculateGrid(gridId: string): void;
221
+ /** {@inheritDoc IContextContainer.getCycleId} */
222
+ getCycleId(): number;
223
+ /** {@inheritDoc IContextContainer.getCalculatedCommitId} */
224
+ getCalculatedCommitId(): string | null;
225
+ /**
226
+ * {@inheritDoc IContextContainer.landRequest}
227
+ *
228
+ * @remarks
229
+ * A root-level request after a nested savepoint of the same root has landed: the root's own
230
+ * commit is behind the tip, and the savepoint is part of the root for good, so the write joins
231
+ * the tip. The engine's live maps are always the tip's.
232
+ */
233
+ landRequest<R>(landingId: string | undefined, action: () => R): R;
234
+ /** {@inheritDoc IContextContainer.sendRequest} */
235
+ sendRequest(gridId: string, landingId: string | undefined, request: CalcRequest): Promise<ICalcGrid.Results>;
236
+ /** {@inheritDoc IContextContainer.getImager} */
237
+ getImager(gridId: string): FormulaImager;
238
+ /** {@inheritDoc IContextContainer.setGridMaps} */
239
+ setGridMaps(gridId: string, maps: object): void;
240
+ /** {@inheritDoc IContextContainer.recordTouched} */
241
+ recordTouched(gridId: string, regions: readonly IRange.Coords[]): void;
242
+ private _recordTouchedNow;
243
+ /** {@inheritDoc IContextContainer.revertTo} */
244
+ revertTo(commitId: string, gridId: string): IRange.Coords[] | null;
245
+ /** {@inheritDoc IContextContainer.getCalcEpochs} */
246
+ getCalcEpochs(): {
247
+ staticEpoch: number;
248
+ precedentEpoch: number;
249
+ };
250
+ /** {@inheritDoc IContextContainer.bumpCalcEpochs} */
251
+ bumpCalcEpochs(includeStatic: boolean): void;
252
+ /** {@inheritDoc IContextContainer.getNow} */
253
+ getNow(): number;
254
+ /** {@inheritDoc IContextContainer.whenSafe} */
255
+ whenSafe(action: () => Promise<unknown>): void;
256
+ /** {@inheritDoc IContextContainer.isLoading} */
257
+ isLoading(): boolean;
258
+ /** {@inheritDoc IContextContainer.recompileNamed} */
259
+ recompileNamed(nameId: string): void;
260
+ /** {@inheritDoc IContextContainer.invalidateNamed} */
261
+ invalidateNamed(nameId: string): void;
262
+ /** {@inheritDoc IContextContainer.getNamedNodeInfo} */
263
+ getNamedNodeInfo(nameId: string, live?: boolean): NamedNodeInfo | null;
264
+ /**
265
+ * {@inheritDoc IContextContainer.getNamedDependents}
266
+ *
267
+ * @remarks
268
+ * The bucket for a NAME out of {@link getSymbolDependents}: one index for every symbol kind.
269
+ */
270
+ getNamedDependents(nameId: string): readonly IRange.Coords[];
271
+ /**
272
+ * {@inheritDoc IContextContainer.getNamedDependentNames}
273
+ *
274
+ * @remarks
275
+ * A block that depends on a name and lives on a VIRTUAL grid is another name's BODY, and that
276
+ * grid's id is that name's id — `add` binds the two together and `delete` keeps the grid rather
277
+ * than dropping it. So the hop is a bucket lookup on the id itself; a sheet grid id is never a
278
+ * name id, which the calculation is asked to confirm before the walk continues through one.
279
+ *
280
+ * Expands each id once. That is the cycle guard (`A = B+1`, `B = A+1` reaches `A` again on its
281
+ * second hop) and the diamond guard both.
282
+ */
283
+ getNamedDependentNames(nameId: string): ReadonlySet<string>;
284
+ /**
285
+ * What a `nameGraph` request answers: a defined name's precedents or dependents, cells scoped by
286
+ * grid and names as nodes - ONE answer, as a cell's is.
287
+ *
288
+ * @remarks
289
+ * The PRECEDENTS: the cell half is the ordinary precedent graph of the name's grid - a body is a
290
+ * real formula there, and its references registered precedent ranges like any cell's. The name
291
+ * half is the body's `getNamedIds`: apply-at-eval means a name the body reads has no precedent
292
+ * edge, so the symbol list is the only carrier - one hop for `direct`, the downward closure
293
+ * (cycle-guarded) for the deep form, each member contributing its own grid's cell walk. The deep
294
+ * form does not take the symbol hop from UPSTREAM CELLS (`X = A1*2`, `A1 = SomeName`: `A1` is
295
+ * listed and `SomeName`'s inputs are not) - that hop is `A1`'s, one step of a tree walk. A name
296
+ * with no grid (it has not compiled) has nothing to walk.
297
+ *
298
+ * The DEPENDENTS: two graphs meet, and the walk changes vehicles between them. The symbol edge -
299
+ * which formulas mention this name - is not in the precedent spatial at all; it is the symbol
300
+ * index ({@link getNamedDependents}), keyed by the name's id, so the name's own grid is never
301
+ * read: a name that has not compiled is answered as one that has. The cell edge is the precedent
302
+ * graph, which carries everything downstream of those blocks: `direct` is one hop of the first;
303
+ * the deep form takes it, then hands each landing block to its grid. A block on a watch's grid
304
+ * (a conditional format, a validation, a chart) is the cells it is attached to, on the sheet the
305
+ * watch shadows. A block on any other grid that is no sheet is another NAME reading this one: a
306
+ * node, and the deep walk passes THROUGH it on the symbol closure (`getNamedDependentNames`), or
307
+ * `Base`'s dependents would stop at `Plus1`. This name is listed only when a true cycle leads
308
+ * back to it.
309
+ */
310
+ protected _nameGraphNow(nameId: string, kind: 'precedents' | 'dependents', direct: boolean): ICalcGrid.GraphNeighbors;
311
+ /** A grid of the backend's, registered. */
312
+ createBackendGrid(options?: CalcGridBackend.ConstructorOptions): CalcGridBackend;
313
+ /**
314
+ * The engine's grid for a model grid, as a `create` describes it. What it pushes reaches the
315
+ * model grid under the same id.
316
+ */
317
+ createEngineGrid(spec: CalcGridSpec): CalcGridBackend;
318
+ /** The engine holds grids from here: an external book's cache is the engine's own content, made now. */
319
+ open(): void;
320
+ /**
321
+ * The engine's graph and every grid in it, gone: what a stop leaves, and what a rebuild starts
322
+ * from. The model's grids are untouched.
323
+ */
324
+ drop(): void;
325
+ /** Every grid the engine holds, by id. */
326
+ getGrids(): ReadonlyMap<string, CalcGridBackend>;
327
+ /**
328
+ * Brings the external books' grids and cached names into step with the collection.
329
+ *
330
+ * @remarks
331
+ * The first, `initial`, is made once the calculation holds this backend: binding a cached name
332
+ * looks the name up through the calculation's symbols, which ask the backend for it.
333
+ *
334
+ * @param initial The sync made when the backend is, before any formula has compiled.
335
+ * @returns The ids of the books whose grids or names changed.
336
+ */
337
+ syncExternalBooks(initial?: boolean): ReadonlySet<string>;
338
+ /** A cached name of an external book, by the id its virtual grid is registered under. */
339
+ getExternalName(id: string): ExternalNamedItem | null;
340
+ /** A cached name of an external book, by its spelling within a book's scope. */
341
+ getExternalNameByScope(name: string, scopeId: string): ExternalNamedItem | null;
342
+ /**
343
+ * Applies one request from the channel: the service's own (`sheets`, `tables`, `names`,
344
+ * `nameGraph`, `rollback`, `create`) here, a grid's on its grid. A request for a grid the engine does not hold
345
+ * is answered with nothing.
346
+ *
347
+ * @param held The request was held while the engine came up: it lands under the engine's
348
+ * current commit, whose snapshot it was made at has been mirrored already.
349
+ * @throws What the grid throws applying it.
350
+ */
351
+ apply(gridId: string, landingId: string | undefined, request: CalcRequest, held?: boolean): CalcResponse | PromiseLike<CalcResponse>;
352
+ /**
353
+ * Applies what the channel held while the engine came up (DESIGN-CALC-SERVICE §6.3): every
354
+ * grid made first, then a defined name's body, in its own order (`ICalcGrid.BodyOptions.priority`),
355
+ * then the rest in send order. A name must be bound before any formula that mentions it is
356
+ * examined, and each is held behind the create of its own grid.
357
+ *
358
+ * @remarks
359
+ * Every sheet a held `sheets` message adds enters the replica at its end first, under the name it
360
+ * was first listed by: a defined name's body is applied ahead of the seeds and may name a sheet
361
+ * listed while starting. Every table a held `tables` message adds enters the same way, under the
362
+ * name and columns it was first told by: a seed sent ahead of a later sheet's tables compiles a
363
+ * reference to one, and a reference to a table the replica does not hold is refused. The messages
364
+ * themselves still apply in send order, so a seed sent before a rename binds the name it was sent
365
+ * under.
366
+ *
367
+ * A request whose snapshot the model has undone since (`dead`) is answered and not applied,
368
+ * except a grid's `create`.
369
+ *
370
+ * @param wroteWhileOff Something was written while the engine was `Off`: a seed asking for a
371
+ * full pass keeps it. Otherwise its values are the engine's own, or a file's.
372
+ * @returns What each request answered, in the order they were applied.
373
+ */
374
+ applyHeld(batch: readonly CalcBackend.Held[], wroteWhileOff: boolean): CalcBackend.Applied[];
375
+ /** {@inheritDoc IContextContainer.getHeldCloneKey} */
376
+ getHeldCloneKey(): string | null;
377
+ /** See {@link getHeldCloneKey}. */
378
+ private _heldCloneKey;
379
+ protected _applyHeldNow(batch: readonly CalcBackend.Held[], wroteWhileOff: boolean): CalcBackend.Applied[];
380
+ /**
381
+ * The model restored itself to `commitId`: the engine restores its own history there.
382
+ *
383
+ * @remarks
384
+ * An engine that is not up holds nothing to restore; it answers for the model's snapshot from
385
+ * here, and its start opens from it. One coming up holds the start's replicas, made after any
386
+ * commit it has no mirror of: restored where it has one, otherwise it answers for the
387
+ * snapshot. A `Running` one whose history does not reach the commit (one from before its
388
+ * start, or trimmed since) is rebuilt from the model as it is there.
389
+ *
390
+ * @param status The calculation's status now.
391
+ * @returns Whether a rebuild is owed.
392
+ */
393
+ followRestore(commitId: string, status: ICalculation.Status): boolean;
394
+ /**
395
+ * The engine made again from the model, as a start makes it: its graph dropped, its replicas as
396
+ * given, the external books' grids made. The model's grids are opened behind it, and its history
397
+ * starts there ({@link forgetEarlierLandings}).
398
+ */
399
+ rebuild(replica: CalcBackend.Replica): void;
400
+ /**
401
+ * Compiles an expression at a cell without writing it anywhere: what `ICalculation.createFormula`
402
+ * is built on.
403
+ *
404
+ * @remarks
405
+ * A `virtual` formula is held in a grid of its own (`temporary`), compiled as if written on
406
+ * `gridId`. It compiles with the `'editing'` profile, in `target`'s form: the text exactly as
407
+ * typed, and as much structure as a partial parse recovers (see FormulaCompilerProfile).
408
+ *
409
+ * @returns `null` when the grid the formula is anchored in does not exist.
410
+ */
411
+ compileTemporary(expression: string, at: CalcBackend.TemporaryAt): CalcBackend.Temporary | null;
412
+ /**
413
+ * Formula text as a cell of `gridId` at (`rowIndex`, `colIndex`) would store it, without writing
414
+ * it anywhere: compiled for storage, so `[#This Row]` becomes `@` and an unqualified structured
415
+ * reference is given the name of the table it binds to there.
416
+ */
417
+ toStoredText(gridId: string, expression: string, rowIndex: number, colIndex: number): string;
418
+ /**
419
+ * Every formula block that references a symbol — a defined name, a table, or an external BOOK —
420
+ * by its stable id, as `{ ...ref, scope: gridId }` coords.
421
+ *
422
+ * @remarks
423
+ * The memo is keyed on the formula spatial's IDENTITY, which is the whole invalidation story:
424
+ * the map is copy-on-write (`getFormulas().clone()` before any mutation, `setFormulas` to
425
+ * publish), so a formula added, removed, shifted or recompiled necessarily replaces it — and an
426
+ * undo, which restores an earlier map, replaces it too. Nothing has to remember to clear this.
427
+ *
428
+ * The sweep is the same `all3D` walk {@link recompileReferencing} and
429
+ * {@link markDirtyReferencing} already do, done once for every symbol instead of once per
430
+ * symbol. Bucketed off `getReferencedSymbolIds()` — names, tables and books alike — so a book's
431
+ * dependents (`IExternalBook.getDependents`) come out of the same walk as a name's, and a name's
432
+ * body that cites a book lands in the book's bucket with the name's id as its scope.
433
+ */
434
+ getSymbolDependents(symbolId: string): readonly IRange.Coords[];
435
+ /**
436
+ * Every symbol id a formula cites, to the blocks citing it — the index
437
+ * {@link getSymbolDependents} answers from, memoized the same way.
438
+ */
439
+ protected _getSymbolIndex(): ReadonlyMap<string, readonly IRange.Coords[]>;
440
+ /**
441
+ * `changedIds` widened to everything a change to them reaches through the SYMBOL graph: each id
442
+ * plus, for the names among them, every name transitively referencing it.
443
+ *
444
+ * @remarks
445
+ * The one expansion both {@link recompileReferencing} and {@link markDirtyReferencing} apply
446
+ * before their all3D scan, so a formula naming an intermediate name is matched by the same pass
447
+ * that matches one naming the changed name directly. Ids that are not names (a table's) expand
448
+ * to themselves.
449
+ */
450
+ protected _namedTargets(changedIds: ReadonlySet<string>): ReadonlySet<string>;
451
+ /**
452
+ * Reverse-invalidates only the formulas that reference any of `changedIds` — the stable name/table
453
+ * fake ids reported by `IndirectSymbolProvider.reconcile()` (add/heal, delete, rename).
454
+ *
455
+ * @remarks
456
+ * `bind()` assigns a stable fake id at compile time regardless of whether the symbol resolves,
457
+ * and reconcile() reports that same id — so matching a formula's `getReferencedSymbolIds()`
458
+ * catches the "heal" case (`#NAME?`/`#REF!` → valid) that a precedent-range markDirty can't,
459
+ * because an unresolved reference has no precedent range.
460
+ *
461
+ * Marking the direct referencers is not enough where the referencer is another NAME. Downstream
462
+ * of a cell, the dependency graph carries transitivity for free; downstream of a name it carries
463
+ * nothing, because a name registers no precedent range for the formulas that mention it. So the
464
+ * ids are first expanded over the symbol graph ({@link _namedTargets}), and only from the cells
465
+ * that land in are the ordinary edges left to do the rest.
466
+ *
467
+ * O(formulas) all3D scan — same cost/scale as {@link recompileReferencing}.
468
+ *
469
+ * @returns `true` if any formula was marked dirty.
470
+ */
471
+ markDirtyReferencing(changedIds: ReadonlySet<string>): boolean;
472
+ /**
473
+ * Recompiles every formula that references any of `changedIds` — a name or a table, directly or
474
+ * through a name — from its own text, so it re-derives its precedents.
475
+ *
476
+ * @remarks
477
+ * The re-wire half of {@link markDirtyReferencing}. A node stores the coords its references
478
+ * resolved to when it was wired, and `precedentSpatial` indexes those, so a symbol that now
479
+ * designates different cells (a name redefined, a table resized) leaves its readers evaluating
480
+ * against the old edges; a dirty mark does not reach them. Same `all3D` scan and the same
481
+ * {@link _namedTargets} expansion: a name whose body cites the symbol reaches its own readers.
482
+ *
483
+ * Run at a safe point only — it writes inputs.
484
+ */
485
+ recompileReferencing(changedIds: ReadonlySet<string>): void;
486
+ /**
487
+ * A table's body has changed rows: re-fit the A1 references that spanned it.
488
+ *
489
+ * @remarks
490
+ * Excel treats a reference whose ROWS are exactly a table's body - or run from its header to the
491
+ * body's end - as naming the body, whatever columns of the table it covers, and keeps it on the
492
+ * body however the body's rows change (probed, `probe-table-refit.ps1`): `SUM(B2:B5)` over body
493
+ * rows 2-5 reads `SUM(B2:B6)` after a row is appended, and `SUM(B2:B3)` after a resize gives two
494
+ * up. Relative, absolute or mixed alike, from any sheet, and in anything that holds a reference -
495
+ * a defined name, a table's held totals formula and a condition's formula are blocks too. A
496
+ * reference that only starts or only ends with the body is an ordinary one, and a change of
497
+ * COLUMNS re-fits nothing. A name's relative rows are read from its body's origin, A1, as Excel
498
+ * reads them (`probe-table-refit-relative.ps1`); a shift never moves them, so a row at the top
499
+ * leaves such a name alone.
500
+ *
501
+ * An insert or delete inside the body already leaves such a reference right, so this is asked
502
+ * only for what a shift gets wrong: rows taken or given up at the body's end, and a row inserted
503
+ * at its first row (which pushes the whole reference down).
504
+ *
505
+ * One search of the precedent index over the rows that match - an entry per (block, reference)
506
+ * that reads them - so the cost is the readers of the body, on a change of a table's rows. The
507
+ * text a cell shows catches up with the engine the way it does after any shift.
508
+ *
509
+ * A block is re-fitted cell by cell: only the cells whose reference spans the body are rewritten,
510
+ * which splits them out of the block. An array-entered block is one formula, read at its top-left,
511
+ * and is never split.
512
+ *
513
+ * **A DELIBERATE DIVERGENCE lives here** (Michael, 2026-09-22). Excel asks how the cell was
514
+ * authored, not what it reads: a fully relative reference is left where it is when the cell
515
+ * belongs to a shared-formula group, and re-fitted when it stands alone - so `SUM(B2:B5)` follows
516
+ * the body when it was typed and does not when the same three formulas were filled, and the file
517
+ * carries the difference as `<f t="shared">` (`probe-table-refit-fillhandle.ps1`,
518
+ * `probe-table-refit-roundtrip.ps1`). Here a run is a data-model fact, not an authoring one -
519
+ * cells holding the same formula are conflated whatever made them - so honoring that rule would
520
+ * make a formula follow the body or not depending on what a NEIGHBOR happens to hold, which a
521
+ * user cannot see. Every reference that spans the body is re-fitted, however it was written.
522
+ *
523
+ * @param sheet The sheet the table is on, by id or name.
524
+ * @param columns The table's columns. A reference reaching outside them is an ordinary one.
525
+ * @param match The rows a reference has to span to be one of the body's, as they read NOW.
526
+ * @param headerRow The header's row when a reference from it to `match.rowEnd` also counts.
527
+ * @param to The body's rows now.
528
+ */
529
+ refitTableRows(sheet: string, columns: {
530
+ colStart: number;
531
+ colEnd: number;
532
+ }, match: {
533
+ rowStart: number;
534
+ rowEnd: number;
535
+ }, headerRow: number | null, to: {
536
+ rowStart: number;
537
+ rowEnd: number;
538
+ }): void;
539
+ /**
540
+ * Replaces every structured reference to `tableId` on a sheet: by its address in `extent`, or by
541
+ * `#REF!` when there is none. A name's body or an external book's cached formula is left: not
542
+ * text a user wrote on a sheet.
543
+ */
544
+ rewriteTableReferences(tableId: string, extent: TableExtent | null): void;
545
+ /**
546
+ * Writes `text` over `fsv`'s cells - or over `coords`, a part of them - as the engine's own input.
547
+ * Safe point only.
548
+ */
549
+ protected _writeBlockText(fsv: FormulaSpatialValue, text: string, coords?: IRange.Coords): void;
550
+ /** Whether any cell is out of date. */
551
+ hasDirty(): boolean;
552
+ /**
553
+ * Runs one pass over the dirty set (or all of it, or a range of it), and writes what it found
554
+ * into the state.
555
+ *
556
+ * @remarks
557
+ * One recalculation per COMMIT, not per notification of one.
558
+ *
559
+ * `gridId` marks the engine's own reactive pass — `ICalcGrid.calculate()`, which is what an
560
+ * edit schedules (`Sheet.onAfterStateChange`) and what `ready()` runs per dirty grid. An
561
+ * explicit `calculate()` from the API (F9, Shift+F9, a resolved async result) has no `gridId`
562
+ * and is always honored.
563
+ *
564
+ * The reactive pass is skipped only when BOTH halves say there is nothing to do:
565
+ *
566
+ * - the current commit has already had its recalculation. Commits notify their listeners on
567
+ * `setTimeout(0)`, so a script that writes N cells without awaiting queues N dispatchers,
568
+ * none of which run until it yields. By then the store is at the LAST commit and every one
569
+ * of those dispatchers asks for a pass over the same final state — N-1 of them describing
570
+ * work another pass has already done.
571
+ * - nothing is dirty. The dirty set is cumulative and whichever pass runs first consumes all
572
+ * of it, but a seed (`CalcGridBackend._seedNow`) marks dirty without producing a commit of its
573
+ * own, so the commit id alone would strand it.
574
+ *
575
+ * Neither half alone is enough, and the second is emphatically not sufficient: an edit that
576
+ * marks nothing dirty is still a recalculation in Excel, and it is the only thing that re-rolls
577
+ * `RAND`/`NOW` — see the "unrelated edit" case in `graph/volatile.test.ts`.
578
+ *
579
+ * Together they were the whole cost of the round-trip workbook build (`functions-to-xlsx.ts`):
580
+ * 2,594 redundant passes, each re-evaluating every volatile in the workbook and everything
581
+ * downstream of it, for 49,289 of 52,917 total evaluations — 93% of the engine's work, still
582
+ * running six seconds after `ready()` had resolved. See DESIGN-CALC-PASS-GATING.md.
583
+ */
584
+ runPass(options: ICalculation.CalculateOptions | undefined, pass: CalcBackend.PassOptions): void;
585
+ /** Each grid with cells out of date runs its pass - every grid, when `full`. */
586
+ calculateGrids(full: boolean): Promise<void>;
587
+ /** The cells of every cycle the last pass found. */
588
+ getCycleCells(): ReturnType<CalcExecutor['getCycleCells']>;
589
+ /** Demand and plan counters and timings since construction or the last {@link resetStats}. */
590
+ getDemandStats(): ReturnType<CalcExecutor['getDemandStats']>;
591
+ /** Zeroes every counter and timing. */
592
+ resetStats(): void;
593
+ /** The executor's plan-cache mode - see `CalcExecutor.planCacheMode`. */
594
+ getPlanCacheMode(): 'off' | 'assert' | 'on';
595
+ /** Sets the executor's plan-cache mode. */
596
+ setPlanCacheMode(mode: 'off' | 'assert' | 'on'): void;
597
+ /** The sheet replica: grid id to name, in tab order. */
598
+ getSheets(): ReadonlyMap<string, string | null>;
599
+ /** The table replica: table id to its name and columns. */
600
+ getTables(): ReadonlyMap<string, TableSymbols>;
601
+ /** The name replica: name id to its spelling and scope sheet. */
602
+ getNames(): ReadonlyMap<string, NameSymbols>;
603
+ /** Replaces the three replicas at once: what a start or a rebuild seeds them with. */
604
+ setReplica(replica: CalcBackend.Replica): void;
605
+ /**
606
+ * Replaces the sheet replica with the list a `sheets` message carries.
607
+ *
608
+ * @remarks
609
+ * A sheet that survived with a different name or at a different position changes what the
610
+ * functions reading names and positions answer (`INDIRECT`, `FORMULATEXT`, `CELL`, `SHEET`, a
611
+ * 3-D span's members), and none of that is a precedent: a full pass follows, which is what the
612
+ * model asked for on a rename or a move before the engine was told of either. A sheet
613
+ * appended moves nothing; one inserted or deleted ahead of a survivor moves it, and counts.
614
+ */
615
+ applySheets(sheets: readonly (readonly [id: string, name: string | null, gridless?: boolean])[]): void;
616
+ /** Enters each sheet the replica does not hold yet at its end, under the name given. */
617
+ enterSheets(sheets: readonly (readonly [id: string, name: string | null, gridless?: boolean])[]): void;
618
+ /** Enters each table the replica does not hold yet, as given; as {@link enterSheets} does. */
619
+ enterTables(tables: ReadonlyMap<string, TableSymbols>): void;
620
+ /**
621
+ * Applies what a `tables` message carries to the table replica. A reference bound by a name the
622
+ * replica did not have yet heals to it now, as one to a table added does.
623
+ */
624
+ applyTables(changes: readonly (readonly [id: string, table: TableSymbols | null])[]): void;
625
+ /** Applies what a `names` message carries to the name replica, as {@link applyTables} does. */
626
+ applyNames(changes: readonly (readonly [id: string, name: NameSymbols | null])[]): void;
627
+ /** The table replica and its name index. */
628
+ getReplicaTables(): {
629
+ of: ReadonlyMap<string, TableSymbols>;
630
+ idByName: Map<string, string>;
631
+ } | null;
632
+ /** The name replica and its spelling index, as {@link getReplicaTables}. */
633
+ getReplicaNames(): {
634
+ of: ReadonlyMap<string, NameSymbols>;
635
+ idsByName: Map<string, string[]>;
636
+ } | null;
637
+ /**
638
+ * The name a spelling resolves to from `scope`, by the replica: that sheet's own name first, then
639
+ * the global; asked from no sheet, the global, else any scoped one - the collection's rule
640
+ * (`NamedFormulaCollection.getByName`). `undefined` when the replica cannot answer.
641
+ */
642
+ getReplicaNameId(name: string, scope: string | null | undefined): string | undefined;
643
+ /** A sheet's grid id by its name, as Excel reads sheet names: case-insensitively. `null` when none. */
644
+ getSheetIdByName(name: string): string | null;
645
+ /** {@inheritDoc IContextContainer.isGridless} */
646
+ isGridless(sheetId: string): boolean;
647
+ /** A sheet's name by its grid id, or `null` for a grid that is no sheet. */
648
+ getSheetName(gridId: string): string | null;
649
+ private _sheetsCache;
650
+ /** When the engine's current commit was made: the clock a pass reads `NOW` from. */
651
+ getCommitTimestamp(): number;
652
+ /** The engine's current commit: where a held request the start batch applies lands. */
653
+ getCurrentCommitId(): string;
654
+ /**
655
+ * Records the model commit that just landed: its mirror, a commit of the engine's own that names
656
+ * it in the engine's record.
657
+ *
658
+ * @remarks
659
+ * A commit even when nothing landed under the model's: an engine write made after the close,
660
+ * outside any model operation (a deferred recompile), amends the engine's tip, and that tip has
661
+ * to be this model commit's, not the one before it, or a restore to the one before carries the
662
+ * write. The engine's record changes with every mirror, so the commit is never elided.
663
+ */
664
+ mirror(commitId: string): void;
665
+ /** What the engine answers for from here - the model's snapshot - without restoring anything. */
666
+ retarget(commitId: string): void;
667
+ /** Whether the engine can restore to a model commit: it has a landing for it and still holds that commit. */
668
+ holdsModelCommit(commitId: string): boolean;
669
+ /** Forgets a landing, and the engine commit it made if it made one. */
670
+ dropLanding(landingId: string): void;
671
+ /**
672
+ * The engine's history starts at the boot: the commits mirrored before it hold none of the
673
+ * grids the boot made, so a restore to one is not followed but rebuilt. The model's commit now
674
+ * is the boot's.
675
+ */
676
+ forgetEarlierLandings(): void;
677
+ /**
678
+ * A model root closed without landing (an amend, or nothing written): the engine commits made
679
+ * under its id (`<id>:0`, `<id>:n`) fold into the mirror of the model's current commit.
680
+ */
681
+ foldPhantom(rootId: string): void;
682
+ /**
683
+ * Restore the engine's history to the model's `commitId`, once; answers what changed per grid.
684
+ *
685
+ * @remarks
686
+ * The changed regions are the union of what every engine commit between the two snapshots
687
+ * recorded as touched (`IntentTouched`), whichever direction the restore goes; they are marked
688
+ * dirty so the pass that follows recomputes them, and handed back so each grid can re-vend the
689
+ * blocks over them. An id the engine no longer holds is answered with `null`: the engine's
690
+ * history is shorter than the model's there, and a seed is what brings it back (step 3).
691
+ */
692
+ restoreTo(commitId: string): Map<string, IRange.Coords[]> | null;
693
+ /**
694
+ * A nested savepoint of the model rolled back: what the engine landed under it goes with it.
695
+ * What a `rollback` message does.
696
+ *
697
+ * @remarks
698
+ * The savepoint is still open while it rolls back, so every engine commit made after its own,
699
+ * under the same root, was landed by a savepoint nested in it, and goes too.
700
+ */
701
+ rollbackSavepoint(savepointId: string): void;
702
+ /** Whether the engine still holds a commit: its own record is in every commit made since it was built. */
703
+ protected _holdsEngineCommit(engineId: string): boolean;
704
+ /** Drops the landings whose engine commit the store has trimmed or pruned. Rare: sized by the store's cap. */
705
+ protected _sweepLandings(): void;
706
+ /**
707
+ * The engine commit an engine write made during a model operation lands in: the operation's
708
+ * root (`<id>:0`) or the nested savepoint open now. `null` outside an operation, or while a
709
+ * landing is already open (the write joins it).
710
+ */
711
+ protected _modelLanding(): string | null;
712
+ /**
713
+ * Engine state is never a step of history on its own: a write is attributed to the model
714
+ * operation it is made in, or folded into the current snapshot (a pass's bookkeeping).
715
+ */
716
+ protected _updateState(updateState?: Partial<CalcBackend.State>, options?: ITransaction.StoreOperationOptions, events?: (keyof IModel.Events)[]): this;
717
+ protected _amendState(updateState?: Partial<CalcBackend.State>, options?: ITransaction.StoreOperationOptions, events?: (keyof IModel.Events)[]): this;
718
+ /**
719
+ * A restore moves every grid to another snapshot and reports nothing, so each grid adopts the
720
+ * maps the snapshot holds for it, and the calculation is told.
721
+ */
722
+ protected _processRestoreOrRevert(state: CalcBackend.State, commit: ITransaction.ICommit): void;
723
+ get [Symbol.toStringTag](): string;
724
+ toString(): string;
725
+ }
726
+ export declare namespace CalcBackend {
727
+ /**
728
+ * What the backend asks of the calculation that made it: the in-process half of the backend's
729
+ * interface. Everything else it reads it was given at construction, as data.
730
+ */
731
+ interface Callbacks {
732
+ /** The compiler for stored text, or the editing one for `target`; `null` before a start has loaded one. */
733
+ getCompiler(target?: ICalculation.FormulaTarget): IFormulaCompiler | null;
734
+ /** The landing of the model operation open now - its root `<id>:0` or its nested savepoint - or `null` outside one. */
735
+ getModelLanding(): string | null;
736
+ /** Sends a grid's request through the calculation's channel. */
737
+ sendRequest(gridId: string, landingId: string | undefined, request: CalcRequest): Promise<ICalcGrid.Results>;
738
+ /** What images a grid's records for the model. */
739
+ getImager(gridId: string): FormulaImager;
740
+ /** A pass's or a seed's results for a model grid: pushed to the grid under the same id. */
741
+ onCalculated(gridId: string, results: ICalcGrid.Results): void;
742
+ /** The engine's store was restored: what the calculation's own listeners and its hosts are told. */
743
+ onRestored(): void;
744
+ /** Something was marked out of date: the calculation state may have changed. */
745
+ onDirty(): void;
746
+ /** The count of async calls pending may have changed. */
747
+ onPendingChange(): void;
748
+ /** A replica of tables or names changed: what its symbols resolve to now is reconciled. */
749
+ onSymbolsChanged(kind: 'tables' | 'names'): void;
750
+ /** Runs an action at the calculation's next safe point; a `priority` one ahead of the rest. */
751
+ whenSafe(action: () => Promise<unknown>, priority: boolean): void;
752
+ /** Whether the calculation is loading: draining, or starting. */
753
+ isLoading(): boolean;
754
+ /**
755
+ * Runs a pass: explicit without `gridId`, reactive for it with one; a settle pass with
756
+ * `settle`, seeded from what the settle marked only (DESIGN-ASYNC §4.5).
757
+ */
758
+ calculate(options?: ICalculation.CalculateOptions, gridId?: string, settle?: boolean): Promise<ICalculation.Status>;
759
+ /** Owes a reactive pass for `gridId`, run once the current flush is over. */
760
+ owePass(gridId: string): void;
761
+ /** Whether a grid id is a defined name's: its virtual grid's id is the name's. */
762
+ isDefinedName(gridId: string): boolean;
763
+ /** A defined name as a node of the dependency graph, or `null` when there is no such name. */
764
+ getNameNodeInfo(nameId: string): NamedNodeInfo | null;
765
+ /** A table by its stable id, as it is now, or `null` when it is gone: what a structured reference resolves against. */
766
+ getTable(tableId: string): TableExtent | null;
767
+ /**
768
+ * Writes `text` over `coords` of a formula host's body, where the model holds it.
769
+ * @returns `false` when no host holds the grid.
770
+ */
771
+ rewriteHost(gridId: string, coords: IRange.Coords, text: string): boolean;
772
+ /** A virtual grid for an external book's cached name, as a host. */
773
+ createHost(id: string): FormulaHost;
774
+ /** The id the named-formula symbols give a name defined in `scopeId`. */
775
+ bindNameId(name: string, scopeId: string): string;
776
+ }
777
+ /** A request the channel held while the engine came up: see {@link CalcBackend.applyHeld}. */
778
+ interface Held {
779
+ gridId: string;
780
+ request: CalcRequest;
781
+ /** The model snapshot it was made at. */
782
+ commitId: string | undefined;
783
+ /** The model has undone the snapshot it was made at since. */
784
+ dead: boolean;
785
+ }
786
+ /** What one held request answered: its response, or what applying it threw. */
787
+ interface Applied {
788
+ /** Its position in the batch. */
789
+ index: number;
790
+ response?: CalcResponse | PromiseLike<CalcResponse>;
791
+ error?: unknown;
792
+ failed?: boolean;
793
+ }
794
+ /** Where a formula held apart from any grid is compiled: see {@link CalcBackend.compileTemporary}. */
795
+ interface TemporaryAt {
796
+ /** The sheet it is written on, or the one a virtual formula is compiled as if on. */
797
+ gridId: string | null;
798
+ /** Held in a grid of its own rather than on `gridId`. */
799
+ virtual: boolean;
800
+ rowIndex: number;
801
+ colIndex: number;
802
+ target: ICalculation.FormulaTarget;
803
+ }
804
+ /** A formula held apart from any grid: its block, the grid it is anchored in, and its evaluation. */
805
+ interface Temporary {
806
+ block: IFormulaBlock;
807
+ calcGrid: CalcGridBackend;
808
+ /** The grid it is anchored in: its sheet, or `temporary`. */
809
+ gridId: string;
810
+ /** Evaluates `block` - this one, or a repair of it - at the formula's cell. */
811
+ evaluate(block: IFormulaBlock, evalIndex: number | undefined, alwaysReturnRange: boolean): Scalar | IRange;
812
+ /** The calls the last evaluation made or was served; none when it did not defer. */
813
+ getCalls(): readonly DeferredCall[];
814
+ }
815
+ /** The three replicas, as a start seeds them. */
816
+ interface Replica {
817
+ sheets: ReadonlyMap<string, string | null>;
818
+ /** The sheets in {@link sheets} that have no grid: chart, macro and dialog sheets. */
819
+ gridless?: ReadonlySet<string>;
820
+ tables: ReadonlyMap<string, TableSymbols>;
821
+ names: ReadonlyMap<string, NameSymbols>;
822
+ }
823
+ /** What a pass is: see {@link CalcBackend.runPass}. */
824
+ interface PassOptions {
825
+ /** A full pass; when absent, whether one is owed. */
826
+ full?: boolean;
827
+ /** The cells to calculate, when only a range is. */
828
+ calcCoords?: IRange.Coords;
829
+ /** The grid whose reactive pass this is; absent for an explicit one. */
830
+ gridId?: string;
831
+ /**
832
+ * The settle pass (DESIGN-ASYNC §4.5, §4.8): seeded from the regions the settle marked only.
833
+ * Volatiles are not collected and the dirty set is left for the pass that owes it, so a
834
+ * landing result neither re-rolls `RAND` nor runs the recalculation manual mode withholds.
835
+ */
836
+ settle?: boolean;
837
+ /**
838
+ * `ICalculation.CalculateOptions.external`: the calls the pass makes fetch past the workbook's
839
+ * cache, to the source.
840
+ */
841
+ external?: boolean;
842
+ /** Iterative calculation's limits, or `null` when it is off. */
843
+ iterate: {
844
+ maxIteration: number;
845
+ maxChange: number;
846
+ } | null;
847
+ /** The model operation open now: what the pass's results are realized under. */
848
+ openOperationId: string | null;
849
+ /**
850
+ * A reactive pass under `AutomaticExceptTables`: the what-if data tables (`TABLE` nodes) are
851
+ * skipped and stay out of date (DESIGN-DATA-TABLES §4.4). Ignored by a full pass.
852
+ */
853
+ exceptTables?: boolean;
854
+ }
855
+ interface ConstructorOptions {
856
+ callbacks: Callbacks;
857
+ /** The runtime formulas evaluate against. */
858
+ runtime: IRuntime;
859
+ /** The symbols formulas bind through. */
860
+ symbols: ISymbolRegistry;
861
+ /** What every formula block resolves structured references and names through. */
862
+ resolvers: FormulaBlockResolvers;
863
+ /** Function providers bound after the built-ins. */
864
+ functions?: readonly FunctionProvider[];
865
+ /** The owner's selected sheet, and a sheet position by a name the replica does not hold. */
866
+ getSheetIndex?: (sheetName?: string) => number;
867
+ /** The file asks for Excel's legacy implicit intersection. */
868
+ legacyIntersect?: boolean;
869
+ /** Options every grid of the backend's is made with. */
870
+ gridOptions?: Partial<CalcGridBackend.ConstructorOptions>;
871
+ /** The calculation the grids report their status and readiness through. */
872
+ calculation: ICalculation;
873
+ /** The external books the bindings mirror. */
874
+ books: IExternalBookCollection;
875
+ /** What rich values a formula makes are made for; omitted, made outside any workbook. */
876
+ richData?: IRichDataKind.Context;
877
+ /** What async functions fetch through (`IBatchContext.fetch`); omitted, the global `fetch`. */
878
+ fetch?: (input: string, init?: RequestInit) => Promise<Response>;
879
+ /** The replicas as the owner holds them when the start was asked for. */
880
+ replica?: Replica;
881
+ /** The model's current commit, mirrored first. */
882
+ modelCommitId?: string | null;
883
+ /** A plan-cache mode set before the backend existed. */
884
+ planCacheMode?: 'off' | 'assert' | 'on' | null;
885
+ }
886
+ interface State extends AbstractModel.State {
887
+ /** The model commit this engine commit mirrors; written by every mirror so the commit lands. */
888
+ mirrorOf?: string;
889
+ /**
890
+ * Top down evaluation and marking dirty.
891
+ * This is the only spatial map that is completely updated via api.
892
+ *
893
+ * @remarks
894
+ * For top down evaluation and marking formulas dirty.
895
+ */
896
+ formulaSpatial: ISpatialMap3D<FormulaSpatialValue>;
897
+ /**
898
+ * Tracks the inputs to formulas.
899
+ *
900
+ * @remarks
901
+ * * For bottom up marking dirty.
902
+ * * Contains a back-pointer to the formula.
903
+ *
904
+ */
905
+ precedentSpatial: ISpatialMap3D<PrecedentSpatialValue>;
906
+ /**
907
+ * Tracks dynamic precedents by block.
908
+ * Used to remove old dynamic precedents when a block is re-evaluated and to add new ones after evaluation.
909
+ */
910
+ dynamicByBlock: Map<FormulaSpatialValue, ISpatialMap.Entry<PrecedentSpatialValue>[]>;
911
+ /**
912
+ * Dirty regions
913
+ */
914
+ dirtySpatial: ISpatialMap3D;
915
+ /**
916
+ * If true, the next calculation will be a full calc regardless of dirty state. Used for example when the engine detects a circular dependency and needs to fallback to iterative calculation or when the user explicitly requests a full calc.
917
+ */
918
+ isFullCalcRequired: boolean;
919
+ /**
920
+ * All registered grids.
921
+ */
922
+ gridsAll: Map<string, CalcGridBackend>;
923
+ /**
924
+ * The engine's replica of the model's sheet list (DESIGN-CALC-SERVICE §8): grid id to name, in
925
+ * tab order. What every symbol lookup, span and sheet-position function reads. Fed by the
926
+ * `sheets` message and by grid registration; versioned here so a revert restores it with the
927
+ * formulas that bound through it.
928
+ */
929
+ sheets: ReadonlyMap<string, string | null>;
930
+ /**
931
+ * The sheets in {@link sheets} that have no grid: chart, macro and dialog sheets. They count in
932
+ * tab order (`SHEETS`, `SHEET`, a span's members) and hold no cells.
933
+ */
934
+ gridless: ReadonlySet<string>;
935
+ /**
936
+ * The engine's replica of the model's tables (DESIGN-CALC-SERVICE §8): table id to its name and
937
+ * its columns' ids and names. What a structured reference binds and images through. Fed by the
938
+ * `tables` message, seeded at a start, versioned here as {@link sheets} is.
939
+ */
940
+ tables: ReadonlyMap<string, TableSymbols>;
941
+ /**
942
+ * The engine's replica of the defined names: name id to its spelling and the sheet it is scoped
943
+ * to. What a name binds and images through. Fed by the `names` message, as {@link tables} is.
944
+ */
945
+ names: ReadonlyMap<string, NameSymbols>;
946
+ /**
947
+ * Each grid's per-grid maps as of this snapshot (`CalcGridMaps`): values, contentful, spills,
948
+ * errors, pending, circular. Copy-on-write per request; handed back to the grid on a restore.
949
+ */
950
+ gridMaps: Map<string, object>;
951
+ }
952
+ }
953
+ //# sourceMappingURL=CalcBackend.d.ts.map