@sheetxl/sdk 0.8.0-beta.11 → 0.8.0-beta.13

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 (349) hide show
  1. package/THIRD-PARTY-NOTICES.md +172 -0
  2. package/browser/esm/{BMyDRQ716j79h_bH.mjs → -GEhXGMfNcWmHPby.mjs} +6 -6
  3. package/browser/esm/{B7aUIvgUjncMMD_i.mjs → 9WXf_BTKjW1cQisZ.mjs} +95 -94
  4. package/browser/esm/{PcHFjNzQsE54POri.mjs → B2SgIPPBX0wjzuq8.mjs} +1 -1
  5. package/browser/esm/{DEiPS3Dr-s4fPbVZ.mjs → BC2RwlNwCdRywkoD.mjs} +1 -1
  6. package/browser/esm/{BpgskG1Er_lGQ_yS.mjs → BEqhm9xAUPiHUCFv.mjs} +1 -1
  7. package/browser/esm/BHgqi7KNrl7Vjr0W.mjs +348 -0
  8. package/browser/esm/{BkBhLS0l6z8sxI6D.mjs → BJKH0tDRx2FeSWvt.mjs} +2 -2
  9. package/browser/esm/{CU3DmJ-YnVVrC1_k.mjs → BTgWtqdQoh2cB6DL.mjs} +1 -1
  10. package/browser/esm/{Dyq_ivuHvlXLwPCl.mjs → BVshV1iY3bcUH9_E.mjs} +1135 -1129
  11. package/browser/esm/{BFagR2JeWs74iAG3.mjs → BYQ63XU7JzB4_itX.mjs} +1 -1
  12. package/browser/esm/{DvAaxH6z_tGvrRzl.mjs → Bax5aOzQkbHKXW_X.mjs} +239 -230
  13. package/browser/esm/{DLLE0FZNsKxbBzRn.mjs → BiDGKhtzV6yIy66o.mjs} +45 -45
  14. package/browser/esm/BmYrWK5OmHRtgyqM.mjs +367 -0
  15. package/browser/esm/{ClPfI4lODvCece29.mjs → BoAlHgjPQ6mxb_oO.mjs} +74 -74
  16. package/browser/esm/{BoV6zPBnfqCBCqZ7.mjs → C0mjTq8lhrX3HiPa.mjs} +4328 -3166
  17. package/browser/esm/{nvU0ClAbf0g94YBK.mjs → C5j0IdwtYkWlOftv.mjs} +604 -596
  18. package/browser/esm/{DWNzqw7DUKwoxjri.mjs → CL84-iL2QeKlLzo5.mjs} +2 -2
  19. package/browser/esm/{Ctjb0SsxV4K4MMqG.mjs → CLkBe-6n-pStQhnz.mjs} +2 -2
  20. package/{node/esm/CZICGK_ss0HoGHCP.mjs → browser/esm/CPzfhTPX2Y4dHX2p.mjs} +2 -2
  21. package/browser/esm/{Dlmig06rIo7cInRk.mjs → CSJuIjYUOE387FIP.mjs} +1 -1
  22. package/browser/esm/{BjkCiv5Jz6WYKZeu.mjs → Cdw0mGuoV3IU2LhR.mjs} +2 -2
  23. package/browser/esm/Ced5uyofOWHuL_Jy.mjs +114 -0
  24. package/browser/esm/{CkxWugaJFjDGZNZ-.mjs → Ci_LJ4S_GvYX0STI.mjs} +1 -1
  25. package/browser/esm/{zlLuW405RSguy4Kn.mjs → CwygVKP_RXmne5Ot.mjs} +47 -47
  26. package/browser/esm/{C4MqfLn9Dm-l3OIk.mjs → D-mfK0noQrM2jZLT.mjs} +1 -1
  27. package/browser/esm/{BnG31I6Oj_HEtSPS.mjs → D9SH_8v3FYCnxOFK.mjs} +1 -1
  28. package/browser/esm/{BVDiOXGMc5_FMGfy.mjs → DPD8fop6az9HZNiK.mjs} +2 -2
  29. package/browser/esm/DW-MmlgMH87l-_cw.mjs +302 -0
  30. package/browser/esm/{CaB7J-xgfKO2uAkG.mjs → DctIlUsO78-OU2ht.mjs} +2 -2
  31. package/browser/esm/DdcKkVb4jM6Y_epY.mjs +184 -0
  32. package/browser/esm/{CHU6iu_WGlm7fLET.mjs → DfKzE0IY0TjaEIxG.mjs} +1 -1
  33. package/browser/esm/{C2VbEI_XVAoseAwa.mjs → DkloMquaR1pbZCER.mjs} +44 -43
  34. package/browser/esm/{C16ycKja6zG0crV_.mjs → Dz86-De57bv2VYIi.mjs} +19447 -16481
  35. package/browser/esm/{BtvLTTfSBdAKplVG.mjs → HApSgmV2FXRRwQac.mjs} +1 -1
  36. package/browser/esm/{CQYjO777cmAznUzK.mjs → IbVAQU4YqtFqLwYk.mjs} +1 -1
  37. package/browser/esm/index.mjs +823 -644
  38. package/browser/esm/mHQ95RAfxHzcUN2r.mjs +18 -0
  39. package/browser/esm/pm00uZZu_H3gxHFx.mjs +117 -0
  40. package/browser/esm/{CV5EGEjG5_-CPpP0.mjs → quEvwgrEuOb0h3q-.mjs} +1926 -1298
  41. package/browser/esm/{ClbvFbFzFzXLBKNN.mjs → zZngLMg6mg6nnNGX.mjs} +66 -66
  42. package/licenses/dependencies.txt +71 -1
  43. package/node/esm/{BqiexuA89caYnAPz.mjs → -K4Cek-bTUItkB_8.mjs} +1 -1
  44. package/node/esm/-b8yNV4v9qiq8EMY.mjs +117 -0
  45. package/node/esm/{D8zEN-6ZdDqDvTxM.mjs → 1V-m67YHbxmg3xk2.mjs} +74 -74
  46. package/node/esm/{D_t5AUxSm7_icjzq.mjs → 4ROAfJC1mokmqubv.mjs} +1 -1
  47. package/node/esm/B89et7t3uRmtxk4v.mjs +115 -0
  48. package/node/esm/BKBkCBNGhMU0nQdY.mjs +372 -0
  49. package/node/esm/{OVfaSb506tNSIvbv.mjs → BQ2XqExomMceAjfe.mjs} +20822 -18373
  50. package/node/esm/{2Kihw_-5lVTEnwMa.mjs → Bfg7qjCXCwXbzW3K.mjs} +1 -1
  51. package/node/esm/{D1TKBVmoKGAXf37B.mjs → BtMeAB_dqJnOfzJM.mjs} +2 -2
  52. package/node/esm/{D6e2z7eZpxOJXHc7.mjs → Byc_bxU_MdjYtt0x.mjs} +1 -1
  53. package/node/esm/{CNCNJNg890KdgkWh.mjs → Bzrl292TNCK3Cpid.mjs} +1 -1
  54. package/node/esm/{De2IONBxQhz-Qbyh.mjs → C0P9zspoypRAj7yv.mjs} +1 -1
  55. package/node/esm/{CzXT00vrQa1_gvW9.mjs → C9gpMN3galHGZyoK.mjs} +1 -1
  56. package/node/esm/CKCG2peOkTq0gIIW.mjs +310 -0
  57. package/node/esm/{DUTskXCXref-IJnI.mjs → CWBS90g3Hz-kQDkY.mjs} +46 -46
  58. package/node/esm/{BIwObuhTJYf0jpUa.mjs → CoGSVnn-hNMtTEus.mjs} +2 -2
  59. package/node/esm/{CwePQwTILHHjGDkZ.mjs → CzrLqStvrcPE2-hb.mjs} +194 -185
  60. package/node/esm/{CCN5vD410obwdz38.mjs → D16EdlZG1hX5WUUK.mjs} +96 -95
  61. package/node/esm/{CDHdgJXH2vS71WMc.mjs → D1mDga2K5sjs8y07.mjs} +1 -1
  62. package/node/esm/{cGwrLA1RCE-WhJ7w.mjs → D2jtztjE6c23RKvZ.mjs} +1 -1
  63. package/node/esm/{Bbf1Pm9Gk7YpLTvg.mjs → D9nRcWsYk3M82iD8.mjs} +1 -1
  64. package/node/esm/{yavzZOiZW_EjG9lE.mjs → DALYzTxZ9Ur9C69Q.mjs} +1 -1
  65. package/node/esm/{DkwIPzKc3UwdUIfM.mjs → DF0nL7s01dp7n0Bx.mjs} +10 -10
  66. package/node/esm/{DNRhGK-8Tr9xcRyc.mjs → DO5ldLqhTvIfPXLW.mjs} +3348 -2610
  67. package/node/esm/DQz8J8ci7EJdqbuB.mjs +351 -0
  68. package/node/esm/{BIRq1kT7lLRzns9t.mjs → DR2OQTKqqyIkZnse.mjs} +2 -2
  69. package/node/esm/{857CIBgQgGpnqrXk.mjs → DSTLPBgpsGW6qP9e.mjs} +73 -73
  70. package/node/esm/{CGp6VZL-gZa9Uezx.mjs → DiXp7KSOZUSWXaZ5.mjs} +1 -1
  71. package/node/esm/{CZiqiay42tFTrLI4.mjs → DwvXHsycOQR219c7.mjs} +1 -1
  72. package/node/esm/{B21JjOLghRoDOrkx.mjs → Hc6B04OyVzHx2F5I.mjs} +38 -37
  73. package/node/esm/{Ct3h15sCus4Tgt6M.mjs → NkPNHsq2T3DXg76x.mjs} +561 -553
  74. package/node/esm/{B084DssTcdBheTp_.mjs → Nl_IIkO1jbk0s9i-.mjs} +4552 -3373
  75. package/node/esm/{D2KBymQJd1XhpeQD.mjs → OQT5lGqq8a4r5xNa.mjs} +1 -1
  76. package/node/esm/OTaaFGhF-k_iwobp.mjs +18 -0
  77. package/node/esm/{CdJHUJSBRHZoryPe.mjs → Z1elC_roIu7LhceZ.mjs} +53 -53
  78. package/{browser/esm/D5np__Jb1euAyaLw.mjs → node/esm/e3F3OVXCxLJrSukW.mjs} +2 -2
  79. package/node/esm/index.mjs +806 -625
  80. package/node/esm/{mFiBSM7XgBHV9AY7.mjs → suOBVUz-pca6ilJH.mjs} +1607 -1601
  81. package/package.json +8 -6
  82. package/resources/contents.json +108 -0
  83. package/resources/fonts/aptos-bold-italic.hinted.json +125 -0
  84. package/resources/fonts/aptos-bold-italic.metrics.json +221 -0
  85. package/resources/fonts/aptos-bold-italic.rows.json +8 -0
  86. package/resources/fonts/aptos-bold.hinted.json +125 -0
  87. package/resources/fonts/aptos-bold.metrics.json +221 -0
  88. package/resources/fonts/aptos-bold.rows.json +8 -0
  89. package/resources/fonts/aptos-display-bold-italic.hinted.json +125 -0
  90. package/resources/fonts/aptos-display-bold-italic.metrics.json +221 -0
  91. package/resources/fonts/aptos-display-bold-italic.rows.json +8 -0
  92. package/resources/fonts/aptos-display-bold.hinted.json +125 -0
  93. package/resources/fonts/aptos-display-bold.metrics.json +221 -0
  94. package/resources/fonts/aptos-display-bold.rows.json +8 -0
  95. package/resources/fonts/aptos-display-italic.hinted.json +124 -0
  96. package/resources/fonts/aptos-display-italic.metrics.json +221 -0
  97. package/resources/fonts/aptos-display-italic.rows.json +8 -0
  98. package/resources/fonts/aptos-display-regular.hinted.json +125 -0
  99. package/resources/fonts/aptos-display-regular.metrics.json +221 -0
  100. package/resources/fonts/aptos-display-regular.rows.json +8 -0
  101. package/resources/fonts/aptos-italic.hinted.json +125 -0
  102. package/resources/fonts/aptos-italic.metrics.json +221 -0
  103. package/resources/fonts/aptos-italic.rows.json +8 -0
  104. package/resources/fonts/aptos-narrow-bold-italic.hinted.json +125 -0
  105. package/resources/fonts/aptos-narrow-bold-italic.metrics.json +221 -0
  106. package/resources/fonts/aptos-narrow-bold-italic.rows.json +8 -0
  107. package/resources/fonts/aptos-narrow-bold.hinted.json +125 -0
  108. package/resources/fonts/aptos-narrow-bold.metrics.json +221 -0
  109. package/resources/fonts/aptos-narrow-bold.rows.json +8 -0
  110. package/resources/fonts/aptos-narrow-italic.hinted.json +125 -0
  111. package/resources/fonts/aptos-narrow-italic.metrics.json +221 -0
  112. package/resources/fonts/aptos-narrow-italic.rows.json +8 -0
  113. package/resources/fonts/aptos-narrow-regular.hinted.json +125 -0
  114. package/resources/fonts/aptos-narrow-regular.metrics.json +221 -0
  115. package/resources/fonts/aptos-narrow-regular.rows.json +8 -0
  116. package/resources/fonts/aptos-regular.hinted.json +125 -0
  117. package/resources/fonts/aptos-regular.metrics.json +221 -0
  118. package/resources/fonts/aptos-regular.rows.json +8 -0
  119. package/resources/fonts/arial-bold-italic.rows.json +0 -1
  120. package/resources/fonts/arial-bold.rows.json +0 -1
  121. package/resources/fonts/arial-italic.rows.json +0 -1
  122. package/resources/fonts/arial-regular.rows.json +0 -1
  123. package/resources/fonts/calibri-bold-italic.rows.json +0 -1
  124. package/resources/fonts/calibri-bold.rows.json +0 -1
  125. package/resources/fonts/calibri-italic.rows.json +0 -1
  126. package/resources/fonts/calibri-regular.rows.json +0 -1
  127. package/resources/fonts/cambria-bold-italic.rows.json +0 -1
  128. package/resources/fonts/cambria-bold.rows.json +0 -1
  129. package/resources/fonts/cambria-italic.rows.json +0 -1
  130. package/resources/fonts/cambria-regular.rows.json +0 -1
  131. package/resources/fonts/contents.json +240 -0
  132. package/resources/fonts/courier-new-bold-italic.rows.json +0 -1
  133. package/resources/fonts/courier-new-bold.rows.json +0 -1
  134. package/resources/fonts/courier-new-italic.rows.json +0 -1
  135. package/resources/fonts/courier-new-regular.rows.json +0 -1
  136. package/resources/fonts/times-new-roman-bold-italic.rows.json +0 -1
  137. package/resources/fonts/times-new-roman-bold.rows.json +0 -1
  138. package/resources/fonts/times-new-roman-italic.rows.json +0 -1
  139. package/resources/fonts/times-new-roman-regular.rows.json +0 -1
  140. package/resources/locales/de/model.msg.json +12 -2
  141. package/resources/locales/en/model.msg.json +13 -2
  142. package/types/scripting-api.json +10638 -10446
  143. package/types/scripting-enums.json +20 -1
  144. package/types/scripting.d.ts +1536 -477
  145. package/types/src/.generated/wasm/sdk.d.ts +5 -27
  146. package/types/src/address/AddressUtils.d.ts +8 -0
  147. package/types/src/address/_SheetNameQuoteChars.d.ts +3 -0
  148. package/types/src/{sheet → anomalies}/_Anomalies.d.ts +3 -3
  149. package/types/src/anomalies/_FocusTable.d.ts +5 -0
  150. package/types/src/{sheet/_AnomalyFormulaChecks.d.ts → anomalies/_FormulaChecks.d.ts} +10 -2
  151. package/types/src/{sheet/_AnomalyLabelChecks.d.ts → anomalies/_LabelChecks.d.ts} +1 -1
  152. package/types/src/anomalies/_LiteralChecks.d.ts +35 -0
  153. package/types/src/anomalies/_SeriesChecks.d.ts +13 -0
  154. package/types/src/calculation/Calculation.d.ts +61 -98
  155. package/types/src/calculation/ExternalBookBindings.d.ts +2 -29
  156. package/types/src/calculation/ICalculation.d.ts +96 -9
  157. package/types/src/calculation/NamedFormulaCollection.d.ts +110 -10
  158. package/types/src/calculation/TokenType.d.ts +0 -10
  159. package/types/src/calculation/_CloneBoundary.d.ts +0 -24
  160. package/types/src/calculation/_FormulaToolkit.d.ts +0 -5
  161. package/types/src/calculation/compiler/ASTTypes.d.ts +6 -15
  162. package/types/src/calculation/compiler/CompilerUtils.d.ts +0 -227
  163. package/types/src/calculation/compiler/FormulaLexer.d.ts +0 -8
  164. package/types/src/calculation/compiler/FormulaParser.d.ts +0 -61
  165. package/types/src/calculation/compiler/ParserUtils.d.ts +0 -24
  166. package/types/src/calculation/compiler/Types.d.ts +1 -45
  167. package/types/src/calculation/engine/CalcBackend.d.ts +83 -127
  168. package/types/src/calculation/engine/index.d.ts +0 -8
  169. package/types/src/calculation/executor/CalcExecutor.d.ts +50 -116
  170. package/types/src/calculation/executor/CalcExecutorUtils.d.ts +47 -12
  171. package/types/src/calculation/executor/CircularReference.d.ts +0 -17
  172. package/types/src/calculation/executor/_BlockOrder.d.ts +29 -0
  173. package/types/src/calculation/executor/_WhatIf.d.ts +31 -0
  174. package/types/src/calculation/formula/FormulaBlock.d.ts +4 -31
  175. package/types/src/calculation/formula/FormulaRecordView.d.ts +0 -15
  176. package/types/src/calculation/formula/IFormulaBlock.d.ts +5 -12
  177. package/types/src/calculation/formula/LambdaValue.d.ts +0 -15
  178. package/types/src/calculation/formula/TokenUtils.d.ts +1 -8
  179. package/types/src/calculation/functions/_DataTableFunction.d.ts +14 -0
  180. package/types/src/calculation/grid/CalcGrid.d.ts +8 -64
  181. package/types/src/calculation/grid/CalcGridBackend.d.ts +12 -35
  182. package/types/src/calculation/grid/CalcGridProxy.d.ts +0 -15
  183. package/types/src/calculation/grid/CalcGridUtils.d.ts +21 -23
  184. package/types/src/calculation/grid/ICalcGrid.d.ts +28 -109
  185. package/types/src/calculation/grid/_CalcRequest.d.ts +17 -33
  186. package/types/src/calculation/spatial/CircularEntry.d.ts +0 -10
  187. package/types/src/calculation/spatial/FormulaSpatialValue.d.ts +54 -82
  188. package/types/src/calculation/spatial/SpillEntry.d.ts +20 -3
  189. package/types/src/calculation/state/CalcNode.d.ts +0 -1
  190. package/types/src/calculation/state/CalcScope.d.ts +29 -9
  191. package/types/src/calculation/state/CalcState.d.ts +19 -9
  192. package/types/src/calculation/state/CalculationContext.d.ts +32 -38
  193. package/types/src/calculation/state/DeferredCalls.d.ts +207 -0
  194. package/types/src/calculation/state/IContextContainer.d.ts +19 -55
  195. package/types/src/calculation/state/_KeepBlanks.d.ts +5 -0
  196. package/types/src/calculation/state/_PendingOverlayGrid.d.ts +52 -33
  197. package/types/src/calculation/state/_WhatIfLayer.d.ts +77 -0
  198. package/types/src/calculation/symbol/ExternalSheetSymbols.d.ts +0 -42
  199. package/types/src/calculation/symbol/ISymbolRegistry.d.ts +0 -6
  200. package/types/src/calculation/symbol/SheetSymbolProvider.d.ts +0 -12
  201. package/types/src/calculation/symbol/SymbolRegistry.d.ts +0 -9
  202. package/types/src/calculation/toolkit/index.d.ts +0 -8
  203. package/types/src/cell/ICell.d.ts +59 -54
  204. package/types/src/cellControl/CellControl.d.ts +67 -0
  205. package/types/src/cellControl/CellControlCollection.d.ts +29 -0
  206. package/types/src/cellControl/CellControlRegistry.d.ts +47 -0
  207. package/types/src/cellControl/ICellControl.d.ts +99 -0
  208. package/types/src/cellControl/ICellControlCollection.d.ts +67 -0
  209. package/types/src/cellControl/index.d.ts +4 -0
  210. package/types/src/cellRange/ICellRange.d.ts +226 -67
  211. package/types/src/cellRange/ICellRanges.d.ts +4 -3
  212. package/types/src/chart/Chart.d.ts +0 -16
  213. package/types/src/chart/_ChartParts.d.ts +0 -39
  214. package/types/src/chart/_ChartSource.d.ts +0 -14
  215. package/types/src/chart/createChart.d.ts +1 -1
  216. package/types/src/chart/kinds/ChartKind.d.ts +4 -4
  217. package/types/src/chart/kinds/_Placeholder.d.ts +0 -1
  218. package/types/src/chart/layout/ChartLayout.d.ts +5 -1
  219. package/types/src/chart/layout/TextMeasurer.d.ts +0 -20
  220. package/types/src/chart/layout/_LayoutUtils.d.ts +0 -16
  221. package/types/src/chart/math/BoxStats.d.ts +0 -8
  222. package/types/src/chart/math/DateUnitCalcs.d.ts +0 -10
  223. package/types/src/chart/math/Histogram.d.ts +0 -17
  224. package/types/src/chart/math/OrdUnitCalcs.d.ts +0 -53
  225. package/types/src/chart/math/Treemap.d.ts +0 -15
  226. package/types/src/chart/math/Trendlines.d.ts +0 -8
  227. package/types/src/chart/math/UnitCalcs.d.ts +0 -22
  228. package/types/src/chart/model/_Edits.d.ts +0 -33
  229. package/types/src/chart/model/_Grouping.d.ts +0 -25
  230. package/types/src/chart/model/_Inference.d.ts +0 -18
  231. package/types/src/chart/model/_NewChart.d.ts +0 -41
  232. package/types/src/chart/model/_OfPie.d.ts +0 -7
  233. package/types/src/chart/resolve/_LegacyStyles.d.ts +0 -20
  234. package/types/src/chart/resolve/_Resolve.d.ts +3 -12
  235. package/types/src/chart/resolve/_ResolvedChart.d.ts +5 -8
  236. package/types/src/collections/ISparseGrid.d.ts +11 -2
  237. package/types/src/collections/MixedTypedArrayList.d.ts +8 -2
  238. package/types/src/collections/SparseGrid.d.ts +3 -8
  239. package/types/src/collections/_GridUtils.d.ts +0 -10
  240. package/types/src/comment/_NoteBox.d.ts +0 -15
  241. package/types/src/condition/AnchoredConditional.d.ts +3 -25
  242. package/types/src/condition/BuiltInOperators/AbstractOperator.d.ts +0 -49
  243. package/types/src/condition/BuiltinSelectors/DisplaySelector.d.ts +0 -10
  244. package/types/src/condition/ICondition.d.ts +2 -2
  245. package/types/src/condition/_ConditionUtils.d.ts +0 -38
  246. package/types/src/externalBook/ExternalBookCollection.d.ts +0 -15
  247. package/types/src/externalBook/ExternalBookName.d.ts +2 -3
  248. package/types/src/externalBook/IExternalBook.d.ts +16 -18
  249. package/types/src/fetch/Fetcher.d.ts +15 -0
  250. package/types/src/fetch/IFetcher.d.ts +48 -0
  251. package/types/src/fetch/_WorkbookFetch.d.ts +43 -0
  252. package/types/src/fetch/index.d.ts +3 -0
  253. package/types/src/fill/PaintUtils.d.ts +3 -1
  254. package/types/src/font/AdvanceTable.d.ts +16 -42
  255. package/types/src/font/IFont.d.ts +32 -9
  256. package/types/src/font/TableFileAdvanceBuilder.d.ts +6 -3
  257. package/types/src/font/_FontUtils.d.ts +0 -8
  258. package/types/src/font/_StandIns.d.ts +33 -0
  259. package/types/src/hyperlink/IHyperlink.d.ts +10 -0
  260. package/types/src/hyperlink/_Hyperlink.d.ts +4 -1
  261. package/types/src/index.d.ts +2 -1
  262. package/types/src/io/IWorkbookIO.d.ts +3 -3
  263. package/types/src/io/WorkbookOrigin.d.ts +2 -2
  264. package/types/src/license/LicenseManager.d.ts +2 -1
  265. package/types/src/license/_Utils.d.ts +4 -3
  266. package/types/src/license/details.d.ts +3 -1
  267. package/types/src/license/keys.d.ts +6 -0
  268. package/types/src/license/license-key.d.ts +15 -33
  269. package/types/src/license/token.d.ts +55 -0
  270. package/types/src/named/INamedCollection.d.ts +36 -0
  271. package/types/src/named/NamedCollection.d.ts +18 -0
  272. package/types/src/picture/IPicture.d.ts +45 -0
  273. package/types/src/picture/Picture.d.ts +12 -0
  274. package/types/src/pivot/PivotTable.d.ts +0 -7
  275. package/types/src/primitives/AsyncValue.d.ts +46 -0
  276. package/types/src/primitives/PrimitiveUtils.d.ts +1 -110
  277. package/types/src/primitives/Range.d.ts +0 -60
  278. package/types/src/primitives/ScalarCollation.d.ts +0 -106
  279. package/types/src/primitives/stats/AggregateStats.d.ts +0 -19
  280. package/types/src/print/PageLayout.d.ts +0 -6
  281. package/types/src/reference/ReferenceUtils.d.ts +4 -2
  282. package/types/src/resource/IResource.d.ts +9 -0
  283. package/types/src/resource/IResourceCollection.d.ts +4 -0
  284. package/types/src/resource/Resource.d.ts +2 -0
  285. package/types/src/resource/_AddResource.d.ts +13 -0
  286. package/types/src/richData/CellImage.d.ts +95 -0
  287. package/types/src/richData/Hyperlink.d.ts +49 -0
  288. package/types/src/richData/IRichDataCollection.d.ts +76 -0
  289. package/types/src/richData/IRichDataKind.d.ts +55 -11
  290. package/types/src/richData/RichArray.d.ts +42 -0
  291. package/types/src/richData/RichDataCollection.d.ts +23 -0
  292. package/types/src/richData/RichDataRegistry.d.ts +52 -14
  293. package/types/src/richData/RichDataValues.d.ts +20 -0
  294. package/types/src/richData/RichRecord.d.ts +68 -0
  295. package/types/src/richData/RichText.d.ts +5 -5
  296. package/types/src/richData/index.d.ts +6 -0
  297. package/types/src/scripting/FunctionArguments.d.ts +17 -1
  298. package/types/src/scripting/FunctionCollection.d.ts +8 -0
  299. package/types/src/scripting/Scripts.d.ts +10 -0
  300. package/types/src/scripting/TypedFunction.d.ts +2 -109
  301. package/types/src/sheet/ICellContainerOptions.d.ts +6 -0
  302. package/types/src/sheet/IWorksheet.d.ts +26 -22
  303. package/types/src/sheet/NamedCellRange.d.ts +0 -21
  304. package/types/src/sheet/SheetCell.d.ts +25 -3
  305. package/types/src/sheet/SheetRange.d.ts +8 -2
  306. package/types/src/sheet/SheetRanges.d.ts +2 -2
  307. package/types/src/sheet/Worksheet.d.ts +117 -104
  308. package/types/src/sheet/_DelimitedText.d.ts +13 -0
  309. package/types/src/sheet/_IgnoredErrors.d.ts +0 -12
  310. package/types/src/sheet/_ListenerAnchor.d.ts +7 -1
  311. package/types/src/sheet/_ScalarListFactory.d.ts +46 -17
  312. package/types/src/sheet/_SheetCoords.d.ts +0 -7
  313. package/types/src/sheet/_SheetFilterUtils.d.ts +0 -8
  314. package/types/src/sheet/_SheetMutations.d.ts +4 -1
  315. package/types/src/sheet/_SheetStateReader.d.ts +0 -10
  316. package/types/src/sheet/_SheetStateTypes.d.ts +23 -14
  317. package/types/src/sheet/_SheetUtils.d.ts +1 -1
  318. package/types/src/sheet/style/_RowLine.d.ts +32 -0
  319. package/types/src/sheet/style/_StyleUtils.d.ts +6 -14
  320. package/types/src/sheetView/_SheetViewUtils.d.ts +0 -1
  321. package/types/src/slicer/_BuiltInSlicerStyles.d.ts +0 -5
  322. package/types/src/style/ICellStyle.d.ts +4 -0
  323. package/types/src/table/AnchoredTable.d.ts +0 -147
  324. package/types/src/text/TextFrame.d.ts +4 -1
  325. package/types/src/text/TextStacked.d.ts +0 -24
  326. package/types/src/text/TextWrapper.d.ts +3 -5
  327. package/types/src/text/_LineBox.d.ts +24 -0
  328. package/types/src/text/_TextUtils.d.ts +5 -2
  329. package/types/src/text/_TextWrapperFallback.d.ts +2 -1
  330. package/types/src/wasm/sdkWasm.d.ts +1 -1
  331. package/types/src/workbook/IWorkbook.d.ts +40 -1
  332. package/types/src/workbook/Workbook.d.ts +25 -13
  333. package/types/src/workbook/WorkbookRanges.d.ts +1 -1
  334. package/browser/esm/BGOFfpxr2jPIdqmV.mjs +0 -40
  335. package/browser/esm/BLoUBId2xZpXAK_H.mjs +0 -698
  336. package/browser/esm/C5E6zSGAALWf61n4.mjs +0 -199
  337. package/browser/esm/S2dNNx1a5ydRnARM.mjs +0 -367
  338. package/browser/esm/f1IoRb7tEb0QmCSt.mjs +0 -110
  339. package/browser/esm/gssVX_FH1XFN-twD.mjs +0 -210
  340. package/node/esm/BrCKGFRsX_ezFJ4B.mjs +0 -811
  341. package/node/esm/DOU54VsOjG-m-NyQ.mjs +0 -210
  342. package/node/esm/Db0v7zXNnyjBIjjI.mjs +0 -372
  343. package/node/esm/Df1bL6VFvrqIdSLB.mjs +0 -40
  344. package/node/esm/DrTZbfemSLq2mseG.mjs +0 -111
  345. package/types/src/dataTable/DataTable.d.ts +0 -67
  346. package/types/src/dataTable/DataTableCollection.d.ts +0 -19
  347. package/types/src/dataTable/IDataTable.d.ts +0 -99
  348. package/types/src/dataTable/IDataTableCollection.d.ts +0 -18
  349. package/types/src/dataTable/index.d.ts +0 -6
@@ -51,11 +51,11 @@ declare global {
51
51
  * if (range.hasError()) return range.firstError();
52
52
  * ```
53
53
  *
54
- * placed before its own validation where Excel's error outranks it (`LARGE(range-with-#N/A, 0)`
54
+ * placed before its own validation where the member's error outranks it (`LARGE(range-with-#N/A, 0)`
55
55
  * is `#N/A`, not `#NUM!`). Aggregators and consumers say it; reshapers and lookups, whose members
56
56
  * pass through or are never read, need no line at all. Where a function takes several ranges the
57
57
  * lines run in ARGUMENT order — the whole of argument N before N+1, row-major within — which is
58
- * Excel's which-error-wins order, and a function that pairs its ranges (the paired
58
+ * the which-error-wins order, and a function that pairs its ranges (the paired
59
59
  * statistics) orders its own scan the way it pairs.
60
60
  *
61
61
  * > *A bare error propagates unless your function opts in to seeing it; the members of a range
@@ -862,6 +862,26 @@ declare global {
862
862
  params?: Record<string, string | number>;
863
863
  }
864
864
 
865
+ /**
866
+ * The control types a cell control can have, by type.
867
+ *
868
+ * @remarks
869
+ * The built-in types are registered before the registry is first used; a host registers its own
870
+ * the same way. A type nobody has registered still loads and saves, and accepts no value, so its
871
+ * cells draw as text.
872
+ */
873
+ export namespace CellControlRegistry {
874
+ /**
875
+ * Registers a kind. A kind registered again under the same type replaces the earlier one,
876
+ * a built-in included.
877
+ */
878
+ function register(kind: ICellControlKind): void;
879
+ /** The kind registered for `type`, or `null`. */
880
+ function get(type: string): ICellControlKind | null;
881
+ /** The registered types. */
882
+ function getTypes(): string[];
883
+ }
884
+
865
885
  /**
866
886
  * The coordinates of a cell in a 2D space.
867
887
  */
@@ -898,8 +918,8 @@ declare global {
898
918
  * asks each group's kind for the group: where its bars, points, slices or whatever it draws go.
899
919
  *
900
920
  * @beta The context a kind is given speaks the layout's frame units today: points from the frame's
901
- * origin, as the layout works in them (DESIGN-CHART §4), with `at` and `px` to convert. It will
902
- * speak px, as {@link ChartLayout} does, before the contract is settled.
921
+ * origin, as the layout works in them, with `at` and `px` to convert. This may change to px, as
922
+ * {@link ChartLayout} uses, while the API is in beta.
903
923
  *
904
924
  * `coordinates` says what the chrome lays out for the kind: `cartesian`, a pair of axes
905
925
  * (category and value, or a scatter's two value axes) whose scales are fit to what
@@ -1061,7 +1081,7 @@ declare global {
1061
1081
  xOfValue(scale: ValueScale, axis: ResolvedChart.Axis, value: number): number;
1062
1082
  /** The series layout every kind states: id, name, values, slots, fill, stroke and trendlines. */
1063
1083
  base(series: ResolvedChart.Series): Omit<ChartLayout.SeriesLayout, 'marker'>;
1064
- /** A line or area group's up/down bars, high-low lines and drop lines (DESIGN-CHART §4.7). */
1084
+ /** A line or area group's up/down bars, high-low lines and drop lines. */
1065
1085
  analysisLines(scale: ValueScale, tops: (number | null)[][], baseValue: number): Pick<ChartLayout.LineGroupLayout, 'upDownBars' | 'hiLowLines' | 'dropLines'>;
1066
1086
  /** Lines in the frame cut to the plot, in px. */
1067
1087
  segments(lines: Pt[][]): ChartLayout.Segment[];
@@ -1104,7 +1124,7 @@ declare global {
1104
1124
  * The kinds of chart group, by group type: the built-ins, and any a host registers.
1105
1125
  *
1106
1126
  * @remarks
1107
- * The built-in kinds register when the chart module loads (with the first chart, DESIGN-CHART §7),
1127
+ * The built-in kinds register when the chart module loads (with the first chart),
1108
1128
  * so before that {@link get} answers `undefined` for `'bar'`; a host's kind registered under a
1109
1129
  * built-in type keeps its place when they do. A registration is a call, never a side effect of an
1110
1130
  * import: the package declares no side effects, so a bundler drops a module imported only for one.
@@ -1157,7 +1177,11 @@ declare global {
1157
1177
  width: number;
1158
1178
  height: number;
1159
1179
  chartArea: {
1160
- fill: IFill.JSON | null;
1180
+ /**
1181
+ * `undefined` where the chart states no fill: the chart area is the background of where it is
1182
+ * drawn (Excel draws it in the theme's background color).
1183
+ */
1184
+ fill: IFill.JSON | null | undefined;
1161
1185
  border: IStroke.JSON | null;
1162
1186
  /** The radius of the chart area's corners, measured along the border's path; 0 for square corners. */
1163
1187
  cornerRadius: number;
@@ -2634,6 +2658,11 @@ declare global {
2634
2658
  }
2635
2659
  }
2636
2660
 
2661
+ /**
2662
+ * Excel's checkbox: draws a boolean or a blank cell, in place of its text.
2663
+ */
2664
+ export const CheckboxKind: ICellControlKind;
2665
+
2637
2666
  export const ClipboardUtils: {
2638
2667
  readBlobFromClipboard: (clipboard: Clipboard | null, mimeType: string) => Promise<Blob | null>;
2639
2668
  readStringFromClipboard: (clipboard: Clipboard | null, mimeType?: string) => Promise<string>;
@@ -2679,30 +2708,6 @@ declare global {
2679
2708
  }
2680
2709
  }
2681
2710
 
2682
- /**
2683
- * Stacked cell-text layout — Excel's "Vertical Text" (`textRotation="255"`).
2684
- *
2685
- * Stacked text is not rotated. Every glyph stays upright and occupies one SLOT of the font's line
2686
- * pitch, glyphs advancing downward in a column. Measured against Excel (hidden-COM probes, see
2687
- * `VERTICAL-TEXT-PLAN.md`):
2688
- *
2689
- * 1. Columns come from explicit line breaks — one column per line, left → right in reading order —
2690
- * and, when the cell wraps, from breaking a column that would exceed the content height: greedy
2691
- * at spaces (the space at a break is consumed), per glyph inside a word longer than the capacity.
2692
- * It is the horizontal wrap rule transposed. An unwrapped cell keeps one column; a line break
2693
- * there is a blank slot.
2694
- * 2. Leading and trailing spaces of a column are measured but never painted (see
2695
- * {@link layoutColumns}); inner spaces are blank slots.
2696
- * 3. Each column is aligned on its own by the vertical alignment (Top / Center / Bottom; Justify
2697
- * and Distributed behave as Top and Center — nothing is spread). The horizontal alignment places
2698
- * the group of columns; the caller resolves General (Excel centers it). Columns are one pitch
2699
- * wide and glyphs center in them.
2700
- * 4. Nothing overflows: the footprint clips to the cell on both axes.
2701
- *
2702
- * All output is pure geometry, renderer-agnostic: a DOM renderer maps each column to a box of
2703
- * `pitch` line-height with one glyph per line; a canvas renderer paints each glyph centered in
2704
- * its slot.
2705
- */
2706
2711
  /**
2707
2712
  * One stacked column.
2708
2713
  */
@@ -2736,7 +2741,7 @@ declare global {
2736
2741
  * as `IModule.JSON` in the SDK. Produced by `ScriptCompiler.compile` (Node, which returns
2737
2742
  * it inside a {@link CompileResult} alongside diagnostics) and executed compiler-free via
2738
2743
  * `loadCompiledModule`. Compile diagnostics are NOT part of this artifact — they live on
2739
- * {@link CompileResult}. See `private-assets/design/SXLM-FORMAT.md` for the normative reference.
2744
+ * {@link CompileResult}.
2740
2745
  */
2741
2746
  export interface CompiledModule {
2742
2747
  /**
@@ -2956,7 +2961,7 @@ declare global {
2956
2961
  * of {@link IChart} works, `getLayout` lays it out at a size, and `@sheetxl/react`'s `ChartElement`
2957
2962
  * draws it. Its writes are not undoable: it has no transaction store.
2958
2963
  *
2959
- * The chart's code is loaded with the first chart, so this is asynchronous (DESIGN-CHART §7).
2964
+ * The chart's code is loaded with the first chart, so this is asynchronous.
2960
2965
  */
2961
2966
  export function createChart(json: IChart.JSON, options?: CreateChartOptions): Promise<IChart>;
2962
2967
 
@@ -3314,7 +3319,7 @@ declare global {
3314
3319
  *
3315
3320
  * @remarks
3316
3321
  * This is the form Excel's own formula bar shows for a book it cannot see, which is the state every
3317
- * book is in until a resolver opens one (DESIGN-EXTERNAL-LINKS §4B). The caller quotes it —
3322
+ * book is in until a resolver opens one. The caller quotes it —
3318
3323
  * `sheetNameToString` does, since a path carries separators no sheet name may.
3319
3324
  *
3320
3325
  * The directory is the first source that carries one: a book Excel recorded by a RELATIVE path
@@ -3480,8 +3485,8 @@ declare global {
3480
3485
  * Both are the same mechanism at different granularity — the marshaller picks the unit from the
3481
3486
  * element type — and a blank drops out of either. The scalar case is the common one; the range case
3482
3487
  * exists because a reference UNION is a single argument holding several areas: a parameter that does
3483
- * not declare `Flatten` refuses one outright (`#VALUE!` — `TRANSPOSE((A1:A3,C1:C3))` in Excel), and a
3484
- * body that declares it answers for the union itself, in one line, the way Excel's own do:
3488
+ * not declare `Flatten` refuses one outright (`#VALUE!` — `TRANSPOSE((A1:A3,C1:C3))`), and a
3489
+ * body that declares it answers for the union itself, in one line, the way the built-ins do:
3485
3490
  * `AREAS` counts the areas, `SUM` adds them, `ROWS` answers `#REF!` to more than one, the lookups
3486
3491
  * `#N/A`.
3487
3492
  *
@@ -3640,7 +3645,7 @@ declare global {
3640
3645
  *
3641
3646
  * SpillErrorScalarSubType | "Unknown" | "Collision" | "IndeterminateSize" | "WorksheetEdge" | "OutOfMemoryWhileCalc" | "Table" | "MergedCell"
3642
3647
  * # Office 2023
3643
- * 10. #CONNECT! This occurs when a data type is used that is not currently supported in this version of Excel.
3648
+ * 10. #CONNECT! This occurs when a data type is used that is not currently supported.
3644
3649
  * 11. #BLOCKED! Indicates that an action or feature is blocked, possibly due to security settings, protected view, or other restrictions. Often related to online features, external links, or macros.
3645
3650
  * 12. #UNKNOWN! May be returned in the case of a protected workbook.
3646
3651
  * 13. #FIELD! Invalid field name for a data type.
@@ -4992,7 +4997,9 @@ declare global {
4992
4997
  * @returns A promise that will be resolved when the calculation is completed.
4993
4998
  *
4994
4999
  * @remarks
4995
- * For async functions this will return before they are completed.
5000
+ * For async functions this will return before they are completed. An async function is called
5001
+ * again unless its call is still running; what it fetches is answered
5002
+ * from the workbook's cache unless {@link ICalculation.CalculateOptions.external} is set.
4996
5003
  */
4997
5004
  calculate(options?: boolean | ICalculation.CalculateOptions): Promise<ICalculation.Status>;
4998
5005
  /**
@@ -5011,7 +5018,7 @@ declare global {
5011
5018
  /**
5012
5019
  * Resolves once the engine is running and idle: its calculation state is
5013
5020
  * {@link ICalculation.CalculationState.Done}, or {@link ICalculation.CalculationState.Pending} in
5014
- * manual mode.
5021
+ * manual mode (and, under `AutomaticExceptTables`, with only data tables out of date).
5015
5022
  *
5016
5023
  * @remarks
5017
5024
  * * After it, every answer the engine owes has landed: a formula written before it reads as
@@ -5019,14 +5026,46 @@ declare global {
5019
5026
  * * Manual mode does not wait for a recalculation nobody has asked for; call {@link calculate}.
5020
5027
  * * Waits for what consumers derive from the results too ({@link waitUntil}): a conditional
5021
5028
  * format reads as painted after it, including one a read just asked to evaluate.
5022
- * * A streaming or async function's result in flight is not waited for: its cell reads as the
5023
- * current value until the result arrives.
5029
+ * * An async function's result in flight is not waited for: its cell reads as what the
5030
+ * function returned until the result arrives.
5024
5031
  * * Starts the engine if it is {@link ICalculation.Status.Off}. An engine in
5025
5032
  * {@link ICalculation.Status.Error} is not started; {@link start} tries again.
5026
5033
  *
5027
5034
  * @param options Pass `{ full: true }` to recalculate every grid rather than only the dirty ones.
5028
5035
  */
5029
5036
  ready(options?: ICalculation.CalculateOptions): Promise<ICalculation.Status>;
5037
+ /**
5038
+ * How many async function calls are waiting for an answer.
5039
+ */
5040
+ getPendingCount(): number;
5041
+ /**
5042
+ * Resolves once no async function call is pending ({@link getPendingCount} is `0`) and every
5043
+ * answer has been calculated into the workbook — Excel's `CalculateUntilAsyncQueriesDone`.
5044
+ *
5045
+ * @param options `timeout` in milliseconds; 30 seconds when absent.
5046
+ * @returns `true` when nothing is pending; `false` when the timeout came first.
5047
+ *
5048
+ * @remarks
5049
+ * * An answer that makes a formula ask a new question (one call's answer is another's input)
5050
+ * is waited for too.
5051
+ * * {@link ready} is the engine's own readiness and does not wait for answers.
5052
+ */
5053
+ whenPendingDone(options?: {
5054
+ timeout?: number;
5055
+ }): Promise<boolean>;
5056
+ /**
5057
+ * Stops waiting for async function calls — Excel's *Cancel Refresh*: each pending
5058
+ * call the options cover is closed, and the function is told (its `onCancel`).
5059
+ *
5060
+ * @param options Which calls; every call when absent.
5061
+ * @returns A promise that resolves once the cells have been recalculated.
5062
+ *
5063
+ * @remarks
5064
+ * * A cell keeps what it showed — its last answer, or the value its function returned while it
5065
+ * waited — and is no longer pending. An answer that arrives later is dropped.
5066
+ * * A recalculation of a cancelled cell calls its function again.
5067
+ */
5068
+ cancelAsync(options?: ICalculation.CancelOptions): Promise<ICalculation.Status>;
5030
5069
  /**
5031
5070
  * Counts `work` that a consumer derives from the engine's results as calculation in flight
5032
5071
  * until it settles: {@link ready} waits for it, and {@link getCalculationState} reads
@@ -6016,6 +6055,14 @@ declare global {
6016
6055
  * Use {@link ICalculation.FormulaToken.evalIndex} to discover valid indices.
6017
6056
  */
6018
6057
  evalIndex?: number;
6058
+ /**
6059
+ * How long to wait, in milliseconds, for the answers of async functions the formula calls:
6060
+ * the evaluation resolves once each has answered, and
6061
+ * answers a `#TIMEOUT!` error naming the call it waited on when the time runs out.
6062
+ *
6063
+ * @defaultValue `30000`
6064
+ */
6065
+ timeout?: number;
6019
6066
  /**
6020
6067
  * Temporary range of values to use for this evaluation.
6021
6068
  *
@@ -6148,6 +6195,15 @@ declare global {
6148
6195
  * Called when the calculation state has changed - see {@link ICalculation.getCalculationState}.
6149
6196
  */
6150
6197
  onCalculationStateChange?(source: ICalculation): void;
6198
+ /**
6199
+ * Called when the number of async function calls waiting for an answer may have changed — see
6200
+ * {@link ICalculation.getPendingCount}.
6201
+ *
6202
+ * @remarks
6203
+ * Called when calls are made, when answers are applied, and on a cancel or a stop: answers
6204
+ * arriving together are one call.
6205
+ */
6206
+ onPendingChange?(source: ICalculation): void;
6151
6207
  /**
6152
6208
  * Called when a calculation is completed.
6153
6209
  */
@@ -6216,7 +6272,8 @@ declare global {
6216
6272
  readonly Calculating: "calculating";
6217
6273
  /**
6218
6274
  * Changes have been made that need a recalculation, and none will run until one is asked for:
6219
- * manual mode between an edit and {@link ICalculation.calculate}.
6275
+ * manual mode between an edit and {@link ICalculation.calculate}, or the `TABLE` data tables an
6276
+ * edit left out of date under `AutomaticExceptTables`.
6220
6277
  */
6221
6278
  readonly Pending: "pending";
6222
6279
  };
@@ -6287,14 +6344,16 @@ declare global {
6287
6344
  */
6288
6345
  readonly Stale: "stale";
6289
6346
  /**
6290
- * The value is being calculated asynchronously, typically because the function used returned a Promise.
6291
- * All dependent values will also be in the Pending state. If the promise returns an error or times out, the value will be an error value.
6347
+ * The cell's own function asked for its result later (`FormulaContext.defer`) and it has not
6348
+ * arrived: the cell shows what the function returned meanwhile, and its dependents calculate
6349
+ * from that and read as {@link Waiting}. A failed call answers an error value.
6292
6350
  */
6293
6351
  readonly Pending: "pending";
6294
6352
  /**
6295
- * The value is up-to-date, but the underlying data source is streaming live updates.
6353
+ * The value was calculated from a pending value — a precedent whose function has not answered —
6354
+ * and will be calculated again when it does.
6296
6355
  */
6297
- readonly Streaming: "streaming";
6356
+ readonly Waiting: "waiting";
6298
6357
  };
6299
6358
  type ResultStatus = typeof ResultStatus[keyof typeof ResultStatus];
6300
6359
  /**
@@ -6332,6 +6391,39 @@ declare global {
6332
6391
  * live in other sheets, and a named formula's body lives in a virtual grid of its own.
6333
6392
  */
6334
6393
  scope?: string;
6394
+ /**
6395
+ * If `true`, what the calculation reads from outside the workbook is read from the source
6396
+ * again rather than from the workbook's cache — Excel's *Data › Refresh All*: what the async
6397
+ * functions it calls fetch, and, for a calculation that is neither {@link range} nor
6398
+ * {@link scope}, every external book (`IExternalBookCollection.refreshAll`).
6399
+ *
6400
+ * @remarks
6401
+ * * Which functions are called is the calculation's own choice, as without it: pass
6402
+ * {@link full} for every formula. A call still running is left be.
6403
+ * * The calculation resolves without waiting for the new answers or the external books.
6404
+ *
6405
+ * @example Refresh All
6406
+ * ```ts
6407
+ * await workbook.getCalculation().calculate({ full: true, external: true });
6408
+ * ```
6409
+ *
6410
+ * @defaultValue `false`
6411
+ */
6412
+ external?: boolean;
6413
+ }
6414
+ /**
6415
+ * Options for {@link ICalculation.cancelAsync}.
6416
+ */
6417
+ interface CancelOptions {
6418
+ /**
6419
+ * Only the calls of the formulas in this range are cancelled.
6420
+ */
6421
+ range?: ICellRange.Address;
6422
+ /**
6423
+ * Only the calls of the formulas on this sheet, by name, are cancelled. Ignored when
6424
+ * {@link range} is set.
6425
+ */
6426
+ scope?: string;
6335
6427
  }
6336
6428
  interface JSON {
6337
6429
  /**
@@ -6611,10 +6703,16 @@ declare global {
6611
6703
  */
6612
6704
  getRole(): ICell.Role | null;
6613
6705
  /**
6614
- * Returns the hyperlink assigned to the cell.
6706
+ * Returns the cell's link: the hyperlink set on the cell, else the link its value is.
6615
6707
  *
6616
6708
  * @remarks
6617
- * Returns `null` if no hyperlink is set.
6709
+ * Returns `null` when the cell has neither.
6710
+ *
6711
+ * A `HYPERLINK()` result (a {@link Hyperlink} value with an address) is returned as a link with
6712
+ * {@link IHyperlink.isReadOnly} `true`; it is not removed or edited as a link, it changes with
6713
+ * its formula. A hyperlink set on the cell wins when the cell has both. Excel's
6714
+ * `Range.Hyperlinks` and Office Scripts' `Range.getHyperlink()` return nothing for a
6715
+ * `HYPERLINK()` cell.
6618
6716
  */
6619
6717
  getHyperlink(): IHyperlink | null;
6620
6718
  /**
@@ -6759,6 +6857,11 @@ declare global {
6759
6857
  isTopLeft(): boolean;
6760
6858
  /**
6761
6859
  * Returns the range of the cell if it is a spill cell.
6860
+ *
6861
+ * @remarks
6862
+ * For a blocked spill (a {@link getSpillKind | kind} of `error`, the anchor shows `#SPILL!`) this
6863
+ * is the range it would take. It holds none of those cells: their values are whatever is in the
6864
+ * way. Spills can overlap, and one that is not blocked is returned ahead of one that is.
6762
6865
  */
6763
6866
  getSpill(): ICellRange | null;
6764
6867
  /**
@@ -6831,6 +6934,14 @@ declare global {
6831
6934
  * only lays out text does not need to read this at all.
6832
6935
  */
6833
6936
  getConditionalDecorations(): Readonly<IConditionalFormat.Decorations>;
6937
+ /**
6938
+ * Returns the cell's control, such as a checkbox, or `null` when it has none.
6939
+ *
6940
+ * @remarks
6941
+ * A control draws only a value it accepts: ask `getControl()?.isAccepted(getValue())`. A
6942
+ * checkbox cell holding `2` has a control and draws `2`.
6943
+ */
6944
+ getControl(): ICellControl | null;
6834
6945
  /**
6835
6946
  * If the cell is in a table this will return it.
6836
6947
  */
@@ -7186,40 +7297,10 @@ declare global {
7186
7297
  */
7187
7298
  anchorBounds: Bounds;
7188
7299
  }
7189
- /**
7190
- * Encodings of ScalarType for persistence
7191
- */
7192
- type JSONScalarType = 'n' | 's' | 'b' | 'e' | 'r' | 'z';
7193
- /**
7194
- * A value encoded as a number with an associated type.
7195
- */
7196
- interface JSONTypedValue {
7197
- t: JSONScalarType;
7198
- /**
7199
- * The number, string id, error code or boolean flag; for `'r'`, the rich data's own JSON
7200
- * (`IRichData.JSON`), which its registered kind reads back.
7201
- */
7202
- v: number | IRichData.JSON;
7203
- }
7204
7300
  /**
7205
7301
  * Reexports the `IRange.CellCoords` type for use in cell coordinates.
7206
7302
  */
7207
7303
  type Coords = IRange.CellCoords;
7208
- /**
7209
- * JSON values types that have their type embedded in the
7210
- * 'format'.
7211
- *
7212
- * @remarks
7213
- * A string value is the string id in the `IStringsCollection`.
7214
- */
7215
- type JSONUnTypedValue = number | boolean | string;
7216
- /**
7217
- * For persisting a single Cell value and type.
7218
- *
7219
- * @remarks
7220
- * Styling and other advanced properties are stored as ranges.
7221
- */
7222
- type JSON = JSONUnTypedValue | JSONTypedValue;
7223
7304
  /**
7224
7305
  * Represents the types of content that can be associated with a cell or range.
7225
7306
  *
@@ -7373,12 +7454,22 @@ declare global {
7373
7454
  readonly LookupShape: "lookupShape";
7374
7455
  /** A reference to another workbook, a deleted reference, or a function a converter could not name. */
7375
7456
  readonly ExternalReference: "externalReference";
7457
+ /** A formula that is only an error value, such as `=#DIV/0!`: what a converter leaves when it drops a formula. */
7458
+ readonly ErrorConstant: "errorConstant";
7376
7459
  /** A link to another sheet whose target row is labeled other than its own row. */
7377
7460
  readonly LinkLabelMismatch: "linkLabelMismatch";
7378
7461
  /** A lookup keyed by a typed string that labels neither the formula's row nor its column. */
7379
7462
  readonly KeyLabelMismatch: "keyLabelMismatch";
7380
7463
  /** A link read with the other sign from the sheet's other links into the same row. */
7381
7464
  readonly SignVsSiblings: "signVsSiblings";
7465
+ /** A number typed into a formula that equals a typed number on the sheet no formula reads. */
7466
+ readonly LiteralMatchesInput: "literalMatchesInput";
7467
+ /** A formula that differs from its twins on the sheet, the formulas of the same shape, in a typed number. */
7468
+ readonly TwinBlockDivergence: "twinBlockDivergence";
7469
+ /** A typed number an order of magnitude or more off the numbers typed in its format on the sheet. */
7470
+ readonly ScaleOutlier: "scaleOutlier";
7471
+ /** A constant typed into a formula — a number, a string or a boolean — and how often the workbook types it. */
7472
+ readonly ConstantFrequency: "constantFrequency";
7382
7473
  };
7383
7474
  type ErrorCheck = typeof ErrorCheck[keyof typeof ErrorCheck];
7384
7475
  /**
@@ -7409,9 +7500,14 @@ declare global {
7409
7500
  * | `approximateMatch` | `function`; `matchType`, `'1'`, `'-1'`, `'TRUE'` or `'omitted'` |
7410
7501
  * | `lookupShape` | `array`, the range the result is read from; `vector`, the range the key is found in |
7411
7502
  * | `externalReference` | `kind` (`'workbook'`, `'deleted'`, `'udf'`); `reference`, or `function` for a `'udf'` |
7503
+ * | `errorConstant` | `error`, the error the formula is; `dataTable`, the anchor of a data table that spills less than the block it heads, and `extent`, the rectangle the two cover |
7412
7504
  * | `linkLabelMismatch` | `label` / `labelAt`, the cell's row label; `target` / `targetAt`, the label of the row it links to |
7413
7505
  * | `keyLabelMismatch` | `function`; `key`; `rowLabel` / `rowLabelAt` and `columnLabel` / `columnLabelAt`, where found |
7414
7506
  * | `signVsSiblings` | `reference`; `sign` (`'negative'` / `'positive'`); `siblings`, how many links into that row read the other sign; `siblingAt`, one of them |
7507
+ * | `literalMatchesInput` | `literal`, the number as the formula types it; `inputAt`, the nearest typed number of that value no formula reads; `label` / `labelAt`, that input's label, when it has one; `matches`, the places the value is typed unread |
7508
+ * | `twinBlockDivergence` | `part` (`'literal'` / `'sign'`); for a literal, `literal` and `expected`, this formula's number and its twins'; for a sign, `term` of `terms`, the term that differs, `references`, how many the shape holds, and `sign`, how this formula adds it; `twins`, how many formulas carry the other side; `twinAt`, one of them |
7509
+ * | `scaleOutlier` | `format` (`'percent'`); `times`, the power of ten the value is off by; `typical`, the median of the sheet's typed numbers in that format; `of`, how many there are |
7510
+ * | `constantFrequency` | `kind` (`'number'`, `'string'`, `'boolean'`); `value`, a number without its sign; `uses`, the places in the workbook that type it; `of`, the workbook's constant uses |
7415
7511
  *
7416
7512
  * **Runs.** `formula`, `hardcodeInRun` and `styleBreak` are one rule over different layers of
7417
7513
  * the sheet: a region thin against the run it sits in. The cells on both sides agree with each
@@ -7445,26 +7541,26 @@ declare global {
7445
7541
  * cell with none authored has the Normal style's. `majority` and `of` are evidence, not a
7446
7542
  * gate: a convention held by 3 of 5 cells is reported as such.
7447
7543
  *
7448
- * **Rank** says which finding to read first. It is not a confidence. For a run finding it is
7449
- * `weight × (1 / thickness) × (flanks / max(2, thickness)) × (1 − corroboration)`, where
7450
- * `weight` is the layer's and `corroboration` is the weight of the corroborating layers over the
7451
- * weight of every layer that could have corroborated. The layer weights are formula shape `1`,
7452
- * kind `0.6`, number format `0.5`, formula or typed value `0.4`, font `0.3`, fill `0.1`,
7453
- * alignment `0.05`. Every other check ranks at a fixed weight: `repeatedReference` and
7454
- * `lookupShape` `1`, `approximateMatch` and `externalReference` `0.9`, `formulaRange` and
7455
- * `degenerateCall` `0.8`, `emptyCellReference` and `sumIncludesSubtotal` `0.6`,
7456
- * `keyLabelMismatch` and `linkLabelMismatch` `0.4`, `unlockedFormula` and `signVsSiblings` `0.1`,
7457
- * `numberStoredAsText` `0.05`. A `styleRole` finding ranks at the role's weight (`link` `0.6`,
7458
- * `reference` `0.4`, `input` `0.3`, `computed` `0.2`) times `majority / of`. A
7459
- * `misalignedReference` finding ranks at `0.8` times its target's share: `lineItem` `1`,
7460
- * `outsideBlocks` `0.5`, `closingRow` and `absolute` `0.25`.
7461
- *
7462
- * A run or `styleRole` finding's rank is then divided by the number of times the same finding
7463
- * (the same check and evidence) occurs in the workbook: a finding repeated across a model is the
7464
- * author's style, and the one that occurs once is the exception to read first. So a finding's
7465
- * rank can change when another sheet changes. The weights are measured on the SpreadsheetBench
7466
- * v2 Debugging goldens and move as other measurements arrive. Regions of the `anomalies` feature
7467
- * list highest rank first, and so do a cell's findings, in check order within an equal rank.
7544
+ * **Rank** says which finding to read first. It is not a confidence, and it is relative to the
7545
+ * workbook: a finding repeated across a model is the author's style, and the one that occurs
7546
+ * once is the exception to read first. So a finding's rank can change when another sheet
7547
+ * changes. Regions of the `anomalies` feature list highest rank first, and so do a cell's
7548
+ * findings, in check order within an equal rank.
7549
+ *
7550
+ * **Literals and twins.** `literalMatchesInput` reads the numbers typed into a formula against
7551
+ * the typed numbers no formula reads: a reference replaced by its value is what left the input
7552
+ * unread. Small counts, calendar periods and powers of ten never fire. `twinBlockDivergence`
7553
+ * reads formulas of the same shape once references, literals and signs are set aside: twins that
7554
+ * divide by `12` and by `365`, or one that adds a term the others take away. Literals compare only
7555
+ * when both are a calendar period, a power of ten or a small count. Every side of a divergence is
7556
+ * listed, since two wrong rows can outvote the right one.
7557
+ *
7558
+ * A sign divergence ranks low: signs differ between line items by design, so it is read when
7559
+ * asked for by check.
7560
+ *
7561
+ * `constantFrequency` reports every constant a formula types, the common ones too, with how many
7562
+ * places in the workbook type it (`uses`) and of how many constant uses (`of`). The rarer the
7563
+ * constant, the higher it ranks. A finding's `uses` and `of` change when another sheet changes.
7468
7564
  *
7469
7565
  * A label's position is absolute (`R12C3`), since it stays put whichever cell of a region reads
7470
7566
  * it; its text is the one read at the region's first cell.
@@ -7503,6 +7599,11 @@ declare global {
7503
7599
  * Option to provide shared strings.
7504
7600
  */
7505
7601
  strings?: IStringCollection;
7602
+ /**
7603
+ * Option to provide shared rich values, the store cells hold rich data in by id, as they hold
7604
+ * strings in {@link strings}.
7605
+ */
7606
+ richData?: IRichDataCollection;
7506
7607
  /**
7507
7608
  * Option to provide a shared StyleCollection. If not provided then a new StyleCollection with default theming will be used.
7508
7609
  */
@@ -7616,6 +7717,189 @@ declare global {
7616
7717
  type CalcOnLoad = 'auto' | 'full' | 'none';
7617
7718
  }
7618
7719
 
7720
+ /**
7721
+ * A control drawn in the cells of a range, such as a checkbox.
7722
+ *
7723
+ * @remarks
7724
+ * A cell control decorates the cell's value; it never holds one. A checkbox draws `TRUE` as
7725
+ * checked and `FALSE` or blank as unchecked, and a click writes the boolean into the cell, where
7726
+ * formulas read it as any other value. Excel's model is the same: the checkbox is a cell
7727
+ * *format*, and *Clear Formats* removes it while the value stays.
7728
+ *
7729
+ * * A cell has at most one control. One control covers any number of cells, and its ranges
7730
+ * shift, split, copy and fill with them.
7731
+ * * A control draws only the values its type accepts ({@link isAccepted}). Any other value draws
7732
+ * as plain text: a checkbox over `2` or `"true"` draws `2` or `true`, as in Excel.
7733
+ * * Most code never needs this interface: {@link ICellRange.setControl} and
7734
+ * {@link ICellRange.getControls} stand in for Office Scripts' `Range.setControl` /
7735
+ * `getControl`.
7736
+ */
7737
+ export interface ICellControl extends IAnchored {
7738
+ /**
7739
+ * The control's type, such as `'checkbox'`.
7740
+ *
7741
+ * @remarks
7742
+ * A type nobody has registered (`CellControlRegistry`) is kept and saved as it was read; it
7743
+ * accepts no value, so its cells draw as text.
7744
+ */
7745
+ getType(): string;
7746
+ /**
7747
+ * Returns the first range the control covers.
7748
+ *
7749
+ * @remarks
7750
+ * See {@link IAnchored.getRanges} for all of them. To change where a control is, use
7751
+ * {@link ICellRange.setControl}.
7752
+ */
7753
+ getRange(): ICellRange;
7754
+ /**
7755
+ * Whether the control draws a cell holding `value`.
7756
+ *
7757
+ * @remarks
7758
+ * A checkbox accepts a boolean or a blank cell. A value it does not accept draws as the cell
7759
+ * would without the control.
7760
+ */
7761
+ isAccepted(value: Scalar): boolean;
7762
+ /**
7763
+ * Add Listeners.
7764
+ *
7765
+ * @see
7766
+ * {@link IListener.ISource.addListeners}
7767
+ */
7768
+ addListeners(listeners: ICellControl.IListeners, options?: IListener.Options): IListener.Remove;
7769
+ /**
7770
+ * The control as JSON: its `type` and any properties of that type.
7771
+ */
7772
+ toJSON(): ICellControl.JSON;
7773
+ /**
7774
+ * For runtime type checking.
7775
+ */
7776
+ readonly isICellControl: true;
7777
+ }
7778
+
7779
+ /**
7780
+ * {@inheritDoc ICellControl}
7781
+ * @see
7782
+ * ### **Interface**
7783
+ *
7784
+ * {@link ICellControl}
7785
+ *
7786
+ * **Additional Interfaces**
7787
+ * * {@link ICellControlCollection}
7788
+ */
7789
+ export namespace ICellControl {
7790
+ /**
7791
+ * A control as JSON: its `type`, and any properties that type defines.
7792
+ *
7793
+ * @remarks
7794
+ * Office Scripts' `CellControl`: `{ type: 'checkbox' }`. A checkbox has no other properties.
7795
+ * Office Scripts' `EmptyCellControl` is `null` here.
7796
+ */
7797
+ interface JSON {
7798
+ /**
7799
+ * The control's type, such as `'checkbox'`.
7800
+ */
7801
+ type: string;
7802
+ /**
7803
+ * Properties of the type.
7804
+ */
7805
+ [property: string]: unknown;
7806
+ }
7807
+ /**
7808
+ * IListener for {@link ICellControl} events.
7809
+ */
7810
+ interface Events extends IAnchored.Events<ICellControl> {
7811
+ }
7812
+ interface IListeners extends IListener.Callbacks<ICellControl, ICellControl.Events> {
7813
+ }
7814
+ }
7815
+
7816
+ /**
7817
+ * Holds a sheet's {@link ICellControl}s.
7818
+ *
7819
+ * @remarks
7820
+ * Most code reaches controls through the range instead: {@link ICellRange.setControl} puts a
7821
+ * control on cells and {@link ICellRange.getControls} reads it back. The collection is for listing
7822
+ * every control, as a task pane does.
7823
+ */
7824
+ export interface ICellControlCollection extends ICollection<ICellControl> {
7825
+ /**
7826
+ * Puts a control on the cells of `address`, replacing their controls, and returns it.
7827
+ *
7828
+ * @param address The address of the cells. May name several discontiguous ranges.
7829
+ * @param control The control, such as `{ type: 'checkbox' }`.
7830
+ *
7831
+ * @remarks
7832
+ * The same write as {@link ICellRange.setControl}, over any address. A cell has at most one
7833
+ * control, so the cells leave whatever control they had, and join a control of the same
7834
+ * definition when the sheet already has one.
7835
+ */
7836
+ add(address: ICellRanges.Address, control: ICellControl.JSON, options?: ITransaction.OperationOptions): ICellControl;
7837
+ /**
7838
+ * Returns items that match the filter criteria.
7839
+ *
7840
+ * If no filter criteria is provided, all items will be returned.
7841
+ *
7842
+ * @param options {@link ICellControlCollection.GetItemsOptions}
7843
+ */
7844
+ getItems(options?: ICellControlCollection.GetItemsOptions): ICellControl[];
7845
+ /** For runtime type checking. */
7846
+ readonly isICellControlCollection: true;
7847
+ }
7848
+
7849
+ /**
7850
+ * {@inheritDoc ICellControlCollection}
7851
+ * @see
7852
+ * ### **Interface**
7853
+ *
7854
+ * {@link ICellControlCollection}
7855
+ */
7856
+ export namespace ICellControlCollection {
7857
+ /**
7858
+ * Options for searching for {@link ICellControl}s.
7859
+ */
7860
+ interface GetItemsOptions extends ICollection.GetItemsOptions {
7861
+ /**
7862
+ * If provided, the search will be limited to items that intersect the range.
7863
+ */
7864
+ address?: ICellRange.Address;
7865
+ /**
7866
+ * Indicate if items that are in hidden headers or marked as hidden should be returned.
7867
+ *
7868
+ * @defaultValue false
7869
+ */
7870
+ ignoreHidden?: boolean;
7871
+ /**
7872
+ * Only return items that are completely contained with the search bounds.
7873
+ *
7874
+ * @defaultValue false
7875
+ */
7876
+ fullyContained?: boolean;
7877
+ }
7878
+ }
7879
+
7880
+ /**
7881
+ * What a control type does to the cells it covers: which values it draws.
7882
+ *
7883
+ * @remarks
7884
+ * The SDK half of a control type. How it looks and how it responds to the pointer and keys belong
7885
+ * to the UI, which registers its own renderer under the same `type`.
7886
+ */
7887
+ export interface ICellControlKind {
7888
+ /**
7889
+ * The type this kind is registered under, such as `'checkbox'`.
7890
+ */
7891
+ readonly type: string;
7892
+ /**
7893
+ * The kind's name where a UI lists the kinds that can be inserted, such as `'Rating'`. Plain
7894
+ * text; the built-in checkbox takes its name from the command catalog instead.
7895
+ */
7896
+ readonly label?: string;
7897
+ /**
7898
+ * Whether the control draws a cell holding `value`. Any other value draws as text.
7899
+ */
7900
+ accepts(value: Scalar): boolean;
7901
+ }
7902
+
7619
7903
  /**
7620
7904
  * A logic label for an entire span of cells in either direction.
7621
7905
  */
@@ -8341,6 +8625,39 @@ declare global {
8341
8625
  * {@link IConditionalFormat.getRanges}.
8342
8626
  */
8343
8627
  getConditionalFormats(options?: ICellRange.GetItemsOptions<IConditionalFormatCollection.GetItemsOptions>): IConditionalFormat[];
8628
+ /**
8629
+ * Returns the {@link ICellControl}s on cells within the range, such as checkboxes.
8630
+ *
8631
+ * @param options The filters of {@link ICellControlCollection.getItems} without `address` —
8632
+ * this range is the address.
8633
+ *
8634
+ * @remarks
8635
+ * See {@link getConditionalFormats} for the overlap and one-entry-per-item rules, which are the
8636
+ * same for every ranged item lookup. A cell has at most one control; ask a cell for its own with
8637
+ * {@link ICell.getControl}.
8638
+ *
8639
+ * Office Scripts' `Range.getControl()` answers one `CellControl` for the whole range; here
8640
+ * `getControls()[0]?.getType()` reads a single cell's, and `toJSON()` gives the
8641
+ * `{ type: 'checkbox' }` shape. A control is about the cell, not its value: a checkbox cell
8642
+ * holding `2` still has one, though it draws `2` ({@link ICellControl.isAccepted}). A type
8643
+ * SheetXL does not know answers with its own name, where Excel answers `unknown`.
8644
+ */
8645
+ getControls(options?: ICellRange.GetItemsOptions<ICellControlCollection.GetItemsOptions>): ICellControl[];
8646
+ /**
8647
+ * Puts `control` on every cell of the range, replacing the control each had; `null` removes
8648
+ * them.
8649
+ *
8650
+ * @param control The control, such as `{ type: 'checkbox' }`, or `null`.
8651
+ *
8652
+ * @remarks
8653
+ * Office Scripts' `Range.setControl`, with `null` for its `{ type: 'empty' }`. A cell has at most
8654
+ * one control. The values stay as they are: a checkbox draws `TRUE` as checked and `FALSE` or a
8655
+ * blank cell as unchecked, and any other value as text.
8656
+ *
8657
+ * A control is a format: refused on a protected sheet unless formatting cells is allowed, removed
8658
+ * by {@link clear} of formats, and carried by a paste of formats.
8659
+ */
8660
+ setControl(control: ICellControl.JSON | null, options?: ITransaction.OperationOptions): this;
8344
8661
  /**
8345
8662
  * Returns the {@link IDataValidation}s that overlap the range.
8346
8663
  *
@@ -9013,7 +9330,7 @@ declare global {
9013
9330
  getRegions(features?: ICellRange.Feature | readonly ICellRange.Feature[], options?: ICellRange.GetRegionsOptions): ICellRegions;
9014
9331
  /**
9015
9332
  * Returns the regions of the `anomalies` feature in reading order: the named checks first, then
9016
- * the rest, each by rank.
9333
+ * the rest, each by the named focus or by rank.
9017
9334
  *
9018
9335
  * @param options {@link ICellRange.GetAnomaliesOptions}
9019
9336
  *
@@ -9022,6 +9339,8 @@ declare global {
9022
9339
  * // Hunting an embedded hardcode: read its checks' findings first, 25 regions at a time.
9023
9340
  * sheet.getAnomalies({ checks: ['hardcodeInRun', 'styleRole'], limit: 25 });
9024
9341
  * sheet.getAnomalies({ checks: ['hardcodeInRun', 'styleRole'], limit: 25, offset: 25 });
9342
+ * // Or name the kind of defect and let the ranking decide.
9343
+ * sheet.getAnomalies({ focus: 'unitMismatch', limit: 25 });
9025
9344
  * ```
9026
9345
  *
9027
9346
  * @remarks
@@ -9032,6 +9351,13 @@ declare global {
9032
9351
  * region two named checks fire on lists once, under the first. An ignored check
9033
9352
  * ({@link setErrorIgnored}) is not there to list.
9034
9353
  *
9354
+ * `focus` names the kind of defect being looked for ({@link ICellRange.AnomalyFocus}). Each
9355
+ * finding then weighs as the share of findings like it — the same check, the same kind of
9356
+ * evidence, about as often repeated in the listing — that were that kind of defect in audited
9357
+ * models, and a region lists by its best finding, by rank where that is equal. Several kinds
9358
+ * merge into one order by the best of them. It reorders; it neither adds nor drops a region, and
9359
+ * the findings' own ranks are unchanged.
9360
+ *
9035
9361
  * `offset` and `limit` page through that one order, so successive windows neither skip nor
9036
9362
  * repeat a region; a window shorter than `limit` is the last. `getRegions('anomalies').getCount()`
9037
9363
  * is the length of the whole list.
@@ -9534,12 +9860,23 @@ declare global {
9534
9860
  */
9535
9861
  select(options?: ICellRange.SelectOptions): Promise<this>;
9536
9862
  /**
9537
- * Add a listener to the range.
9863
+ * Listen for changes at this range: its cells written, recalculated or undone, and the range
9864
+ * itself moved by rows or columns inserted or deleted around it.
9538
9865
  *
9539
- * @returns A callback to remove. {@link IListener.Remove}
9866
+ * @returns A callback that removes the listener. {@link IListener.Remove}
9540
9867
  *
9541
9868
  * @remarks
9542
- * If the range becomes invalid through a delete this will auto remove.
9869
+ * The listener is handed an {@link ICellRange.Event} whose source is the listened range where
9870
+ * it is now. Which events it hears, how it follows inserts and deletes, and whether it takes
9871
+ * part in the change or observes it afterwards are {@link ICellRange.ListenerOptions}.
9872
+ *
9873
+ * @example
9874
+ * ```ts
9875
+ * const remove = sheet.getRange('A1:C3').addListener((event) => {
9876
+ * if (event.getTrigger() === 'data') console.log('changed:', event.getRanges()!.getAddress());
9877
+ * else console.log('now at:', event.getSource().getAddress());
9878
+ * });
9879
+ * ```
9543
9880
  */
9544
9881
  addListener(listener: ICellRange.Listener, options?: ICellRange.ListenerOptions): IListener.Remove;
9545
9882
  /**
@@ -9608,10 +9945,13 @@ declare global {
9608
9945
  *
9609
9946
  * This method is a more scalable alternative to `getValues` or `getCells` for large or sparse ranges,
9610
9947
  * as it:
9611
- * 1. Skips empty values by default.
9948
+ * 1. Skips empty values by default, however much of the range is styled.
9612
9949
  * 2. Avoids creating large arrays.
9613
9950
  * 3. Allows for early termination.
9614
-
9951
+ *
9952
+ * To reach blank cells that have a feature, such as a fill or a hyperlink, name it in
9953
+ * {@link ICellRange.IteratorOptions.features}.
9954
+ *
9615
9955
  * @param callback A function that will be called for each non-empty cell in the range. The callback receives:
9616
9956
  * - `value`: The `Scalar` at the current cell.
9617
9957
  * - `context`: A `IteratorContext` object providing additional information and utilities for the cell.
@@ -9796,15 +10136,20 @@ declare global {
9796
10136
  */
9797
10137
  type ScalarUpdate = Scalar | null | undefined;
9798
10138
  /**
9799
- * Represents an update to a cell's value in JavaScript, allowing `Date` and `null`.
10139
+ * Represents an update to a cell's value in JavaScript, allowing `Date`, a rich value's JSON
10140
+ * and `null`.
9800
10141
  *
9801
10142
  * @remarks
9802
10143
  * This type allows for updating a cell's value, including `Date` for convenience.
9803
10144
  * As with `ScalarUpdate`, `null` can be used to clear the cell's value.
9804
10145
  *
10146
+ * A rich value may be given as its JSON (`{ type, data }`, what {@link IRichData.toJSON}
10147
+ * returns); it is made by the kind registered for `type`, and an unregistered type is kept
10148
+ * as it was given.
10149
+ *
9805
10150
  * * See {@link InteropScalar} for more details on JavaScript scalar values.
9806
10151
  */
9807
- type InteropScalarUpdate = InteropScalar | null | undefined;
10152
+ type InteropScalarUpdate = InteropScalar | IRichData.JSON | null | undefined;
9808
10153
  /**
9809
10154
  * Single or 2D.
9810
10155
  */
@@ -10370,8 +10715,8 @@ declare global {
10370
10715
  *
10371
10716
  * @remarks
10372
10717
  * The same lens {@link ICellRange.getCounts} and {@link ICellRange.getRegions} take, and it
10373
- * costs no extra scan: the range is split at the hidden runs first (off the header run
10374
- * structure, no per-cell probe) and the resulting pieces are measured as ONE population.
10718
+ * costs no extra scan: the range is split at the hidden runs first and the resulting pieces
10719
+ * are measured as ONE population.
10375
10720
  *
10376
10721
  * Optionally an {@link IRange.Axis} to skip on one axis only.
10377
10722
  */
@@ -10911,7 +11256,8 @@ declare global {
10911
11256
  */
10912
11257
  readonly Role: "role";
10913
11258
  /**
10914
- * Direct date-category number format — `yyyy-mm-dd`, `mm/dd/yyyy`, and the like.
11259
+ * A date-category number format, given directly or by a named style — `yyyy-mm-dd`,
11260
+ * `mm/dd/yyyy`, and the like.
10915
11261
  *
10916
11262
  * @remarks
10917
11263
  * A formatting predicate, not a value kind: a blank cell or a text cell formatted this way
@@ -10935,6 +11281,14 @@ declare global {
10935
11281
  * failure — its cells evaluate, to `0` — and is {@link Feature.Circular}.
10936
11282
  */
10937
11283
  readonly CalcError: "calcError";
11284
+ /**
11285
+ * Evaluated state: cells whose result has not settled. Regions group by status — a cell whose
11286
+ * own function has not answered yet ({@link ICalculation.ResultStatus.Pending}), or one
11287
+ * calculated from such a value and calculated again when it arrives
11288
+ * ({@link ICalculation.ResultStatus.Waiting}). The anchor's `getCalculationStatus()` is the
11289
+ * payload. Empty once every answer has landed.
11290
+ */
11291
+ readonly CalcStatus: "calcStatus";
10938
11292
  /**
10939
11293
  * Evaluated state: cells in a reference cycle, or downstream of one. Both evaluate to `0`
10940
11294
  * (Excel, iterative calculation off) with nothing else to show for it — this is the marker.
@@ -10947,7 +11301,11 @@ declare global {
10947
11301
  readonly Fill: "fill";
10948
11302
  /** Direct borders. */
10949
11303
  readonly Borders: "borders";
10950
- /** Direct number format. Region payloads carry the format string and its category. */
11304
+ /**
11305
+ * A number format given directly or by a named style, not one left at Normal's. Region payloads
11306
+ * carry the format string and its category, so a block with `0%` set directly and one with the
11307
+ * `Percent` style are one region.
11308
+ */
10951
11309
  readonly NumberFormat: "numberFormat";
10952
11310
  /** Direct alignment. */
10953
11311
  readonly Alignment: "alignment";
@@ -10964,7 +11322,7 @@ declare global {
10964
11322
  readonly Table: "table";
10965
11323
  /** Auto-table membership. */
10966
11324
  readonly AutoTable: "autoTable";
10967
- /** Has a hyperlink. */
11325
+ /** Has a hyperlink. Regions group by what the link says, so the same link set twice is one region. */
10968
11326
  readonly Hyperlink: "hyperlink";
10969
11327
  /**
10970
11328
  * Ignores one or more of Excel's error checks. Regions group by the set of checks ignored.
@@ -10982,6 +11340,14 @@ declare global {
10982
11340
  readonly Conditionals: "conditionals";
10983
11341
  /** Cells under data-validation rules. */
10984
11342
  readonly DataValidations: "dataValidations";
11343
+ /**
11344
+ * Cells under a cell control ({@link ICellRange.setControl}). Regions group by the control's
11345
+ * definition (its type and properties), so adjacent checkboxes set in two strokes are one
11346
+ * region and a checkbox beside a rating are two; the anchor cell's {@link ICell.getControl} is
11347
+ * the payload. Whether a cell draws its control depends on its value, which is a `Kind`
11348
+ * question: ask for both to split a column of checkboxes from the text cells among them.
11349
+ */
11350
+ readonly CellControl: "cellControl";
10985
11351
  /**
10986
11352
  * Cells where an error check fires — what breaks the pattern around it. Regions group by the
10987
11353
  * check and its evidence, so a filled row that breaks the same way is one region; the anchor
@@ -11003,7 +11369,11 @@ declare global {
11003
11369
  * a reference outside the workbook (`externalReference`); and from labels: a link whose target
11004
11370
  * row is labeled otherwise (`linkLabelMismatch`), a lookup key that is not the row's or
11005
11371
  * column's label (`keyLabelMismatch`), a link with the other sign from its siblings
11006
- * (`signVsSiblings`). An ignored check ({@link ICellRange.setErrorIgnored}) does not fire.
11372
+ * (`signVsSiblings`); and from the numbers: a typed number in a formula equal to an input
11373
+ * nothing reads (`literalMatchesInput`), twin formulas that differ in a unit literal or a sign
11374
+ * (`twinBlockDivergence`), a percent typed as a whole number (`scaleOutlier`), every constant a
11375
+ * formula types with how often the workbook types it (`constantFrequency`). An ignored check
11376
+ * ({@link ICellRange.setErrorIgnored}) does not fire.
11007
11377
  *
11008
11378
  * Regions list highest rank first ({@link ICell.Anomaly.rank}), unless an `axis` is asked for.
11009
11379
  *
@@ -11067,6 +11437,33 @@ declare global {
11067
11437
  */
11068
11438
  containment?: 'intersects' | 'fullyContained';
11069
11439
  }
11440
+ /**
11441
+ * A kind of defect a reader is looking for, which {@link ICellRange.getAnomalies} can order its
11442
+ * findings by ({@link GetAnomaliesOptions.focus}).
11443
+ */
11444
+ const AnomalyFocus: {
11445
+ /** A cell or a subtotal counted twice in a sum. */
11446
+ readonly DoubleCounting: "doubleCounting";
11447
+ /** A typed number where a reference belongs. */
11448
+ readonly EmbeddedHardcode: "embeddedHardcode";
11449
+ /** A cell whose font color is not its role's (inputs, links, calculations). */
11450
+ readonly ColorCoding: "colorCoding";
11451
+ /** An average over the wrong cells. */
11452
+ readonly Average: "average";
11453
+ /** A link to another sheet that reads the wrong row or column. */
11454
+ readonly CrossSheetReference: "crossSheetReference";
11455
+ /** A term added that should be taken away, or the reverse. */
11456
+ readonly SignConvention: "signConvention";
11457
+ /** A lookup that matches approximately, or reads arrays that do not line up. */
11458
+ readonly Lookup: "lookup";
11459
+ /** A reference relative where it should be absolute, or the reverse. */
11460
+ readonly ReferenceAnchoring: "referenceAnchoring";
11461
+ /** A value in the wrong unit: a monthly figure in a daily formula, a percent typed as a whole number. */
11462
+ readonly UnitMismatch: "unitMismatch";
11463
+ /** Rows deleted from a model, which leaves references shifted and `#REF!`. */
11464
+ readonly DeletedRows: "deletedRows";
11465
+ };
11466
+ type AnomalyFocus = typeof AnomalyFocus[keyof typeof AnomalyFocus];
11070
11467
  /**
11071
11468
  * Options for {@link ICellRange.getAnomalies}.
11072
11469
  */
@@ -11077,6 +11474,15 @@ declare global {
11077
11474
  * @defaultValue none — every region by rank
11078
11475
  */
11079
11476
  checks?: readonly ICell.ErrorCheck[];
11477
+ /**
11478
+ * The kind of defect being looked for, or several: regions are ordered by how often findings
11479
+ * like theirs have been that kind of defect in audited models, and by rank where that is
11480
+ * equal. With `checks` too, the named checks still list first and `focus` orders
11481
+ * within each. An unknown name throws.
11482
+ *
11483
+ * @defaultValue none — by rank
11484
+ */
11485
+ focus?: AnomalyFocus | readonly AnomalyFocus[];
11080
11486
  /**
11081
11487
  * At most this many regions.
11082
11488
  *
@@ -11167,9 +11573,12 @@ declare global {
11167
11573
  /**
11168
11574
  * The features the iteration resolves and visits.
11169
11575
  *
11170
- * @defaultValue all features
11576
+ * @defaultValue all features are resolved, and only the cells with values are visited
11171
11577
  *
11172
11578
  * @remarks
11579
+ * Naming a feature also visits the blank cells that have it: `features: 'hyperlink'` reaches a
11580
+ * link on an empty cell, and `features: 'fill'` every cell of a filled column.
11581
+ *
11173
11582
  * Two effects, both wins for a caller that does not need everything:
11174
11583
  * - The iterator only materializes the requested features' state onto the context — an
11175
11584
  * excluded feature is never even looked up.
@@ -11229,85 +11638,101 @@ declare global {
11229
11638
  */
11230
11639
  injectReferences?: IRange.JSONReference<any>[][];
11231
11640
  }
11232
- interface Event {
11641
+ /**
11642
+ * What a range listener is told. See {@link ICellRange.addListener}.
11643
+ *
11644
+ * @typeParam S The source the listener registered on: an `ICellRange` from
11645
+ * {@link ICellRange.addListener}, an `ICellRanges` from {@link ICellRanges.addListener}.
11646
+ */
11647
+ interface Event<S extends ICellRange | ICellRanges = ICellRange> {
11233
11648
  /**
11234
11649
  * The range that was listened to, where it is now.
11235
11650
  *
11236
11651
  * @remarks
11237
- * After a `'address'` or `'restore'` event this is the range at its new address or extent: rows
11652
+ * After an `'address'` or `'restore'` event this is the range at its new address or extent: rows
11238
11653
  * or columns inserted or deleted around it, or an undo that moved it back. The range
11239
11654
  * `addListener` was called on keeps the address it was made with, so this is where to read
11240
11655
  * the range from.
11656
+ *
11657
+ * A range whose cells were deleted is invalid ({@link ICellRange.isInvalid}) and spells
11658
+ * `#REF!`; one restored to a revision from before the listener was added is invalid and
11659
+ * spells `#N/A`.
11241
11660
  */
11242
- getSource<T = ICellRange | ICellRanges>(): T;
11661
+ getSource(): S;
11243
11662
  /**
11244
- * This is the range of data that has been changed.
11663
+ * The cells that changed within the source, for a `'data'` event; `null` for any other.
11245
11664
  *
11246
11665
  * @remarks
11247
- * This is different than the source range as that is the entire range area that was listened to.
11666
+ * A batch is one change: every range of it that reached the listener arrives in one event.
11248
11667
  */
11249
- getFrom(): ICellRanges;
11668
+ getRanges(): ICellRanges | null;
11250
11669
  /**
11251
- * Returns a list of updates that occurred during the event. This is only available for data change events and will be `null` for address or restore events.
11670
+ * Where the source was before an `'address'` event moved it; `null` for any other event, and
11671
+ * for a sheet rename, which moves no cells.
11672
+ *
11673
+ * @remarks
11674
+ * An address rather than a range, because the cells at it now are other cells.
11252
11675
  */
11676
+ getPreviousAddress(): string | null;
11253
11677
  /**
11254
- * Indicates the type of change that triggered the event.
11678
+ * What happened to the range.
11255
11679
  *
11256
11680
  * @remarks
11257
- * * `'data'`: Data within the range has changed.
11258
- * The range's address and dimensions remain the same.
11259
- * * `'address'`: The range's *address* or *dimensions* have changed. This
11260
- * occurs due to row/column insertions, deletions, or move operations — and, for a
11261
- * sheet-qualified range (one from {@link IWorkbook.getRange}, or a sheet's range naming
11262
- * another sheet), when the sheet it names is renamed. A bare range on its own sheet has no
11263
- * qualifier, so a rename is not a change to it.
11264
- * * `'restore'`: The range has been restored to a different revision
11265
- * (undo/redo). The 'restore' trigger is not available for transactional listeners.
11681
+ * * `'data'`: Cells within the range changed: written, recalculated, or undone. The range's
11682
+ * address and extent are as they were. {@link getCommit} is `null` for a recalculation,
11683
+ * which belongs to no commit; {@link isUndo} tells an undo from a write.
11684
+ * * `'address'`: The range's address or extent changed: rows or columns inserted or deleted,
11685
+ * cells moved, its cells deleted (the source spells `#REF!`), or, for a sheet-qualified
11686
+ * range (one from {@link IWorkbook.getRange}, or a sheet's range naming another sheet), a
11687
+ * rename of the sheet it names. A bare range on its own sheet has no qualifier, so a rename
11688
+ * is not a change to it. A listener anchored {@link IAnchored.Type.Absolute} never moves and
11689
+ * never has one.
11690
+ * * `'restore'`: The workbook was restored to a revision from before the listener was added,
11691
+ * so the range is not in it (the source spells `#N/A`). Never delivered to a transactional
11692
+ * listener.
11266
11693
  */
11267
- readonly trigger2?: 'data' | 'address' | 'restore';
11268
- readonly trigger: string;
11694
+ getTrigger(): Event.Trigger;
11269
11695
  /**
11270
- * Indicates if the event is being fired from an undo event.
11696
+ * `true` when the change is an undo. A redo is not an undo: it is told as the forward change
11697
+ * was.
11271
11698
  */
11272
- readonly isUndo?: boolean;
11699
+ isUndo(): boolean;
11273
11700
  /**
11274
- * Returns the transaction Id if the event is occurring in a transaction otherwise `null`.
11701
+ * The commit that made the change, or `null` when none did: a recalculation landing.
11275
11702
  *
11276
- * @see
11277
- * {@link ListenerOptions.getTransactionId}
11703
+ * @remarks
11704
+ * A transactional listener is told before the commit is sealed, so this is the commit it is
11705
+ * writing into ({@link ListenerOptions.transactional}).
11278
11706
  */
11279
- getTransactionId(): string | null;
11707
+ getCommit(): ITransaction.ICommit | null;
11280
11708
  /**
11281
- * Indicates if the event is being fired due to a cell value change.
11282
- *
11283
- * @see
11284
- * {@link ListenerOptions.ignoreDataChanges}
11709
+ * The trigger and the source, for logging.
11285
11710
  */
11286
- readonly isDataChange?: boolean;
11711
+ toString(): string;
11287
11712
  /**
11288
- * To string the event.
11713
+ * When the event was made, in milliseconds since the epoch.
11289
11714
  */
11290
- toString(): string;
11715
+ getTimeStamp(): number;
11716
+ }
11717
+ namespace Event {
11291
11718
  /**
11292
- * The timestamp of the event.
11719
+ * What happened to a listened range. See {@link ICellRange.Event.getTrigger}.
11293
11720
  */
11294
- readonly timeStamp: number;
11721
+ type Trigger = 'data' | 'address' | 'restore';
11295
11722
  }
11296
11723
  /**
11297
- * Represents a listen for a range. The listener will be called when the range's
11298
- * data, address, or restore state changes, subject to the provided options.
11724
+ * Called with what changed at a listened range. See {@link ICellRange.addListener}.
11299
11725
  *
11300
- * @remarks
11301
- * If the range is deleted (rows/columns removed), the trigger will be `'address'`
11302
- * `trigger` of `'address'` and `getRange().getError()`
11303
- * returning `"#REF!"`.
11726
+ * @typeParam S The source the listener registered on; see {@link ICellRange.Event}.
11304
11727
  *
11305
- * If the ranges is restored to a revision *before* the listener was
11306
- * added, the listener will receive event with a `trigger` of `'restore'`
11307
- * and `getRange().getError()` returning `"#N/A"`.
11728
+ * @remarks
11729
+ * Read the range from {@link Event.getSource}, which is where the listened cells are now. It is
11730
+ * invalid ({@link ICellRange.isInvalid}) when the cells were deleted (`#REF!`) or the workbook
11731
+ * was restored to a revision from before the listener was added (`#N/A`); the listener stays
11732
+ * registered through both, and hears the range come back.
11308
11733
  */
11309
- interface Listener {
11310
- (event: ICellRange.Event): void;
11734
+ interface Listener<S extends ICellRange | ICellRanges = ICellRange> {
11735
+ (event: ICellRange.Event<S>): void;
11311
11736
  }
11312
11737
  /**
11313
11738
  * Receives a watch's results — one value per cell of the watched range, read with LOCAL
@@ -11353,11 +11778,28 @@ declare global {
11353
11778
  /**
11354
11779
  * If `true`, the listener will *not* be called when the range's
11355
11780
  * address changes (due to row/column insert/delete, moves, or a rename of
11356
- * the sheet a qualified range names)
11781
+ * the sheet a qualified range names). The range still follows its cells; see {@link anchor}
11782
+ * for a range that should not.
11357
11783
  *
11358
11784
  * @defaultValue false
11359
11785
  */
11360
11786
  ignoreAddressChanges?: boolean;
11787
+ /**
11788
+ * How the listened range follows rows and columns inserted or deleted around it.
11789
+ *
11790
+ * @defaultValue {@link IAnchored.Type.TwoCell}
11791
+ *
11792
+ * @remarks
11793
+ * * `TwoCell`: the range follows its cells, as a formula reference does. An insert above it
11794
+ * moves it down, a delete inside it shrinks it, and deleting all of its cells makes it
11795
+ * `#REF!`. Each move is an `'address'` event.
11796
+ * * `OneCell`: the top-left follows its cell and the extent is kept, as a picture anchored to
11797
+ * one cell. Deleting the top-left cell leaves the range where it is.
11798
+ * * `Absolute`: the range never moves. It names the same addresses whatever is inserted or
11799
+ * deleted, so it never has an `'address'` event. This is what a view listening to the rows
11800
+ * it shows wants: the cells on screen, not the cells that were there when it subscribed.
11801
+ */
11802
+ anchor?: IAnchored.Type;
11361
11803
  /**
11362
11804
  * Whether the listener takes part in the operations that change its range.
11363
11805
  *
@@ -11485,14 +11927,15 @@ declare global {
11485
11927
  * This is Excel's `Ctrl+Enter` fill: the same scalar is written to all selected cells — across every
11486
11928
  * discontiguous range — as a single {@link ICellRanges.doBatch} operation (one undo step). A formula
11487
11929
  * string (e.g. `"=A1+1"`) is coerced and its relative references adjust per cell, exactly as
11488
- * {@link ICellRange.setValue} does within one range.
11930
+ * {@link ICellRange.setValue} does within one range. It takes what that does: a `Date`, or a rich
11931
+ * value's JSON (`{ type, data }`), which each cell makes into its own value.
11489
11932
  *
11490
11933
  * Only the scalar-broadcast form exists (no `setValues`): a 2D shape has no coherent meaning spread
11491
11934
  * across discontiguous ranges of differing sizes.
11492
11935
  * @see
11493
11936
  * {@link ICellRange.setValue}
11494
11937
  */
11495
- setValue(value: ICellRange.ScalarUpdate, options?: ICellRange.SetValuesOptions): this;
11938
+ setValue(value: ICellRange.InteropScalarUpdate, options?: ICellRange.SetValuesOptions): this;
11496
11939
  /**
11497
11940
  * {@inheritDoc ICellRange.merge}
11498
11941
  */
@@ -11748,7 +12191,7 @@ declare global {
11748
12191
  /**
11749
12192
  * {@inheritDoc ICellRange.addListener}
11750
12193
  */
11751
- addListener(listener: ICellRange.Listener, options?: ICellRange.ListenerOptions): IListener.Remove;
12194
+ addListener(listener: ICellRange.Listener<ICellRanges>, options?: ICellRange.ListenerOptions): IListener.Remove;
11752
12195
  /**
11753
12196
  * {@link ICellRange.addWatch} across every area, as ONE expression authored at a shared origin.
11754
12197
  *
@@ -12095,6 +12538,10 @@ declare global {
12095
12538
  /**
12096
12539
  * Measure the text using the styling properties
12097
12540
  *
12541
+ * @remarks
12542
+ * The vertical metrics are a cell's line: `lineHeight` is the height of a row sized to one
12543
+ * line of this text, which leaves room around the font's ascent and descent as Excel does.
12544
+ *
12098
12545
  * @param text The text to measure.
12099
12546
  * @param size Size @defaultValue 'to the cell font.size'
12100
12547
  * @param family Family @defaultValue 'to the cell font.family'
@@ -16753,8 +17200,8 @@ declare global {
16753
17200
  /**
16754
17201
  * The text a cell SHOWS: under a filter the displayed text, so `$1` is a cell holding 1 under
16755
17202
  * `$0`; under a format or a validation, where nothing is shown at evaluation, the value's own
16756
- * text. Type text. Excel's filter `equal` and its values list compare this way
16757
- * (DESIGN-FILTER §3.2, MODEL-CONDITIONS §4); `equalTo` under no selector is value equality.
17203
+ * text. Type text. Excel's filter `equal` and its values list compare this way;
17204
+ * `equalTo` under no selector is value equality.
16758
17205
  */
16759
17206
  readonly Display: "display";
16760
17207
  readonly Number: "number";
@@ -18371,120 +18818,6 @@ declare global {
18371
18818
  }
18372
18819
  }
18373
18820
 
18374
- /**
18375
- * A what-if data table (Excel's **What-If Analysis > Data Table**): a block of result cells, each
18376
- * the table's formula evaluated with its row and column values put in the input cells.
18377
- *
18378
- * @remarks
18379
- * The table is carried, not calculated: its results are the values the file held, and nothing
18380
- * recalculates them. Excel recalculates it when it opens the file (when the calculation mode and
18381
- * {@link IDataTable.JSON.calculateAlways} allow).
18382
- *
18383
- * The anchor is the result cells; the formula, the row values above them and the column values to
18384
- * their left are ordinary cells. As in Excel, an edit to part of the results is refused, and one
18385
- * that clears or deletes all of them deletes the table.
18386
- */
18387
- export interface IDataTable extends IAnchored {
18388
- toJSON(): IDataTable.JSON | null;
18389
- /**
18390
- * Returns the result cells.
18391
- *
18392
- * @remarks
18393
- * An insert or delete before them moves them, one taking all of them deletes the table
18394
- * ({@link IAnchored.isDeleted}), and one that would move part of them is refused.
18395
- */
18396
- getRange(options?: ICellRange.GetRangeOptions): ICellRange;
18397
- /**
18398
- * Returns the input cell the row values are put in, as an A1 address on this sheet, or `null`
18399
- * when the table has none (a one-input table down a column).
18400
- *
18401
- * @remarks
18402
- * Follows the cell through inserts, deletes and moves. Once the cell is deleted this is the last
18403
- * address it had, and {@link isRowInputDeleted} is `true`.
18404
- */
18405
- getRowInput(): string | null;
18406
- /**
18407
- * Returns the input cell the column values are put in, as an A1 address on this sheet, or `null`
18408
- * when the table has none (a one-input table along a row).
18409
- *
18410
- * @remarks
18411
- * Follows the cell as {@link getRowInput} does.
18412
- */
18413
- getColumnInput(): string | null;
18414
- /**
18415
- * Returns whether the row input cell was deleted. The table's results are then `#REF!` in Excel.
18416
- */
18417
- isRowInputDeleted(): boolean;
18418
- /**
18419
- * Returns whether the column input cell was deleted.
18420
- */
18421
- isColumnInputDeleted(): boolean;
18422
- /** For runtime type checking. */
18423
- readonly isIDataTable: true;
18424
- }
18425
-
18426
- export namespace IDataTable {
18427
- /**
18428
- * JSON representation of a data table.
18429
- *
18430
- * @remarks
18431
- * A table has a row input, a column input, or both (a two-input table).
18432
- */
18433
- interface JSON {
18434
- /**
18435
- * The result cells, as an A1 range.
18436
- */
18437
- ref: string;
18438
- /**
18439
- * The input cell the row values are put in, as an A1 address on the same sheet.
18440
- */
18441
- rowInput?: string;
18442
- /**
18443
- * The input cell the column values are put in, as an A1 address on the same sheet.
18444
- */
18445
- columnInput?: string;
18446
- /**
18447
- * Whether the row input cell was deleted; {@link rowInput} is then its last address.
18448
- */
18449
- rowInputDeleted?: boolean;
18450
- /**
18451
- * Whether the column input cell was deleted; {@link columnInput} is then its last address.
18452
- */
18453
- columnInputDeleted?: boolean;
18454
- /**
18455
- * Whether Excel recalculates the table when it opens the file. Without it, Excel shows the
18456
- * results as saved until something recalculates the table.
18457
- *
18458
- * @remarks
18459
- * Kept as read until the workbook's cell data is edited, on any sheet. Then it is set on every
18460
- * table, because nothing here recalculates the results and they may no longer be right. It stays
18461
- * set when the edit is undone.
18462
- */
18463
- calculateAlways?: boolean;
18464
- }
18465
- /**
18466
- * `Events` for {@link IDataTable}.
18467
- */
18468
- interface Events extends IAnchored.Events<IDataTable> {
18469
- }
18470
- }
18471
-
18472
- /**
18473
- * Holds a sheet's {@link IDataTable | data tables}.
18474
- *
18475
- * @remarks
18476
- * Read-only for now: a table is carried as it was read and written back. Creating one and
18477
- * calculating it wait on the engine evaluating `TABLE`.
18478
- */
18479
- export interface IDataTableCollection extends ICollection<IDataTable> {
18480
- /**
18481
- * Returns the data tables, in the order they were read.
18482
- */
18483
- getItems(options?: ICollection.GetItemsOptions): IDataTable[];
18484
- /** For runtime type checking. */
18485
- readonly isIDataTableCollection: true;
18486
- }
18487
-
18488
18821
  /**
18489
18822
  * A data validation: a rule that a cell's value must satisfy, over one or more ranges of a sheet,
18490
18823
  * with the prompt shown when the cell is selected and the alert for a value that fails.
@@ -19641,8 +19974,7 @@ declare global {
19641
19974
  *
19642
19975
  * @remarks
19643
19976
  * Excel's external link is not a live reference — it is the cache plus enough to go re-fetch the
19644
- * source. See the design doc for the full model:
19645
- * `private-assets/design/calc/DESIGN-EXTERNAL-LINKS.md`.
19977
+ * source.
19646
19978
  *
19647
19979
  * Two members read as "which book is this", and they answer different questions:
19648
19980
  *
@@ -19702,8 +20034,8 @@ declare global {
19702
20034
  *
19703
20035
  * @remarks
19704
20036
  * **Sparse.** A cell the cache does not hold — and a sheet it holds nothing for — reads as a
19705
- * BLANK cell, which is what Excel computes with the source closed (design doc §6 items 1/2).
19706
- * Values only — no format, no style, no comment; a cached date is a plain serial (§2.5).
20037
+ * BLANK cell, which is what Excel computes with the source closed. Values only — no format, no
20038
+ * style, no comment; a cached date is a plain serial.
19707
20039
  *
19708
20040
  * @param sheetIndex Position in {@link getSheetNames}, matching the XML's `sheetId` (0-based).
19709
20041
  */
@@ -19725,8 +20057,8 @@ declare global {
19725
20057
  * (`[Budget.xlsx]Sheet1`) once a resolver holds it.
19726
20058
  *
19727
20059
  * @remarks
19728
- * A readout of the book's state, not a preference — see DESIGN-EXTERNAL-LINKS §4B. Until phase E
19729
- * there is no resolver, so this is always the closed form. The caller quotes it.
20060
+ * A readout of the book's state, not a preference: without a resolver this is always the closed
20061
+ * form. The caller quotes it.
19730
20062
  *
19731
20063
  * @param sheetName Omitted for the book-scoped `[1]!Name` form.
19732
20064
  */
@@ -19771,8 +20103,8 @@ declare global {
19771
20103
  * @remarks
19772
20104
  * Needs a resolver (`ICellContainerOptions.externalBookResolver`, given when the workbook is
19773
20105
  * built); without one every book is `'unavailable'` and nothing changes, which is the state a
19774
- * workbook is in until a host supplies one (DESIGN-EXTERNAL-LINKS §4D). A replaced cache is one undoable step, and every formula
19775
- * citing the book reads the new values. A resolver that throws leaves the cache as it was and
20106
+ * workbook is in until a host supplies one. A replaced cache is one undoable step, and every
20107
+ * formula citing the book reads the new values. A resolver that throws leaves the cache as it was and
19776
20108
  * marks each cached sheet `refreshError`, as Excel records a refresh it could not complete.
19777
20109
  */
19778
20110
  refresh(): Promise<IExternalBook.RefreshResult>;
@@ -19802,8 +20134,8 @@ declare global {
19802
20134
  * the book is opened from, `absoluteUrl` its 2021 cloud-URL companion.
19803
20135
  *
19804
20136
  * @remarks
19805
- * Not derivable from {@link type} — the two can carry the SAME relationship type (measured on
19806
- * task 40234, where a relative and an absolute `externalLinkPath` sit on one part). Absent for
20137
+ * Not derivable from {@link type} — the two can carry the SAME relationship type (a relative
20138
+ * and an absolute `externalLinkPath` can sit on one part). Absent for
19807
20139
  * an entry nothing points at, which is a real shape too: an `xlPathMissing` or
19808
20140
  * `externalLinkLongPath` rel rides along on the part without being referenced from it.
19809
20141
  */
@@ -19842,10 +20174,10 @@ declare global {
19842
20174
  * Opens a book's source and answers its current contents, or declines.
19843
20175
  *
19844
20176
  * @remarks
19845
- * DESIGN-EXTERNAL-LINKS §4D: the default one (phase E) is `WorkbookIO.read` with
20177
+ * A resolver for a workbook file should read it with `WorkbookIO.read` and
19846
20178
  * `calcOnLoad: 'none'`, taking the source's own cached values and never evaluating it — that is
19847
- * what Excel's cache holds, and it keeps A-cites-B-cites-C from becoming a crawl. An extension
19848
- * point for a source that is not a workbook file. WHETHER a source may be opened at all — an
20179
+ * what Excel's cache holds, and it keeps A-cites-B-cites-C from becoming a crawl. A source that
20180
+ * is not a workbook file can be resolved too. WHETHER a source may be opened at all — an
19849
20181
  * untrusted file naming an arbitrary path or URL — is the host's decision, made before this is
19850
20182
  * asked; a resolver never fetches on its own initiative, only on {@link IExternalBook.refresh}.
19851
20183
  */
@@ -19861,11 +20193,11 @@ declare global {
19861
20193
  /** `<sheetData refreshError="1">` — Excel could not refresh this sheet's cache last time it tried. */
19862
20194
  refreshError?: boolean;
19863
20195
  /**
19864
- * Sparse cell values — the same encoding `IWorksheet.JSON.data` uses (`ICell.JSON` is already just
20196
+ * Sparse cell values — the same encoding `IWorksheet.JSON.data` uses (`Scalar.JSON` is already just
19865
20197
  * the value+type pair; style/formula live in sibling fields there, none of which apply to a
19866
- * values-only cache — design doc §2.5).
20198
+ * values-only cache).
19867
20199
  */
19868
- data: Tuple.GridTuple<ICell.JSON>;
20200
+ data: Tuple.GridTuple<Scalar.JSON>;
19869
20201
  }
19870
20202
  interface JSON {
19871
20203
  /**
@@ -19980,6 +20312,55 @@ declare global {
19980
20312
  }
19981
20313
  }
19982
20314
 
20315
+ /**
20316
+ * How a workbook reaches what lives outside it: the picture an `IMAGE` names, a web service's
20317
+ * answer. A handler per URL scheme; a host registers its own to add authentication, or to serve a
20318
+ * scheme of its own.
20319
+ *
20320
+ * @remarks
20321
+ * Each workbook has one, given as `IWorkbook.ConstructorOptions.fetcher`, or a default that
20322
+ * answers `http:` and `https:` with the global `fetch`.
20323
+ *
20324
+ * @example
20325
+ * ```typescript
20326
+ * const fetcher = new Fetcher();
20327
+ * fetcher.register('https', (url, init) => fetch(url, {
20328
+ * ...init,
20329
+ * headers: { ...init?.headers, Authorization: `Bearer ${token}` }
20330
+ * }));
20331
+ * const workbook = new Workbook({ fetcher });
20332
+ * ```
20333
+ */
20334
+ export interface IFetcher {
20335
+ /**
20336
+ * Fetches `input` with the handler registered for its scheme. A URL without a scheme goes to
20337
+ * the `https` handler.
20338
+ *
20339
+ * @returns The response; rejects with a `TypeError` when no handler serves the scheme, as
20340
+ * `fetch` does for a URL it cannot reach. In a browser the default handlers reject with a
20341
+ * `FormulaError.Blocked` when the site responded but does not allow web pages to read it.
20342
+ */
20343
+ fetch(input: string, init?: RequestInit): Promise<Response>;
20344
+ /**
20345
+ * Serves a URL scheme with `handler`, replacing the handler it had.
20346
+ *
20347
+ * @param scheme The scheme, with or without its colon: `'https'`, `'resource:'`.
20348
+ * @returns A function that removes the registration.
20349
+ */
20350
+ register(scheme: string, handler: IFetcher.Handler): () => void;
20351
+ /**
20352
+ * For runtime type checking.
20353
+ */
20354
+ readonly isIFetcher: true;
20355
+ }
20356
+
20357
+ export namespace IFetcher {
20358
+ /**
20359
+ * Answers a fetch for one scheme, with the signature of the standard `fetch`.
20360
+ */
20361
+ type Handler = (url: string, init?: RequestInit) => Promise<Response>;
20362
+ }
20363
+
19983
20364
  /**
19984
20365
  * Defines how an area or shape is filled with color or a pattern.
19985
20366
  */
@@ -21098,9 +21479,8 @@ declare global {
21098
21479
  readonly strikeThickness?: number;
21099
21480
  readonly italicAngle?: number;
21100
21481
  /**
21101
- * The line pitch in px — what a line of this font advances by, and the height of a row sized
21102
- * to it: `ascent + descent + 2` (Excel's standard row height for the font; the 2 is the
21103
- * gridline gutter above and below the font box). Includes {@link lineGap}.
21482
+ * The line pitch in px — what a line of this text advances by: {@link ascent} plus
21483
+ * {@link descent} plus {@link lineGap}.
21104
21484
  */
21105
21485
  readonly lineHeight: number;
21106
21486
  /**
@@ -21108,6 +21488,7 @@ declare global {
21108
21488
  * paints the line as a box (a CSS line box) puts the alphabetic baseline.
21109
21489
  */
21110
21490
  readonly baseline: number;
21491
+ /** The leading in px: the room in {@link lineHeight} beyond the ascent and descent. */
21111
21492
  readonly lineGap: number;
21112
21493
  /**
21113
21494
  * The font's ascent above the baseline in whole px at the measured size — GDI's `tmAscent`,
@@ -21123,9 +21504,8 @@ declare global {
21123
21504
  *
21124
21505
  * @remarks
21125
21506
  * Advances are per em and vertical metrics follow GDI, so a table measures as Excel does: a
21126
- * shipped face measures GDI's hinted whole pixels and sizes rows as Excel autofits them. Tables
21127
- * are built by the collection from the shipped files or the platform; they are read here, never
21128
- * made or changed.
21507
+ * shipped face measures GDI's hinted whole pixels. Tables are built by the collection from the
21508
+ * shipped files or the platform; they are read here, never made or changed.
21129
21509
  */
21130
21510
  interface AdvanceTable {
21131
21511
  /** The family the table measures, as a style names it. */
@@ -21135,8 +21515,12 @@ declare global {
21135
21515
  readonly italic: boolean;
21136
21516
  /** Whether widths are GDI's hinted whole pixels. */
21137
21517
  readonly isHinted: boolean;
21138
- /** Whether row heights are Excel's own captured ones. */
21139
- readonly hasRows: boolean;
21518
+ /**
21519
+ * The height of a line per em by the font's typo metrics (ascent less descent plus line gap),
21520
+ * for a font that asks for them; `null` otherwise. DirectWrite lays a line out this tall, so
21521
+ * Excel's charts do.
21522
+ */
21523
+ readonly typoLine: number | null;
21140
21524
  /** The number of characters with an advance. */
21141
21525
  readonly size: number;
21142
21526
  /** The advance of `codepoint` per em, or `undefined` when the table has none. */
@@ -21148,7 +21532,10 @@ declare global {
21148
21532
  * super/subscript scale, then `letterSpacing` between characters.
21149
21533
  */
21150
21534
  width(text: string, px: number, options?: AdvanceTable.WidthOptions): number;
21151
- /** The face's whole-px vertical metrics at `px` pixels per em. */
21535
+ /**
21536
+ * The face's whole-px vertical metrics at `px` pixels per em: GDI's ascent and descent, and a
21537
+ * line as tall as the font's own metrics ask.
21538
+ */
21152
21539
  metrics(px: number): Metrics;
21153
21540
  /**
21154
21541
  * The underline at `px`: its center's offset above the baseline (negative below) and its
@@ -21277,6 +21664,23 @@ declare global {
21277
21664
  * ```
21278
21665
  */
21279
21666
  function captureTables(bytes: Uint8Array, options?: CaptureOptions): Promise<CapturedFace[]>;
21667
+ /**
21668
+ * The CSS `font-family` value that paints `family`: the family, then the fonts that stand in for
21669
+ * it where it is not installed, then `fallbacks`, each followed by its own stand-ins.
21670
+ *
21671
+ * A stand-in is the family `family` is measured by and that family's open metric-compatible
21672
+ * twins, so text painted on a machine without the original still fits its measurement.
21673
+ *
21674
+ * @param family The family as a style names it.
21675
+ * @param fallbacks Families or CSS generic names to try after it.
21676
+ *
21677
+ * @example
21678
+ * ```ts
21679
+ * IFont.toCSSFontFamily('Calibri', ['sans-serif']); // 'Calibri, Carlito, sans-serif'
21680
+ * IFont.toCSSFontFamily('Aptos Narrow', ['sans-serif']); // '"Aptos Narrow", "Intos Narrow", Calibri, Carlito, sans-serif'
21681
+ * ```
21682
+ */
21683
+ function toCSSFontFamily(family: string, fallbacks?: readonly string[] | null): string;
21280
21684
  /**
21281
21685
  * Provides a font-family fallback based on the PANOSE hex string.
21282
21686
  *
@@ -21875,6 +22279,7 @@ declare global {
21875
22279
  * | Category | Key methods |
21876
22280
  * |---|---|
21877
22281
  * | Evaluation lifecycle | `markVolatile`, `getRow`, `getColumn`, `getEntireCoords`, `getRandom` |
22282
+ * | Answering later | `defer` |
21878
22283
  * | Argument reflection | `getArgs` |
21879
22284
  * | Output hints | `formatResults` |
21880
22285
  * | Range construction | `createRange`, `flattenAreas`, `filterHidden` |
@@ -21911,8 +22316,8 @@ declare global {
21911
22316
  * A union `(A1:A5,B1:B2)` reaches a {@link IFunction.ParameterTypeJSON.reportType} slot as one
21912
22317
  * `IRange` per area. Functions that answer over it do so because they walk MEMBERS and a union
21913
22318
  * simply has more of them — `LARGE((DA1:DA5,DK1:DK2),2)` is the second largest of all seven
21914
- * cells. This is that walk, and it is a helper rather than a marshalling step on purpose: Excel
21915
- * flattens in exactly the same place, a shared reducer its bodies opt into, which is why the
22319
+ * cells. This is that walk, and it is a helper rather than a marshalling step on purpose:
22320
+ * flattening is a shared reducer the bodies opt into, which is why the
21916
22321
  * same union is flattened by `LARGE`, refused by `SUMPRODUCT` and answered `#REF!` by `ROWS`.
21917
22322
  *
21918
22323
  * The result is a single column in area order, row-major within each area. SHAPE IS NOT
@@ -21961,7 +22366,7 @@ declare global {
21961
22366
  */
21962
22367
  getColumn(): number;
21963
22368
  /**
21964
- * Whether the call being evaluated is in Excel's VALUE mode, where a multi-cell reference at a
22369
+ * Whether the call being evaluated is in VALUE mode, where a multi-cell reference at a
21965
22370
  * slot that reads ONE value is implicitly intersected with the formula's cell (the `@` rule);
21966
22371
  * `false` is ARRAY mode, where such a slot reads the reference's first cell.
21967
22372
  *
@@ -22000,7 +22405,7 @@ declare global {
22000
22405
  * A few arguments honor only their top-left corner and are re-sized to the shape of the range
22001
22406
  * that drives them — `SUMIF`'s `sum_range`, `LOOKUP`'s `result_vector`. The window can therefore
22002
22407
  * run off the bottom or right of the grid: `SUMIF(A1:A5,">0",A1048574)` asks for five rows
22003
- * starting three from the end. Excel reads the part that fits and treats the rest as blank, which
22408
+ * starting three from the end. The part that fits is read and the rest is blank, which
22004
22409
  * is what this returns; positions past the clamp read as `undefined` from `getValueAt`.
22005
22410
  *
22006
22411
  * @param anchor The coords of the argument as written; only its top-left corner is honored.
@@ -22404,12 +22809,11 @@ declare global {
22404
22809
  * want the raw carry above — `DATEDIF("2020-01-31","2020-03-01","md")` is `-1`
22405
22810
  * because Jan 31 rolls into March. `EDATE`/`EOMONTH` want the opposite and CLAMP to
22406
22811
  * the target month's length, so they pre-clamp before calling here. One conversion,
22407
- * two opposite rules, both matching Excel. Baking either one in breaks the other.
22812
+ * two opposite rules. Baking either one in breaks the other.
22408
22813
  * * **Results may legitimately leave the calendar.** `YEARFRAC` basis 1 anchors a year
22409
22814
  * length on January 1 of `laterYear + 1`, which at the top of the calendar is
22410
- * `10000-01-01`; Excel answers `1.9972602739726026` for
22411
- * `YEARFRAC(DATE(9998,1,1),DATE(9999,12,31),1)` rather than `#NUM!`. A range check
22412
- * here would break it.
22815
+ * `10000-01-01`; `YEARFRAC(DATE(9998,1,1),DATE(9999,12,31),1)` is
22816
+ * `1.9972602739726026`, not `#NUM!`. A range check here would break it.
22413
22817
  * * **The 16-bit argument limits are per-function.** `DATE`'s month errors outside
22414
22818
  * `[-32767, 32766]` while its day saturates to `32767`, and `TIME` errors outside
22415
22819
  * `[0, 32767]` on every argument — same magic number, three different rules.
@@ -22417,8 +22821,8 @@ declare global {
22417
22821
  * Note the asymmetry with {@link getDateParts}, which DOES throw `#NUM!` outside the
22418
22822
  * calendar because it answers a user-facing question. An internal intermediate that
22419
22823
  * steps one day past the end must therefore not be round-tripped through it; compute
22420
- * on the fields instead. That mistake made `YEARFRAC(DATE(9999,1,1),DATE(9999,12,31),0)`
22421
- * `#NUM!` where Excel says `1`.
22824
+ * on the fields instead, or `YEARFRAC(DATE(9999,1,1),DATE(9999,12,31),0)` becomes `#NUM!`
22825
+ * rather than `1`.
22422
22826
  */
22423
22827
  getSerialDate(year: number, month: number, day: number, hour?: number, minute?: number, second?: number, millis?: number): number;
22424
22828
  /**
@@ -22434,8 +22838,8 @@ declare global {
22434
22838
  *
22435
22839
  * @remarks
22436
22840
  * Argument REFLECTION, for the one thing a declaration cannot say: what happened at *this* call.
22437
- * It exists to serve Excel's declared `any`, which means "no contract, the body decides" — every
22438
- * other Excel type maps onto a type we already have and the marshaller handles it.
22841
+ * It exists to serve a declared `any`, which means "no contract, the body decides" — every
22842
+ * other declared type maps onto a type we already have and the marshaller handles it.
22439
22843
  *
22440
22844
  * The returned view is valid ONLY while the body that asked for it is running. Views are pooled
22441
22845
  * by dispatch depth, so retaining one across an `await`, a callback, or a nested evaluation hands
@@ -22444,6 +22848,65 @@ declare global {
22444
22848
  * @throws If called outside a function dispatch — there are no arguments to reflect on.
22445
22849
  */
22446
22850
  getArgs(): IFunctionArguments;
22851
+ /**
22852
+ * Answers this call later: hands `executor` a call to settle, and leaves the cell showing what
22853
+ * the function returns now.
22854
+ *
22855
+ * @param executor Runs once at the end of the recalculation with every call made against it.
22856
+ * Pass a module-level function by name: calls join one batch when they name the same function.
22857
+ * @param payload Everything the executor needs to answer this call, and how a later evaluation
22858
+ * recognizes it: while the call is still waiting, a recalculation with
22859
+ * an equal payload leaves it be rather than asking again. Once it has stopped, a recalculation
22860
+ * calls the function again; what it fetched is answered from the workbook's cache
22861
+ * (`IDeferContext.fetch`).
22862
+ * @returns The last answer this call gave for the same question, when the function is being
22863
+ * called again (a recalculation); `undefined` on a first call or a changed question. Return it
22864
+ * to keep showing it until the new answer arrives, or return something else to show that the
22865
+ * cell is waiting.
22866
+ *
22867
+ * @remarks
22868
+ * The function still returns a value: what this call answers until its result arrives (nothing
22869
+ * returned reads as blank), and it is what every formula over the cell calculates
22870
+ * from meanwhile: return `#BUSY!` when they should wait as an error, or text such as
22871
+ * `'Fetching…'` when that is what they should show.
22872
+ *
22873
+ * The executor runs after the recalculation, outside any cell, so the ambient `FormulaContext`
22874
+ * is not its own: it reads the workbook through `ctx.getFormulaContext()`. Whatever the body
22875
+ * knows about its cell goes in the payload.
22876
+ *
22877
+ * @example
22878
+ * ```typescript
22879
+ * function fetchAll(
22880
+ * calls: readonly IFormulaContext.DeferredCall<string>[],
22881
+ * ctx: IFormulaContext.IDeferContext
22882
+ * ): void {
22883
+ * for (const call of calls) {
22884
+ * ctx.fetch(call.payload as string)
22885
+ * .then((response) => response.text())
22886
+ * .then((text) => call.resolve(text), (error) => call.reject(error));
22887
+ * }
22888
+ * }
22889
+ *
22890
+ * export function FETCHTEXT(url: string): string {
22891
+ * FormulaContext.defer(fetchAll, url);
22892
+ * return 'Fetching…';
22893
+ * }
22894
+ * ```
22895
+ */
22896
+ defer(executor: IFormulaContext.DeferExecutor, payload?: unknown): unknown;
22897
+ /**
22898
+ * A rich value of a registered type, made from its data as the type's JSON holds it, for the
22899
+ * workbook being calculated.
22900
+ *
22901
+ * @param type The name of the value's kind (`'hyperlink'`): what its `getKind().getName()`
22902
+ * will answer.
22903
+ * @param data The value's data, as its JSON's `data`.
22904
+ *
22905
+ * @remarks
22906
+ * A type nobody has registered still makes a value: one that carries the data and reads as
22907
+ * nothing.
22908
+ */
22909
+ createRichData(type: string, data?: any): IRichData;
22447
22910
  }
22448
22911
 
22449
22912
  /**
@@ -22470,7 +22933,7 @@ declare global {
22470
22933
  * then `range` is returned as it is, hidden rows included.
22471
22934
  *
22472
22935
  * @remarks
22473
- * This is `SUBTOTAL` 1-11 (Excel: they "include manually hidden rows", which is what an
22936
+ * This is `SUBTOTAL` 1-11 (they include manually hidden rows, which is what an
22474
22937
  * unfiltered sheet reads as). `SUBTOTAL` 101-111 and `AGGREGATE` leave it off and skip
22475
22938
  * always.
22476
22939
  * @defaultValue false
@@ -22595,6 +23058,151 @@ declare global {
22595
23058
  */
22596
23059
  readonly dow: number;
22597
23060
  }
23061
+ /**
23062
+ * Answers the calls made by {@link IFormulaContext.defer} against it. Invoked once at the end of
23063
+ * a recalculation with every such call; how many requests that becomes is the executor's choice.
23064
+ */
23065
+ type DeferExecutor<T = any> = (calls: readonly DeferredCall<T>[], ctx: IDeferContext) => void | Promise<void>;
23066
+ /**
23067
+ * One call made by {@link IFormulaContext.defer}, as its executor receives it.
23068
+ *
23069
+ * @remarks
23070
+ * Settle each call itself, never by its position in a response. An executor that returns a
23071
+ * promise which rejects fails every call it has not settled.
23072
+ */
23073
+ interface DeferredCall<T = any> {
23074
+ /** What the function passed to `defer`. */
23075
+ readonly payload: unknown;
23076
+ /** Settles the call with its result. */
23077
+ resolve(value: T, options?: DeferredCall.ResolveOptions): void;
23078
+ /** Settles the call with an error: a `FormulaError` as itself, anything else as `#VALUE!`. */
23079
+ reject(error: unknown): void;
23080
+ /** Runs `fn` when the result is no longer wanted. */
23081
+ onCancel(fn: () => void): void;
23082
+ /**
23083
+ * Whether the result is no longer wanted. Only an executor that holds calls to settle later
23084
+ * needs it; a result for a cancelled call is dropped.
23085
+ */
23086
+ readonly cancelled: boolean;
23087
+ }
23088
+ namespace DeferredCall {
23089
+ /**
23090
+ * Options for {@link DeferredCall.resolve}.
23091
+ */
23092
+ interface ResolveOptions {
23093
+ /**
23094
+ * Whether the blanks of an array result stay blank when it spills. Omitted, they read as
23095
+ * `0`, as any spilled array's blanks do.
23096
+ *
23097
+ * @remarks
23098
+ * For data whose empty fields mean "nothing here", such as an imported file. The result
23099
+ * keeps them while a formula passes it on as it is (`IF(c, result, …)`). A function that
23100
+ * answers element by element builds a new array, whose blanks read as `0`
23101
+ * (`IFERROR(result, …)`, `result & ""`).
23102
+ * @defaultValue false
23103
+ */
23104
+ keepBlanks?: boolean;
23105
+ }
23106
+ }
23107
+ /**
23108
+ * What an executor is given beside its calls.
23109
+ */
23110
+ interface IDeferContext {
23111
+ /** A random number in `[0, 1)` from the calculation's source, which a test can seed. */
23112
+ getRandom(): number;
23113
+ /**
23114
+ * State kept for this executor across recalculations, made by `init` on first ask. Keep data
23115
+ * here (maps, numbers, strings, buffers), not connections or sockets.
23116
+ */
23117
+ getState<S>(init: () => S): S;
23118
+ /**
23119
+ * Groups `calls` by payload and runs `answer` once per distinct payload with every call that
23120
+ * asked it: one request per question, however many cells asked.
23121
+ *
23122
+ * @param calls The calls to group, usually every call the executor was handed.
23123
+ * @param answer Settles one group. When it throws, or the promise it returns rejects, the
23124
+ * group's calls it has not settled fail with that error; the other groups are not affected.
23125
+ * @returns Resolves once every group has been answered. It never rejects.
23126
+ *
23127
+ * @remarks
23128
+ * Payloads are equal as `defer` compares them: the same primitive, or plain objects or arrays
23129
+ * whose own values are the same one level deep. Groups are answered concurrently, in the
23130
+ * order their first call appears.
23131
+ *
23132
+ * @example
23133
+ * ```typescript
23134
+ * async function fetchQuotes(
23135
+ * calls: readonly IFormulaContext.DeferredCall<number>[],
23136
+ * ctx: IFormulaContext.IDeferContext
23137
+ * ): Promise<void> {
23138
+ * await ctx.byPayload(calls, async (ticker: string, group) => {
23139
+ * const response = await ctx.fetch(`https://api.example.com/quote/${ticker}`);
23140
+ * const price: number = (await response.json()).price;
23141
+ * for (const call of group) call.resolve(price);
23142
+ * });
23143
+ * }
23144
+ * ```
23145
+ */
23146
+ byPayload<T = any, P = unknown>(calls: readonly DeferredCall<T>[], answer: (payload: P, group: readonly DeferredCall<T>[]) => void | Promise<void>): Promise<void>;
23147
+ /**
23148
+ * A rich value of a registered type, for the workbook being calculated: what
23149
+ * {@link IFormulaContext.createRichData} makes inside a cell, made here for a call's result.
23150
+ */
23151
+ createRichData(type: string, data?: any): IRichData;
23152
+ /**
23153
+ * Adds bytes to the workbook being calculated as a resource (an `IResource`), for a rich value
23154
+ * to hold: pass it in {@link createRichData}'s data. The workbook saves it while a value holds
23155
+ * it. With `fetchedFrom` it is the workbook's copy of that URL: {@link fetch} answers the URL
23156
+ * from it, and adding the same URL again answers the resource already added.
23157
+ */
23158
+ addResource(buffer: ArrayBuffer, options?: {
23159
+ fetchedFrom?: string;
23160
+ }): object;
23161
+ /**
23162
+ * Fetches through the workbook being calculated: the standard `fetch`, answered by the
23163
+ * fetchers the host registered for the URL's scheme, with the host's authentication. An
23164
+ * answer the workbook already has for the URL (a picture it keeps, or anything fetched while
23165
+ * it is open) answers from the workbook, and two calls for one URL share one request. In an
23166
+ * external calculation (*Refresh All*) it goes to the source.
23167
+ *
23168
+ * Rejects when the URL cannot be reached, with a `FormulaError.Blocked` when the site responded
23169
+ * but the browser would not let the page read it.
23170
+ */
23171
+ fetch(input: string, init?: RequestInit): Promise<Response>;
23172
+ /**
23173
+ * The formula context of the workbook being calculated, with no cell: its parsing, text,
23174
+ * comparison and dates, read with the workbook's locale and date system.
23175
+ *
23176
+ * @remarks
23177
+ * Valid for as long as the executor runs, across every `await`. The ambient `FormulaContext`
23178
+ * is not: it belongs to the cell being evaluated, and an executor runs after that evaluation
23179
+ * ends. What needs a cell (`getRow`, `getReference`, `getValueAt`, `defer`, `markVolatile`,
23180
+ * `formatResults`, `getRandom`) throws here; {@link getRandom} is the executor's own.
23181
+ */
23182
+ getFormulaContext(): IFormulaContext;
23183
+ /**
23184
+ * Reads delimited text (CSV, TSV) into rows of values, each field read the way the workbook
23185
+ * reads typed entry: numbers, dates, booleans and error labels become values, anything else
23186
+ * stays text, and an empty field is blank.
23187
+ *
23188
+ * @param text The delimited text.
23189
+ * @param options How the text is split.
23190
+ * @returns The rows, padded with blanks to the widest row.
23191
+ */
23192
+ parseText(text: string, options?: IDeferContext.ParseTextOptions): Promise<Scalar[][]>;
23193
+ }
23194
+ namespace IDeferContext {
23195
+ /**
23196
+ * Options for {@link IDeferContext.parseText}.
23197
+ */
23198
+ interface ParseTextOptions {
23199
+ /**
23200
+ * The character between fields.
23201
+ * @defaultValue `','`
23202
+ */
23203
+ delimiter?: string;
23204
+ }
23205
+ }
22598
23206
  }
22599
23207
 
22600
23208
  /**
@@ -22881,11 +23489,9 @@ declare global {
22881
23489
  getMembers(): readonly IFunction.IEnumMember[];
22882
23490
  }
22883
23491
  /**
22884
- * Describes the runtime return behavior of a function, including modifiers like
22885
- * async resolution, streaming data, or volatility.
23492
+ * Describes the runtime return behavior of a function, including modifiers like volatility.
22886
23493
  *
22887
23494
  * @remarks
22888
- * All return type modifiers are mutually exclusive.
22889
23495
  * If none are specified, The value will be returned with no special behavior.
22890
23496
  */
22891
23497
  interface IReturnType extends IValueType {
@@ -22897,26 +23503,13 @@ declare global {
22897
23503
  * @see {@link ReturnTypeJSON.kind}
22898
23504
  */
22899
23505
  getKind(): ValueKind | null;
22900
- /**
22901
- * Indicates the return value is a Promise or Promise-like (i.e., async).
22902
- * The system will mark the result as pending and re-trigger evaluation once resolved.
22903
- *
22904
- * Can be combined with any scalar, array, or range return type.
22905
- */
22906
- isAsync(): boolean;
22907
- /**
22908
- * Indicates whether the function produces a continuous stream of output (e.g., real-time data).
22909
- *
22910
- * @defaultValue `false`
22911
- */
22912
- isStreaming(): boolean;
22913
23506
  /**
22914
23507
  * True when the result can change with nothing dirty, so a cell naming this function
22915
23508
  * recalculates on every pass — the `Volatile<T>` marker.
22916
23509
  *
22917
23510
  * @remarks
22918
23511
  * STATIC, and read from the formula text at compile time: it is true of the call whether or
22919
- * not the call runs, which is what a lazy argument (and Excel) requires.
23512
+ * not the call runs, which is what a lazy argument requires.
22920
23513
  *
22921
23514
  * @see {@link ReturnTypeJSON.volatile}
22922
23515
  */
@@ -22955,7 +23548,7 @@ declare global {
22955
23548
  * @remarks
22956
23549
  * Only meaningful for a VARIADIC function; a fixed parameter list is already its own maximum.
22957
23550
  * The number is the whole CALL's argument count, prefix and optional suffix included, and it
22958
- * is refused where Excel refuses it — at entry, before evaluation.
23551
+ * is refused at entry, before evaluation.
22959
23552
  *
22960
23553
  * @see {@link Repeating}
22961
23554
  */
@@ -23257,8 +23850,8 @@ declare global {
23257
23850
  * Generated from the `NoLift<T>` marker.
23258
23851
  *
23259
23852
  * @remarks
23260
- * Per parameter, because Excel is: `NETWORKDAYS.INTL` refuses a reference at its date slots
23261
- * and lifts one at `weekend`. An ARRAY at the slot still lifts, a one-cell reference is an
23853
+ * Per parameter, because Excel's built-ins differ by slot: `NETWORKDAYS.INTL` refuses a
23854
+ * reference at its date slots and lifts one at `weekend`. An ARRAY at the slot still lifts, a one-cell reference is an
23262
23855
  * ordinary argument, and a repeating slot absorbs a container as members, so the marker only
23263
23856
  * ever applies to a non-repeating scalar parameter.
23264
23857
  */
@@ -23298,7 +23891,7 @@ declare global {
23298
23891
  * union is the range arm, handed over whole. The slot never lifts.
23299
23892
  *
23300
23893
  * @remarks
23301
- * Excel reads a one-cell argument at some array slots as THE ARGUMENT rather than as a
23894
+ * Some array slots read a one-cell argument as THE ARGUMENT rather than as a
23302
23895
  * one-cell container: `SORT(<#N/A cell>,1,1,<#DIV/0! cell>)` is `#N/A` where
23303
23896
  * `TAKE(<#N/A cell>,<#DIV/0! cell>)` is `#DIV/0!`. The engine's default
23304
23897
  * for a range slot is TAKE's; this flag is SORT's. {@link scalar} and {@link range} each carry
@@ -23335,8 +23928,7 @@ declare global {
23335
23928
  members: [name: string, value: number | string, deprecated?: string | true][];
23336
23929
  }
23337
23930
  /**
23338
- * Describes the runtime return behavior of a function, including modifiers like
23339
- * async resolution, streaming data, or volatility.
23931
+ * Describes the runtime return behavior of a function, including modifiers like volatility.
23340
23932
  *
23341
23933
  * @remarks
23342
23934
  * If none are specified, The value will be returned with no special behavior.
@@ -23360,29 +23952,15 @@ declare global {
23360
23952
  * is a scalar is its member value downstream.
23361
23953
  */
23362
23954
  kind?: ValueKind;
23363
- /**
23364
- * Indicates the return value is a Promise or Promise-like (i.e., async).
23365
- * The system will mark the result as pending and re-trigger evaluation once resolved.
23366
- *
23367
- * Can be combined with any scalar, array, or range return type.
23368
- */
23369
- async?: boolean;
23370
- /**
23371
- * Indicates whether the function produces a continuous stream of output (e.g., real-time data).
23372
- *
23373
- * @defaultValue `false`
23374
- */
23375
- stream?: boolean;
23376
23955
  /**
23377
23956
  * The result can change with nothing dirty — a cell naming this function recalculates on
23378
23957
  * every pass. Generated from the `Volatile<T>` marker.
23379
23958
  *
23380
23959
  * @remarks
23381
23960
  * Collected at COMPILE time from the formula text (`CompiledFormula.hasVolatile`), because
23382
- * that is where Excel decides it: `=IF(TRUE,1,RAND())` recalculates on every idle pass though
23961
+ * that is where volatility is decided: `=IF(TRUE,1,RAND())` recalculates on every idle pass though
23383
23962
  * no branch selects the arm, and with lazy arguments the call never happens for the engine to
23384
- * observe. Sits beside {@link async} and {@link stream} because all three are about WHEN a
23385
- * result arrives rather than what it is.
23963
+ * observe.
23386
23964
  *
23387
23965
  * @see {@link Volatile}
23388
23966
  */
@@ -23403,11 +23981,10 @@ declare global {
23403
23981
  * parameter. Omitted at the default of 255.
23404
23982
  *
23405
23983
  * @remarks
23406
- * Excel keeps one such number per NAME and compares it against the whole call's argument
23407
- * count in its front end, so a call past it is refused AT ENTRY rather than answered — which
23408
- * is why the cap lives on the declaration and not in a body. It is not derivable from the
23409
- * shape: `STDEV` takes 255 arguments and `STDEV.S`, the same function under its dotted name,
23410
- * takes 254.
23984
+ * The cap is one number per NAME, compared against the whole call's argument count, so a call
23985
+ * past it is refused AT ENTRY rather than answered — which is why the cap lives on the
23986
+ * declaration and not in a body. It is not derivable from the shape: in Excel `STDEV` takes 255
23987
+ * arguments and `STDEV.S`, the same function under its dotted name, takes 254.
23411
23988
  *
23412
23989
  * @defaultValue 255
23413
23990
  */
@@ -23544,9 +24121,8 @@ declare global {
23544
24121
  * - What was the value BEFORE the parameter's type coerced it?
23545
24122
  * - Was that empty slot an omission, or a blank cell the caller pointed at?
23546
24123
  *
23547
- * Excel has behaviors that turn on exactly those questions, and they cluster at the
23548
- * parameters Excel declares `any` — where there is nothing to express as a type, because Excel
23549
- * declined to express one. `CUMIPMT` refuses a boolean at every slot while `FV` coerces one at
24124
+ * Some functions have behaviors that turn on exactly those questions, and they cluster at
24125
+ * parameters declared `any` — where there is nothing to express as a type. `CUMIPMT` refuses a boolean at every slot while `FV` coerces one at
23550
24126
  * every slot; the difference is not the values, it is that `CUMIPMT`'s slots are `any` and its
23551
24127
  * body decides.
23552
24128
  *
@@ -23671,7 +24247,7 @@ declare global {
23671
24247
  */
23672
24248
  getKindAt(index: number): ValueKind;
23673
24249
  /**
23674
- * True when the argument at `index` is DIRECT — Excel's "typed into the list of arguments":
24250
+ * True when the argument at `index` is DIRECT — typed into the list of arguments:
23675
24251
  * the evaluated value IS a value, not a container or a callable.
23676
24252
  *
23677
24253
  * @param index The PARAMETER index — the position in the body's own signature.
@@ -24953,8 +25529,18 @@ declare global {
24953
25529
  getTarget(): string;
24954
25530
  /**
24955
25531
  * Removes the link from the cell it is attached to. The cell's text stays.
25532
+ *
25533
+ * @throws When the link is read-only ({@link isReadOnly}).
24956
25534
  */
24957
25535
  delete(options?: ITransaction.OperationOptions): void;
25536
+ /**
25537
+ * Whether the link can only be followed: it is not edited or removed as a link.
25538
+ *
25539
+ * @remarks
25540
+ * A link that is the cell's value (a `HYPERLINK()` result) is read-only; it changes with its
25541
+ * formula.
25542
+ */
25543
+ isReadOnly(): boolean;
24958
25544
  /**
24959
25545
  * For runtime type checking.
24960
25546
  */
@@ -26994,6 +27580,25 @@ declare global {
26994
27580
  * take the first.
26995
27581
  */
26996
27582
  getByRanges(ranges: ICellRanges.Address, options?: INamedCollection.GetByRangesOptions): string[];
27583
+ /**
27584
+ * Deletes the defined names nothing reads, as one operation.
27585
+ *
27586
+ * @param options `hiddenOnly` limits it to names flagged hidden; `dryRun` counts without deleting.
27587
+ * @returns How many names were deleted, or with `dryRun`, would be.
27588
+ * @throws `Error` if the names are read-only (a protected workbook structure) and this is not a dry run.
27589
+ *
27590
+ * @remarks
27591
+ * A name is read when a cell formula, a conditional format, a data validation, a chart or another
27592
+ * name refers to it — the readers `ICalculation.INamedFormula.getDependents` reports. A name
27593
+ * that a kept name's definition mentions is kept too, whether or not anything reads that one.
27594
+ * Only defined names are considered; a table is named by the table it belongs to. Excel's built-in
27595
+ * names (`_xlnm.Print_Area`, `_xlnm.Print_Titles`, `_xlnm._FilterDatabase`) are read by the sheet
27596
+ * itself, not by formulas, and are never removed.
27597
+ *
27598
+ * One operation, so one undo puts every name back. Asked of a sheet's collection
27599
+ * (`IWorksheet.getNames()`), only the names scoped to that sheet are considered.
27600
+ */
27601
+ removeUnused(options?: INamedCollection.RemoveUnusedOptions): Promise<number>;
26997
27602
  /**
26998
27603
  * Lookup a named range with a given name.
26999
27604
  *
@@ -27133,6 +27738,23 @@ declare global {
27133
27738
  */
27134
27739
  includeHidden?: boolean;
27135
27740
  }
27741
+ /**
27742
+ * Options for {@link INamedCollection.removeUnused}.
27743
+ */
27744
+ interface RemoveUnusedOptions {
27745
+ /**
27746
+ * Only names flagged hidden — the ones a user cannot see to delete.
27747
+ *
27748
+ * @defaultValue false
27749
+ */
27750
+ hiddenOnly?: boolean;
27751
+ /**
27752
+ * Count the names that would be deleted, and delete none.
27753
+ *
27754
+ * @defaultValue false
27755
+ */
27756
+ dryRun?: boolean;
27757
+ }
27136
27758
  /**
27137
27759
  * Options for {@link INamedCollection.getByRanges}.
27138
27760
  *
@@ -28665,6 +29287,51 @@ declare global {
28665
29287
  * ```
28666
29288
  */
28667
29289
  setShapeType(shapeType: IGeometry.Preset | string, options?: ITransaction.OperationOptions): this;
29290
+ /**
29291
+ * Returns the shape's outline at a size, for drawing the picture cropped to its shape.
29292
+ *
29293
+ * @param width The frame's width in pixels. Defaults to the movable's.
29294
+ * @param height The frame's height in pixels. Defaults to the movable's.
29295
+ * @returns `null` for a preset this SDK does not know, or for a picture with no movable and no size.
29296
+ */
29297
+ getGeometry(width?: number, height?: number): Promise<IGeometry | null>;
29298
+ /**
29299
+ * Returns the part of the image shown, as percentages of the image's size inset from each edge.
29300
+ *
29301
+ * @remarks
29302
+ * An edge not cropped is absent, so an uncropped picture answers `{}`. A negative inset shows empty
29303
+ * space beyond that edge of the image, which is how a picture fits inside a frame of another shape.
29304
+ */
29305
+ getCrop(): IFill.RectInsets;
29306
+ /**
29307
+ * Sets the part of the image shown. The frame stays as it is, so the part shown is stretched over
29308
+ * it; to keep the image's scale, change the frame with {@link IMovable.setBounds} as well.
29309
+ *
29310
+ * @param crop Percentages of the image's size, inset from each edge; `null` shows the whole image.
29311
+ * @throws ExpectedError when the insets leave nothing to show.
29312
+ *
29313
+ * @example
29314
+ * ```ts
29315
+ * picture.setCrop({ left: 10, right: 10 });
29316
+ * ```
29317
+ */
29318
+ setCrop(crop: IFill.RectInsets | null, options?: ITransaction.OperationOptions): this;
29319
+ /**
29320
+ * Returns the hyperlink a click on the picture follows, or `null` for none.
29321
+ */
29322
+ getHyperlink(): IHyperlink | null;
29323
+ /**
29324
+ * Sets the hyperlink a click on the picture follows.
29325
+ *
29326
+ * @param hyperlink An address, the link's properties, or `null` to remove it. An address takes the
29327
+ * form a cell's does: a url, or `#Sheet1!A1` for a location in this workbook.
29328
+ *
29329
+ * @example
29330
+ * ```ts
29331
+ * picture.setHyperlink('https://www.sheetxl.com');
29332
+ * ```
29333
+ */
29334
+ setHyperlink(hyperlink: IHyperlink.Update, options?: ITransaction.OperationOptions): this;
28668
29335
  /**
28669
29336
  * What the picture's frame draws with: the fill behind the image and the border around it.
28670
29337
  * A picture has no theme style, so each is only what the picture states; by default neither
@@ -29720,7 +30387,7 @@ declare global {
29720
30387
  * @remarks
29721
30388
  * Errors INSIDE a range are the body's to judge: the engine hands a valid range over whole and
29722
30389
  * never looks inside, so a function whose answer depends on every member says so with this
29723
- * line, placed before its own validation where Excel's error outranks it. A reshaper or a
30390
+ * line, placed before its own validation where the member's error outranks it. A reshaper or a
29724
30391
  * lookup, whose members pass through or are never read, needs no line at all.
29725
30392
  */
29726
30393
  firstError(): FormulaError.Known | null;
@@ -29733,7 +30400,7 @@ declare global {
29733
30400
  * @remarks
29734
30401
  * `options.axis` is the TRAVERSAL order feeding the ordinal, not the orientation of the result:
29735
30402
  * the result is always Nx1, and a row is `flatten().transpose()`. The default is row-major,
29736
- * which is the order Excel pairs two range operands in.
30403
+ * which is the order two range operands pair in.
29737
30404
  *
29738
30405
  * `options.type` carries a read type onto the result, so a member the type filters out becomes
29739
30406
  * a HOLE at its ordinal rather than compacting the column. That is what lets two operands be
@@ -30382,7 +31049,7 @@ declare global {
30382
31049
  *
30383
31050
  * - By default, `broadcast()` follows strict alignment rules like NumPy and will
30384
31051
  * throw an error if the input ranges cannot be broadcasted together.
30385
- * - When `misalignValue` is provided, `broadcast()` will instead mimic Excel behavior:
31052
+ * - When `misalignValue` is provided, `broadcast()` will instead follow Excel's behavior:
30386
31053
  * - It finds the **largest valid intersection** of the ranges.
30387
31054
  * - It expands the result to the **union of both range sizes**.
30388
31055
  * - Any cells that do not have valid corresponding values from the inputs
@@ -30440,7 +31107,7 @@ declare global {
30440
31107
  *
30441
31108
  * @remarks
30442
31109
  * Off, a dimension of 1 is a short dimension like any other and pads `misalignValue` past
30443
- * its one position: Excel's `MAP` rule, where a 1-row array is not stretched.
31110
+ * its one position: the `MAP` rule, where a 1-row array is not stretched.
30444
31111
  */
30445
31112
  tile?: boolean;
30446
31113
  /**
@@ -31125,7 +31792,7 @@ declare global {
31125
31792
  */
31126
31793
  getAggregates(options?: IRange.IteratorOptions): Readonly<IRangeStats.Aggregates>;
31127
31794
  /**
31128
- * Returns the sum as Excel's `SUM` reports it — {@link getAggregates}'s `sum` with Excel's
31795
+ * Returns the sum as `SUM` reports it — {@link getAggregates}'s `sum` with Excel's
31129
31796
  * cancellation-to-zero rule applied.
31130
31797
  *
31131
31798
  * @param total A total the caller accumulated across SEVERAL stats instances. Omit for a
@@ -31136,7 +31803,7 @@ declare global {
31136
31803
  * @remarks
31137
31804
  * Collapses a total to exactly zero when it lands at least 50 binary exponents below the
31138
31805
  * operands that produced it, so `SUM(0.1,0.2,-0.3)` is `0` rather than `5.55111512312578E-17`.
31139
- * Use this wherever you mean "the number Excel's SUM would show" — a status bar, a report
31806
+ * Use this wherever you mean "the number SUM shows" — a status bar, a report
31140
31807
  * total, a formula. Use `getAggregates().sum` where you mean the true total of the data.
31141
31808
  *
31142
31809
  * The two genuinely differ, and neither is a rounding of the other:
@@ -31146,12 +31813,12 @@ declare global {
31146
31813
  * and `PERCENTOF`, and to NOTHING else — `SUMIF`, `SUMPRODUCT`, `SERIESSUM`, `DSUM`, the
31147
31814
  * `SUMX2MY2` family and every binary operator all keep the residue over the same values.
31148
31815
  * That is why this is a method you call and not a change to `getAggregates`.
31149
- * - `AVERAGE` divides THIS, not the raw sum: snapping the mean instead is measurably wrong.
31816
+ * - `AVERAGE` divides THIS, not the raw sum: snapping the mean instead is wrong.
31150
31817
  *
31151
31818
  * It is also cheap when it does not fire: a bound derived from `min`/`max` rejects any
31152
31819
  * ordinary total without re-reading the range.
31153
31820
  *
31154
- * **Multiple ranges.** Excel evaluates the rule on the *final* accumulation step, so a total
31821
+ * **Multiple ranges.** The rule applies on the *final* accumulation step, so a total
31155
31822
  * spanning several ranges must be judged against the range holding the LAST value — pass the
31156
31823
  * running total as `total` and call this on that range. (Snapping each range separately gets
31157
31824
  * `SUM(A1:A3,0)` and `SUM(A1:A1,A2:A2,A3:A3)` wrong in opposite directions.) A composite
@@ -31300,7 +31967,7 @@ declare global {
31300
31967
  * Sorting requires materializing the full numeric population (O(n log n), one allocation).
31301
31968
  * Unlike `Aggregates`, sorted views are **not composable across sub-ranges**.
31302
31969
  *
31303
- * Covers the following Excel functions (all share one sort per coords per calc cycle):
31970
+ * Covers the following functions (all share one sort per coords per calc cycle):
31304
31971
  * - `LARGE`, `SMALL`
31305
31972
  * - `MEDIAN`, `PERCENTILE`, `PERCENTILE.INC`, `PERCENTILE.EXC`
31306
31973
  * - `QUARTILE`, `QUARTILE.INC`, `QUARTILE.EXC` (q1 = k=0.25, q3 = k=0.75)
@@ -31365,7 +32032,7 @@ declare global {
31365
32032
  * one outside the population is not found.
31366
32033
  * @param exclusive If true, uses exclusive formula (0 and 1 are excluded).
31367
32034
  * @param significance Number of DECIMAL PLACES to TRUNCATE the result to — despite what
31368
- * Excel's own help calls the argument, it is not significant digits and it does not round.
32035
+ * Excel's help calls the argument, it is not significant digits and it does not round.
31369
32036
  * Truncated toward zero first (1.9 places means 1), and must be at least 1. Omit it for the
31370
32037
  * exact untruncated rank, which is also the only form that cannot fail.
31371
32038
  * @returns The percent rank of x; `null` if x is not found or there are no numbers in range.
@@ -31613,6 +32280,11 @@ declare global {
31613
32280
  * An optional name for the resource.
31614
32281
  */
31615
32282
  getName(): string | null;
32283
+ /**
32284
+ * The URL the bytes were fetched from, when the resource is a picture the workbook keeps for it
32285
+ * (an `IMAGE` source): a fetch of that URL answers from these bytes. `null` otherwise.
32286
+ */
32287
+ getFetchedFrom(): string | null;
31616
32288
  /**
31617
32289
  * For saving to json resources.
31618
32290
  */
@@ -31715,6 +32387,10 @@ declare global {
31715
32387
  * This is optional but if provided then resource lookup will use this as a cache key.
31716
32388
  */
31717
32389
  name?: string;
32390
+ /**
32391
+ * The URL the embedded bytes were fetched from: the workbook keeps them as that URL's picture.
32392
+ */
32393
+ fetchedFrom?: string;
31718
32394
  }
31719
32395
  }
31720
32396
 
@@ -31770,6 +32446,10 @@ declare global {
31770
32446
  * This is optional and purely for human consumption and is not used by the system.
31771
32447
  */
31772
32448
  name?: string;
32449
+ /**
32450
+ * The URL the bytes were fetched from, for a picture the workbook keeps for it.
32451
+ */
32452
+ fetchedFrom?: string;
31773
32453
  }
31774
32454
  /**
31775
32455
  * A type that represents the various ways to provide a resource source.
@@ -31825,14 +32505,20 @@ declare global {
31825
32505
  */
31826
32506
  export interface IRichData {
31827
32507
  /**
31828
- * Reference to either a known typename or a JSON Type Definition.
31829
- * * {@link https://jsontypedef.com/}
32508
+ * The value's kind: the properties it has and how they show. Every value of a kind returns the
32509
+ * same instance.
31830
32510
  */
31831
- getType(): string;
32511
+ getKind(): IRichType;
31832
32512
  /**
31833
32513
  * @param name The name of the property to retrieve.
31834
32514
  */
31835
32515
  getProperty(name: string): Scalar;
32516
+ /**
32517
+ * How the property `name` shows on this value: the value's own presentation where it differs
32518
+ * from its kind's (a price in another currency), else the kind's ({@link IRichType.Property.meta}).
32519
+ * `null`, or the method absent, for none.
32520
+ */
32521
+ getPropertyMeta?(name: string): IRichMeta | null;
31836
32522
  /**
31837
32523
  * The text shown for this value where nothing renders it: a client with no renderer for the
31838
32524
  * kind, a log, a placeholder. A rich text shows its text; an image a short description.
@@ -31844,23 +32530,26 @@ declare global {
31844
32530
  toString(): string;
31845
32531
  /**
31846
32532
  * The primitive this value reads as wherever one is consumed: `LEN`, `&`, `+`, comparison,
31847
- * `ISTEXT`, `TYPE()`, sort, filter, find. A rich text reads as its text; an image reads as
31848
- * nothing (`null`, or the method absent), and is `#VALUE!` wherever a primitive is needed.
32533
+ * `ISTEXT`, `TYPE()`, sort, filter, find. A rich text reads as its text; an error that carries
32534
+ * more than its code reads as that error; an image reads as nothing (`null`, or the method
32535
+ * absent), and is `#VALUE!` wherever a primitive is needed.
31849
32536
  *
31850
32537
  * @remarks
31851
- * The ordinary rules then apply to the primitive (text-to-number coercion, collation), so a
31852
- * value adds no coercions of its own.
32538
+ * The ordinary rules then apply to the primitive (text-to-number coercion, collation, error
32539
+ * propagation), so a value adds no coercions of its own.
31853
32540
  */
31854
- toPrimitive?(): number | string | boolean | null;
32541
+ toPrimitive?(): Exclude<Scalar, IRichData>;
31855
32542
  /**
31856
32543
  * The items this value unpacks to where a range or array is accepted (a list); `null`, or the
31857
32544
  * method absent, for a value that is one value.
31858
32545
  */
31859
32546
  toArray?(): Scalar[][] | null;
31860
32547
  /**
31861
- * Indicates this is an IRichData type.
32548
+ * The value as JSON, which its kind makes it again from. A value that holds a resource (a
32549
+ * picture's bytes) names it by the id `toResourceId` answers, and the file saves the resource;
32550
+ * without `toResourceId` it names none.
31862
32551
  */
31863
- toJSON?(): IRichData.JSON | Promise<IRichData.JSON>;
32552
+ toJSON?(toResourceId?: IRichData.ToResourceId): IRichData.JSON | Promise<IRichData.JSON>;
31864
32553
  /**
31865
32554
  * For runtime type checking.
31866
32555
  */
@@ -31868,31 +32557,224 @@ declare global {
31868
32557
  }
31869
32558
 
31870
32559
  export namespace IRichData {
32560
+ /**
32561
+ * The id a file being saved gives a resource a value holds (an `IResource`); `null` when the
32562
+ * file does not save it.
32563
+ */
32564
+ type ToResourceId = (resource: any) => number | null;
31871
32565
  interface JSON {
32566
+ /** The name of the value's kind ({@link IRichType.getName}). */
31872
32567
  type: string;
32568
+ /** The value's own data, as its kind reads it. */
31873
32569
  data?: any;
32570
+ /**
32571
+ * Presentation for the properties where this value differs from its kind, by property name.
32572
+ */
32573
+ meta?: {
32574
+ readonly [property: string]: IRichMeta;
32575
+ };
31874
32576
  }
31875
32577
  }
31876
32578
 
31877
32579
  /**
31878
- * A registered kind of rich data: its name, and how a value of it is made from its JSON.
32580
+ * The rich values a workbook's cells hold, interned: a cell run stores a rich value as its id here,
32581
+ * as it stores a string as its id in the string collection.
31879
32582
  *
31880
32583
  * @remarks
31881
- * A value's `getType()` is the kind's `name`. What a value reads as where a primitive or an array
31882
- * is consumed is the value's own answer ({@link IRichData.toPrimitive}, {@link IRichData.toArray}),
31883
- * as `toString()` is; the kind only makes values.
32584
+ * Equal values share one id (equal JSON; a resource counts by identity), so recalculating a
32585
+ * formula that makes a new but equal value adds nothing. Values are not removed: a save writes only
32586
+ * the ones a cell holds.
32587
+ */
32588
+ export interface IRichDataCollection extends ICollection<IRichData> {
32589
+ /**
32590
+ * The id of `value`, added when no equal value is here.
32591
+ *
32592
+ * @param value A rich value. Never an error: an error is stored by its code.
32593
+ */
32594
+ add(value: IRichData): number;
32595
+ /**
32596
+ * The value for an id, or `null` if not found.
32597
+ *
32598
+ * @param id The id {@link add} answered.
32599
+ */
32600
+ getById(id: number): IRichData | null;
32601
+ /**
32602
+ * Starts saving or loading the rich values cells name. Scopes begun while one is open share its
32603
+ * ids, so a workbook and its sheets agree on them.
32604
+ */
32605
+ beginPersist(): IRichDataCollection.IPersistScope;
32606
+ /** For runtime type checking. */
32607
+ readonly isIRichDataCollection: true;
32608
+ }
32609
+
32610
+ /**
32611
+ * {@inheritDoc IRichDataCollection}
32612
+ * @see
32613
+ * ### **Interface**
31884
32614
  *
31885
- * Register a kind with {@link RichDataRegistry.register}.
32615
+ * {@link IRichDataCollection}
31886
32616
  */
31887
- export interface IRichDataKind<T extends IRichData = IRichData> {
32617
+ export namespace IRichDataCollection {
32618
+ /** A saved rich value: its kind's JSON. */
32619
+ type JSON = IRichData.JSON;
31888
32620
  /**
31889
- * The kind's name, the `type` of its values and their JSON.
32621
+ * One save or load of the rich values cells name. Ids are positions in the saved table, not the
32622
+ * collection's own.
31890
32623
  */
31891
- readonly name: string;
32624
+ interface IPersistScope {
32625
+ /** The saved id of `value`, added to the table when new. */
32626
+ add(value: IRichData): number;
32627
+ /** The value a loaded id names, or `null`. */
32628
+ at(id: number): IRichData | null;
32629
+ /**
32630
+ * Loads a saved table: each entry made by its kind, its ids then answered by {@link at}.
32631
+ *
32632
+ * @param ctx What the values are made for: the workbook's resources, and the file's resource ids.
32633
+ * @param kinds The kinds saved with the table ({@link toKindsJSON}), made before the values
32634
+ * that name them.
32635
+ */
32636
+ fromJSON(json: readonly JSON[] | undefined, ctx: IRichDataKind.Context, kinds?: readonly IRichType.JSON[]): void;
32637
+ /**
32638
+ * The table, in id order.
32639
+ *
32640
+ * @param toResourceId The saved id of a resource a value holds.
32641
+ */
32642
+ toJSONAsync(toResourceId?: IRichData.ToResourceId): Promise<JSON[]>;
32643
+ /**
32644
+ * The kinds the table's values name, nested values included, that are not registered in code
32645
+ * and so are saved with it.
32646
+ */
32647
+ toKindsJSON(): IRichType.JSON[];
32648
+ /** Ends the scope. The last to end lets the table go. */
32649
+ endPersist(): void;
32650
+ }
32651
+ }
32652
+
32653
+ /**
32654
+ * A registered kind of rich data: the {@link IRichType} its values return from `getKind()`, and how
32655
+ * a value of it is made from its JSON.
32656
+ *
32657
+ * @remarks
32658
+ * What a value reads as where a primitive or an array is consumed is the value's own answer
32659
+ * ({@link IRichData.toPrimitive}, {@link IRichData.toArray}), as `toString()` is; the kind
32660
+ * describes values and makes them.
32661
+ *
32662
+ * Make one with {@link IRichDataKind.create}; register it with {@link RichDataRegistry.register}.
32663
+ */
32664
+ export interface IRichDataKind<T extends IRichData = IRichData> extends IRichType {
31892
32665
  /**
31893
32666
  * A value from its JSON, as {@link IRichData.toJSON} wrote it.
32667
+ *
32668
+ * @param ctx What the value is being made for. Every value is made here, whether it is loaded,
32669
+ * written with `setValue`, or returned by a function. `{ type }` alone asks for the kind's
32670
+ * default value, which is what a UI inserts.
31894
32671
  */
31895
- fromJSON(json: IRichData.JSON): T;
32672
+ fromJSON(json: IRichData.JSON, ctx: IRichDataKind.Context): T;
32673
+ }
32674
+
32675
+ export namespace IRichDataKind {
32676
+ /**
32677
+ * What a kind can reach while making a value.
32678
+ */
32679
+ interface Context {
32680
+ /**
32681
+ * Binary resources (image bytes) by id, the store pictures use. `null` when the value is
32682
+ * made outside a workbook, as an external link's cached values are.
32683
+ */
32684
+ readonly resources: IResourceCollection | null;
32685
+ /**
32686
+ * The string table the value's cells share. `null` outside a workbook.
32687
+ */
32688
+ readonly strings: IStringCollection | null;
32689
+ /**
32690
+ * The resource a value's JSON names by id, while a file is being read: the id
32691
+ * `IRichData.toJSON`'s `toResourceId` gave it. `null` for an id the file does not hold, and
32692
+ * always outside a read.
32693
+ */
32694
+ fromResourceId?(id: number): IResource | null;
32695
+ }
32696
+ /** A context with nothing to reach: a value made outside any workbook. */
32697
+ const DetachedContext: Context;
32698
+ /** What {@link create} makes a kind from. */
32699
+ interface Definition<T extends IRichData = IRichData> {
32700
+ /** {@inheritDoc IRichType.getName} */
32701
+ name: string;
32702
+ /** {@inheritDoc IRichType.getLabel} */
32703
+ label?: string;
32704
+ /** {@inheritDoc IRichType.getProperties} */
32705
+ properties?: readonly IRichType.Property[];
32706
+ /** {@inheritDoc IRichType.getDisplayProperty} */
32707
+ displayProperty?: string | null;
32708
+ /** {@inheritDoc IRichType.getMeta} */
32709
+ meta?: IRichMeta | null;
32710
+ /** {@inheritDoc IRichDataKind.fromJSON} */
32711
+ fromJSON(json: IRichData.JSON, ctx: Context): T;
32712
+ }
32713
+ /** A kind from its definition. The kind is immutable. */
32714
+ function create<T extends IRichData>(definition: Definition<T>): IRichDataKind<T>;
32715
+ }
32716
+
32717
+ /**
32718
+ * How a rich value, or one of its properties, is presented: the number format and caption of a
32719
+ * property, where it is offered, its sources; a kind's card, icon and provider.
32720
+ *
32721
+ * @remarks
32722
+ * Presentation only, never a value. A kind gives each of its properties a default; a value gives
32723
+ * one only for a property where it differs (a price in another currency).
32724
+ */
32725
+ export interface IRichMeta {
32726
+ /** The number format a number property shows in. */
32727
+ readonly numberFormat?: string;
32728
+ /** A short caption shown beside the property, such as its unit or the year of its data. */
32729
+ readonly sublabel?: string;
32730
+ /** Where the property is not offered. Each omitted entry is `false`. */
32731
+ readonly excludeFrom?: IRichMeta.ExcludeFrom;
32732
+ /** Where the property's data comes from and under what license. */
32733
+ readonly attribution?: readonly IRichMeta.Attribution[];
32734
+ /** A kind's card. */
32735
+ readonly card?: IRichMeta.Card;
32736
+ /** A kind's icon, by name. */
32737
+ readonly icon?: string;
32738
+ /** Who provides a kind's data. */
32739
+ readonly provider?: IRichMeta.Provider;
32740
+ }
32741
+
32742
+ export namespace IRichMeta {
32743
+ /** Where a property is not offered. */
32744
+ interface ExcludeFrom {
32745
+ /** Not shown on the card. */
32746
+ readonly cardView?: boolean;
32747
+ /** Not offered after `A1.` in a formula. */
32748
+ readonly dotNotation?: boolean;
32749
+ /** Not offered by formula autocomplete. */
32750
+ readonly autoComplete?: boolean;
32751
+ /** A change to the property is not a change to the value. */
32752
+ readonly calcCompare?: boolean;
32753
+ }
32754
+ /** One source of a property's data. */
32755
+ interface Attribution {
32756
+ readonly sourceText?: string;
32757
+ readonly sourceAddress?: string;
32758
+ readonly licenseText?: string;
32759
+ readonly licenseAddress?: string;
32760
+ }
32761
+ /** A kind's card: which properties it shows, and how. */
32762
+ interface Card {
32763
+ /** The properties shown, in order. Omitted, the kind's order. */
32764
+ readonly order?: readonly string[];
32765
+ /** The property shown as the title. */
32766
+ readonly title?: string;
32767
+ /** The property shown under the title. */
32768
+ readonly subTitle?: string;
32769
+ /** The image property shown at the top. */
32770
+ readonly mainImage?: string;
32771
+ }
32772
+ /** Who provides a kind's data. */
32773
+ interface Provider {
32774
+ readonly description?: string;
32775
+ readonly logoSourceAddress?: string;
32776
+ readonly logoTargetAddress?: string;
32777
+ }
31896
32778
  }
31897
32779
 
31898
32780
  /**
@@ -31944,6 +32826,84 @@ declare global {
31944
32826
  } | readonly RunUpdate[] | string;
31945
32827
  }
31946
32828
 
32829
+ /**
32830
+ * The kind of a rich value: its class. A kind is a static set of typed property definitions, and
32831
+ * every value of a kind shares the one `IRichType` its {@link IRichData.getKind} returns.
32832
+ *
32833
+ * @remarks
32834
+ * For introspection: a renderer, a card, a formula editor offering `A1.` completions, or a
32835
+ * function reading a field asks the value's kind which properties it has. What a value reads as
32836
+ * where a primitive is consumed is the value's own answer ({@link IRichData.toPrimitive}).
32837
+ */
32838
+ export interface IRichType {
32839
+ /**
32840
+ * The kind's name: what a value's JSON names as its `type`.
32841
+ */
32842
+ getName(): string;
32843
+ /**
32844
+ * The name a UI shows for the kind, such as in a list of what can be inserted. The name when the
32845
+ * kind has no label of its own.
32846
+ */
32847
+ getLabel(): string;
32848
+ /**
32849
+ * The kind's properties, in the order the kind declares them.
32850
+ */
32851
+ getProperties(): readonly IRichType.Property[];
32852
+ /**
32853
+ * The property `name`, or `null` when the kind has none by that name.
32854
+ */
32855
+ getProperty(name: string): IRichType.Property | null;
32856
+ /**
32857
+ * The property whose value is the text a cell shows for a value of this kind, or `null` when
32858
+ * the kind shows none (an image).
32859
+ */
32860
+ getDisplayProperty(): string | null;
32861
+ /**
32862
+ * The kind's own presentation (a card, an icon, a provider), or `null` for none.
32863
+ */
32864
+ getMeta(): IRichMeta | null;
32865
+ }
32866
+
32867
+ export namespace IRichType {
32868
+ /**
32869
+ * What a property holds.
32870
+ *
32871
+ * @remarks
32872
+ * `rich` is another rich value (a capital city, an image); `array` is an array value; `resource`
32873
+ * is a workbook resource such as a picture's bytes.
32874
+ */
32875
+ type ValueType = 'number' | 'integer' | 'string' | 'boolean' | 'error' | 'rich' | 'array' | 'resource';
32876
+ /**
32877
+ * One property a kind declares.
32878
+ */
32879
+ interface Property {
32880
+ /** The property's name. */
32881
+ readonly name: string;
32882
+ /** What it holds. */
32883
+ readonly valueType: ValueType;
32884
+ /** What it reads as on a value that holds none. Omitted, `null`. */
32885
+ readonly defaultValue?: Scalar;
32886
+ /** How the property shows, unless a value says otherwise. */
32887
+ readonly meta?: IRichMeta;
32888
+ }
32889
+ /**
32890
+ * A kind saved with the workbook whose values name it: one that is not registered in code, such
32891
+ * as a kind read from a file.
32892
+ */
32893
+ interface JSON {
32894
+ /** {@inheritDoc IRichType.getName} */
32895
+ name: string;
32896
+ /** {@inheritDoc IRichType.getLabel} */
32897
+ label?: string;
32898
+ /** {@inheritDoc IRichType.getProperties} */
32899
+ properties?: readonly Property[];
32900
+ /** {@inheritDoc IRichType.getDisplayProperty} */
32901
+ displayProperty?: string | null;
32902
+ /** {@inheritDoc IRichType.getMeta} */
32903
+ meta?: IRichMeta;
32904
+ }
32905
+ }
32906
+
31947
32907
  /**
31948
32908
  * Describes the host environment the calculation engine is running in.
31949
32909
  *
@@ -39082,6 +40042,34 @@ declare global {
39082
40042
  * Returns the current shared resources.
39083
40043
  */
39084
40044
  getResources(): IResourceCollection;
40045
+ /**
40046
+ * The fetcher the workbook reaches outside itself with: the handlers per URL scheme a host
40047
+ * registered, given as {@link IWorkbook.ConstructorOptions.fetcher}.
40048
+ */
40049
+ getFetcher(): IFetcher;
40050
+ /**
40051
+ * Fetches as the workbook does, with the standard `fetch` signature: what `IMAGE`, a web
40052
+ * service function, and a renderer drawing a picture use.
40053
+ *
40054
+ * @remarks
40055
+ * A resource with a `fetchedFrom` is the workbook's copy of that URL, and answers a fetch of it
40056
+ * without a request. Anything else goes to {@link getFetcher}. The fetch saves nothing itself: a
40057
+ * successful answer to a plain GET that is not a picture is cached until the workbook closes and
40058
+ * answers later fetches of that URL. A response whose bytes are a picture says what they are,
40059
+ * whatever the server called them. Plain GETs of one URL in flight together share one request;
40060
+ * aborting one caller's signal does not stop it for the others. `cache: 'reload'` skips all of
40061
+ * these and asks the source.
40062
+ *
40063
+ * The workbook saves a resource while a value holds it: `IMAGE` adds the picture it fetched for
40064
+ * its values. A picture of the host's own goes in a cell the same way, under a URL the host mints:
40065
+ *
40066
+ * ```ts
40067
+ * const source = `resource:${crypto.randomUUID()}`;
40068
+ * const resource = workbook.getResources().add({ source: { buffer: bytes }, fetchedFrom: source });
40069
+ * workbook.getRange('A1').setValue({ type: 'image', data: { source, resource } });
40070
+ * ```
40071
+ */
40072
+ fetch(input: string, init?: RequestInit): Promise<Response>;
39085
40073
  /**
39086
40074
  * Returns the current shared resources.
39087
40075
  */
@@ -39705,6 +40693,10 @@ declare global {
39705
40693
  styles?: IStyleCollection.JSON;
39706
40694
  resources?: IResource.JSON[];
39707
40695
  strings?: string[];
40696
+ /** The rich values cells name by id (`{ t: 'r', v: id }`). */
40697
+ richData?: IRichDataCollection.JSON[];
40698
+ /** The kinds {@link richData} names that are not registered in code (a kind read from a file). */
40699
+ richTypes?: IRichType.JSON[];
39708
40700
  /**
39709
40701
  * The people the workbook knows.
39710
40702
  *
@@ -39825,6 +40817,11 @@ declare global {
39825
40817
  * A theme for the workbook.
39826
40818
  */
39827
40819
  theme?: ITheme;
40820
+ /**
40821
+ * How the workbook reaches outside itself: the handlers per URL scheme, with the host's
40822
+ * authentication. Omitted, a {@link Fetcher} for `http:` and `https:`.
40823
+ */
40824
+ fetcher?: IFetcher;
39828
40825
  /**
39829
40826
  * Load from JSON.
39830
40827
  */
@@ -40284,7 +41281,7 @@ declare global {
40284
41281
  * write path both actually ask, use {@link isEncrypted}.
40285
41282
  *
40286
41283
  * Never the password: origins are rendered into logs and REPL output, and ride events and
40287
- * progress callbacks, so a secret has no business here (see `PROTECTION-DESIGN.md` §5f).
41284
+ * progress callbacks, so a secret has no business here.
40288
41285
  *
40289
41286
  * Use it to show a lock affordance, and to recognise that writing plaintext over it would be a
40290
41287
  * downgrade — {@link IWorkbookIO.WriteOptions.password} makes that refusal explicit.
@@ -40690,8 +41687,8 @@ declare global {
40690
41687
  * - `'auto'` — cached values are trusted; the load pass evaluates a formula cell with no
40691
41688
  * cached value (a repair — Excel always stores one) and refreshes volatiles. Everything is
40692
41689
  * recalculated only when Excel would recalculate on open: the file sets `fullCalcOnLoad`,
40693
- * or for xlsx its `calcId` is missing or older than the Excel build this library is
40694
- * verified against. (What this library writes carries one: the source file's, else that
41690
+ * or for xlsx its `calcId` is missing or older than the Excel build this library
41691
+ * targets. (What this library writes carries one: the source file's, else that
40695
41692
  * build's.) To take the file's values as they are whatever it says — as openpyxl does —
40696
41693
  * pass `'none'`; to always recalculate, `'full'`.
40697
41694
  * - `'full'` — everything is recalculated, whatever the file says.
@@ -41796,6 +42793,14 @@ declare global {
41796
42793
  * {@link IWorksheetProtection.isLocked} is true.
41797
42794
  */
41798
42795
  getProtectedRanges(): IProtectedRangeCollection;
42796
+ /**
42797
+ * Returns the cell controls on this sheet, such as checkboxes.
42798
+ *
42799
+ * @remarks
42800
+ * Every entry, in drawing order. To put a control on cells or read what is there, use
42801
+ * {@link ICellRange.setControl} and {@link ICellRange.getControls}.
42802
+ */
42803
+ getCellControls(): ICellControlCollection;
41799
42804
  /**
41800
42805
  * Returns the comments and notes on this sheet.
41801
42806
  *
@@ -42253,14 +43258,6 @@ declare global {
42253
43258
  * workbook's {@link IWorkbook.getPivotTables} walks every sheet's.
42254
43259
  */
42255
43260
  getPivotTables(): IPivotTableCollection;
42256
- /**
42257
- * Returns the what-if data tables on this sheet, in the order they were read.
42258
- *
42259
- * @remarks
42260
- * Read-only for now: each table is carried as it was read, its results as the file held them.
42261
- * As in Excel, an edit to part of a table's results is refused.
42262
- */
42263
- getDataTables(): IDataTableCollection;
42264
43261
  /**
42265
43262
  * Set the picture interface for the entire sheet.
42266
43263
  * @param picture The picture interface to set for the sheet, or null to remove it.
@@ -42360,7 +43357,7 @@ declare global {
42360
43357
  /**
42361
43358
  * The events that carry a {@link ChangeEvent}: what {@link ChangeEvent.getKind} names.
42362
43359
  */
42363
- type ChangeEventKey = 'onDataChange' | 'onStyleChange' | 'onLayoutChange' | 'onMergesChange' | 'onSpillsChange';
43360
+ type ChangeEventKey = 'onDataChange' | 'onStyleChange' | 'onMergesChange' | 'onSpillsChange';
42364
43361
  /**
42365
43362
  * What a change event announces: where the change landed and what wrote it.
42366
43363
  *
@@ -42553,6 +43550,13 @@ declare global {
42553
43550
  * Always accompanied by the coarse {@link onProtectionChange}.
42554
43551
  */
42555
43552
  onProtectedRangesChange?(source: IWorksheet): void;
43553
+ /**
43554
+ * Called when a cell control is added, removed, re-anchored or reordered.
43555
+ *
43556
+ * @remarks
43557
+ * Always accompanied by the coarse {@link onStyleChange}: a control is a format.
43558
+ */
43559
+ onCellControlsChange?(source: IWorksheet): void;
42556
43560
  /**
42557
43561
  * Called when a comment is added, removed, edited, resolved, replied to or re-anchored.
42558
43562
  *
@@ -42593,11 +43597,8 @@ declare global {
42593
43597
  * for "cell geometry moved".
42594
43598
  * * This can be be due to row/column sizes changes or changing the max rows columns.
42595
43599
  * * Zoom and viewport do not change the underlying layout.
42596
- *
42597
- * @param source The sheet.
42598
- * @param event The whole sheet: sizes are announced by the headers, which do not say where.
42599
43600
  */
42600
- onLayoutChange?(source: IWorksheet, event: IWorksheet.ChangeEvent): void;
43601
+ onLayoutChange?(source: IWorksheet): void;
42601
43602
  /**
42602
43603
  * Called when which rows are hidden has changed.
42603
43604
  */
@@ -42917,7 +43918,7 @@ declare global {
42917
43918
  * JSON representation of an `IWorksheet` used for serialization and deserialization.
42918
43919
  */
42919
43920
  interface JSON extends ISheet.JSON {
42920
- data?: Tuple.GridTuple<ICell.JSON>;
43921
+ data?: Tuple.GridTuple<Scalar.JSON>;
42921
43922
  formulas?: IRange.JSONReferenceTuple<string>[];
42922
43923
  /**
42923
43924
  * The extent occupied by an array formula, and which of the three
@@ -42954,6 +43955,10 @@ declare global {
42954
43955
  styles?: IStyleCollection.JSON;
42955
43956
  resources?: IResource.JSON[];
42956
43957
  strings?: string[];
43958
+ /** The rich values cells name by id (`{ t: 'r', v: id }`), when the sheet owns its own. */
43959
+ richData?: IRichDataCollection.JSON[];
43960
+ /** The kinds {@link richData} names that are not registered in code (a kind read from a file). */
43961
+ richTypes?: IRichType.JSON[];
42957
43962
  /**
42958
43963
  * Modules owned by this sheet, keyed by module name.
42959
43964
  *
@@ -42995,6 +44000,7 @@ declare global {
42995
44000
  */
42996
44001
  validationSettings?: IDataValidationCollection.Settings;
42997
44002
  protectedRanges?: IRange.JSONReference<IProtectedRange.JSON>[];
44003
+ cellControls?: IRange.JSONReference<ICellControl.JSON>[];
42998
44004
  movables?: IMovable.JSON[];
42999
44005
  /**
43000
44006
  * The sheet's VBA code name. Absent when it has none.
@@ -43052,12 +44058,6 @@ declare global {
43052
44058
  * @see {@link IWorksheet.getPivotTables}
43053
44059
  */
43054
44060
  pivotTables?: IPivotTable.JSON[];
43055
- /**
43056
- * The sheet's what-if data tables.
43057
- *
43058
- * @see {@link IWorksheet.getDataTables}
43059
- */
43060
- dataTables?: IDataTable.JSON[];
43061
44061
  /**
43062
44062
  * The cells where Excel's error checks are ignored (the green triangle's **Ignore Error**):
43063
44063
  * each reference's value is the set of checks its cells ignore.
@@ -44434,7 +45434,8 @@ declare global {
44434
45434
  */
44435
45435
  setLicenseKey(licenseKey: string, force?: boolean): Promise<LicenseDetails>;
44436
45436
  /**
44437
- * Return the current license details.
45437
+ * Return the current license details. Prints nothing: the license notice is printed when the
45438
+ * engine starts under the license (see {@link assertUsable}).
44438
45439
  */
44439
45440
  getDetails(): Promise<LicenseDetails>;
44440
45441
  /**
@@ -45690,14 +46691,6 @@ declare global {
45690
46691
  constructor(message: string, options?: ErrorOptions);
45691
46692
  }
45692
46693
 
45693
- /**
45694
- * The statistics a box and whisker draws for one set of values, as Excel computes them (measured
45695
- * 2026-10-22, `probe-chart-2016-types.ps1` B01-B13 and `probe-chart-2016-types-reopen.ps1` B05-B07;
45696
- * DESIGN-CHART §4.17): quartiles by Excel's exclusive (`QUARTILE.EXC`) or inclusive
45697
- * (`QUARTILE.INC`) method, the median the same either way; whiskers to the furthest values within
45698
- * 1.5 interquartile ranges of the box, and the values beyond them outliers (B09: 60 beyond a box of
45699
- * 15..25).
45700
- */
45701
46694
  export type QuartileMethod = 'inclusive' | 'exclusive';
45702
46695
 
45703
46696
  /**
@@ -46133,12 +47126,12 @@ declare global {
46133
47126
  * omitted when there is a single repetition. `SORTBY`'s legal arities are 2 and 1+2n and nothing
46134
47127
  * else — `SORTBY(array, by1)` is legal, `SORTBY(array, by1, o1, by2)` is not. It is not a general
46135
47128
  * "the final element of the final group may be omitted" rule; that rule would accept a formula
46136
- * Excel refuses. An optional slot anywhere else in the group is a compiler error.
47129
+ * that must be refused. An optional slot anywhere else in the group is a compiler error.
46137
47130
  *
46138
47131
  * ### The maximum, `Max`
46139
47132
  *
46140
- * The second type argument is the largest number of arguments the WHOLE CALL accepts, which is
46141
- * how Excel states it: one number per NAME, compared against the call's total argument count and
47133
+ * The second type argument is the largest number of arguments the WHOLE CALL accepts: one
47134
+ * number per NAME, compared against the call's total argument count and
46142
47135
  * refused at entry (`Excess_function_arguments`), never a count of this parameter's own share.
46143
47136
  * `SWITCH`'s 254 therefore covers its `expression` and its trailing `default` as well as the
46144
47137
  * pairs, and `CHOOSEROWS`' covers its `array`.
@@ -46200,8 +47193,8 @@ declare global {
46200
47193
  * what can arrive and {@link IFunctionArguments.getAreaCountAt} answers the union question the
46201
47194
  * kind cannot — a plain reference is one area, a union is more.
46202
47195
  *
46203
- * Its use is meant to stay countable: a slot earns it with a rule Excel actually shows, never
46204
- * with a guess.
47196
+ * Its use is meant to stay countable: a slot earns it with a concrete behavior that needs it,
47197
+ * never speculatively.
46205
47198
  *
46206
47199
  * @example
46207
47200
  * ```ts
@@ -46229,9 +47222,12 @@ declare global {
46229
47222
  chartEx?: boolean;
46230
47223
  /** The chart's own text font: what text with no font of its own is drawn in. */
46231
47224
  font: ResolvedChart.Font;
46232
- /** `cornerRadius` in points: 0 for square corners. */
47225
+ /**
47226
+ * `fill` is `undefined` where the chart states none: it is drawn in the background of where it is
47227
+ * drawn. `cornerRadius` in points: 0 for square corners.
47228
+ */
46233
47229
  chartArea: {
46234
- fill: IFill.JSON | null;
47230
+ fill: IFill.JSON | null | undefined;
46235
47231
  border: ResolvedChart.Stroke | null;
46236
47232
  cornerRadius: number;
46237
47233
  };
@@ -46393,7 +47389,6 @@ declare global {
46393
47389
  /** Box and whisker groups: what of each box is drawn, and the line it is drawn with. */
46394
47390
  box?: BoxOptions;
46395
47391
  }
46396
- /** How a box and whisker series draws its boxes (DESIGN-CHART §4.17). */
46397
47392
  interface BoxOptions {
46398
47393
  quartileMethod: QuartileMethod;
46399
47394
  /** An x at each box's mean. */
@@ -46520,11 +47515,6 @@ declare global {
46520
47515
  bannerFill: IFill.JSON | null;
46521
47516
  };
46522
47517
  }
46523
- /**
46524
- * How a histogram's values were counted (DESIGN-CHART §4.16): each series' `values` are its
46525
- * counts by bin and its `categories` the bins' labels; a pareto's are its sums by category,
46526
- * largest first, with a line of the running share on an axis of its own.
46527
- */
46528
47518
  interface Histogram {
46529
47519
  /** The first series' bins, each with the indexes of its `raw` values. */
46530
47520
  bins: HistogramBin[];
@@ -46828,7 +47818,7 @@ declare global {
46828
47818
  * This is what makes a miss impossible by construction for a served root: one fetch of this file and
46829
47819
  * the resolver knows exactly which packages and files the root holds, so it never has to ask for a
46830
47820
  * file that is not there. A root without one (a hand-assembled folder) still works — the resolver
46831
- * falls back to probing, exactly as before this file existed.
47821
+ * falls back to probing.
46832
47822
  */
46833
47823
  export interface ResourceRootIndex {
46834
47824
  /** Every file under the root, `path` relative to it (e.g. `locales/@sheetxl/sdk/de/ui.msg.json`). */
@@ -46838,7 +47828,7 @@ declare global {
46838
47828
  }
46839
47829
 
46840
47830
  /**
46841
- * The kinds of rich data a cell can hold, by name.
47831
+ * The kinds of rich data a cell can hold, by type.
46842
47832
  *
46843
47833
  * @remarks
46844
47834
  * A value is made from its JSON by looking its `type` up here; what a value reads as where a
@@ -46849,27 +47839,60 @@ declare global {
46849
47839
  */
46850
47840
  export namespace RichDataRegistry {
46851
47841
  /**
46852
- * Registers a kind. A kind registered again under the same name replaces the earlier one.
47842
+ * Registers a kind. A kind registered again under the same name replaces the earlier one,
47843
+ * a built-in included.
46853
47844
  */
46854
47845
  function register(kind: IRichDataKind<any>): void;
46855
- /** The kind registered as `name`, or `null`. */
46856
- function get(name: string): IRichDataKind | null;
46857
- /** The kind of `value`, or `null` when its type is not registered. */
47846
+ /**
47847
+ * The kind named `type`: registered, or defined ({@link RichRecord.defineKind}); `null` when
47848
+ * there is none.
47849
+ */
47850
+ function get(type: string): IRichDataKind | null;
47851
+ /** The kind of `value`, registered or defined, or `null` when it is neither. */
46858
47852
  function kindOf(value: IRichData): IRichDataKind | null;
46859
- /** The registered names. */
46860
- function getNames(): string[];
47853
+ /** The names of the registered kinds. */
47854
+ function getTypes(): string[];
46861
47855
  /**
46862
47856
  * A value from its JSON: the registered kind's, or an {@link Unmodeled} one carrying the JSON.
47857
+ *
47858
+ * @param ctx What the value is made for; omitted, a value made outside any workbook.
47859
+ */
47860
+ function fromJSON(json: IRichData.JSON, ctx?: IRichDataKind.Context): IRichData;
47861
+ /**
47862
+ * Whether `value` is the JSON of a rich value (`{ type, data? }`), as `setValue` accepts it
47863
+ * in place of the value.
46863
47864
  */
46864
- function fromJSON(json: IRichData.JSON): IRichData;
47865
+ function isJSON(value: unknown): value is IRichData.JSON;
46865
47866
  /**
46866
47867
  * What `value` reads as where a primitive is consumed ({@link IRichData.toPrimitive}), or
46867
47868
  * `undefined` when it reads as nothing.
46868
47869
  */
46869
- function toPrimitive(value: IRichData): number | string | boolean | undefined;
47870
+ function toPrimitive(value: IRichData): Exclude<Scalar, IRichData | null> | undefined;
46870
47871
  /**
46871
- * The `ScalarType` of what `value` reads as: `String`, `Number` or `Boolean` for a kind with a
46872
- * primitive, `RichData` otherwise.
47872
+ * The text `value` shows in a cell when it reads as no primitive: the value of its kind's
47873
+ * display property ({@link IRichType.getDisplayProperty}), or `null` when the kind names none or
47874
+ * the value holds no text there.
47875
+ *
47876
+ * @remarks
47877
+ * Display only: the value still reads as nothing to calculation.
47878
+ */
47879
+ function toDisplayText(value: IRichData): string | null;
47880
+ /**
47881
+ * The text that stands for `value` as a whole, as in the formula bar: its display text
47882
+ * ({@link toDisplayText}), else the label its kind was given in parentheses, `(Image)`, else
47883
+ * `(Rich Object)`.
47884
+ */
47885
+ function toPlaceholderText(value: IRichData): string;
47886
+ /**
47887
+ * The `ScalarType` `value` lays out as in a cell: its primitive's when it has one (a hyperlink
47888
+ * named by a number is a number); `String` when it reads as nothing but shows text (an entity's
47889
+ * display string), so it aligns left and spills into empty neighbors; `RichData` when it shows
47890
+ * no text (a picture).
47891
+ */
47892
+ function layoutTypeOf(value: IRichData): ScalarType;
47893
+ /**
47894
+ * The `ScalarType` of what `value` reads as: `String`, `Number`, `Boolean` or `Error` for a
47895
+ * kind with a primitive, `RichData` otherwise.
46873
47896
  */
46874
47897
  function primitiveTypeOf(value: IRichData): ScalarType;
46875
47898
  /**
@@ -46878,12 +47901,16 @@ declare global {
46878
47901
  */
46879
47902
  function toArray(value: IRichData): Scalar[][] | null;
46880
47903
  /**
46881
- * A value whose type nobody has registered: it carries its JSON as it was read and reads as
47904
+ * A value whose kind nobody has registered: it carries its JSON as it was read and reads as
46882
47905
  * nothing, so a workbook that holds one saves it unchanged.
47906
+ *
47907
+ * @remarks
47908
+ * Its kind is made from what it holds: named by its JSON's `type`, with a property for each
47909
+ * entry of its data.
46883
47910
  */
46884
47911
  class Unmodeled implements IRichData {
46885
47912
  constructor(json: IRichData.JSON);
46886
- getType(): string;
47913
+ getKind(): IRichType;
46887
47914
  getProperty(name: string): Scalar;
46888
47915
  toString(): string;
46889
47916
  toJSON(): IRichData.JSON;
@@ -46976,8 +48003,8 @@ declare global {
46976
48003
  */
46977
48004
  const MAX_SIGNIFICANT_DIGITS = 15;
46978
48005
  /**
46979
- * Applies Excel's entry rule to numeric text: every significand digit past the
46980
- * 15th becomes `0`, so the text parses to the double Excel would store.
48006
+ * Applies the 15-digit entry rule to numeric text: every significand digit past the
48007
+ * 15th becomes `0`, so the text parses to the double a cell stores.
46981
48008
  *
46982
48009
  * @param text Numeric text in any accepted form — signed, grouped, percent,
46983
48010
  * currency-affixed, or scientific. The scan is locale-blind: only digit
@@ -46991,6 +48018,57 @@ declare global {
46991
48018
  * truncation, not rounding: `1234567890.123456789` stores `…345`, never `…346`.
46992
48019
  */
46993
48020
  function truncateNumberText(text: string): string;
48021
+ /**
48022
+ * The smallest magnitude a stored number can have: the smallest normal double. A smaller one is
48023
+ * stored as `0`.
48024
+ */
48025
+ const MIN_NUMBER = 2.2250738585072014e-308;
48026
+ /**
48027
+ * Applies the stored-number floor to a number entering a workbook — typed, parsed from text, written
48028
+ * through the API or loaded from a file: a magnitude below {@link MIN_NUMBER} becomes `0`.
48029
+ */
48030
+ function flushSubnormal(value: number): number;
48031
+ /**
48032
+ * Whether numeric text is inside the range accepted as a number, judged from the text as
48033
+ * written rather than the double it parses to.
48034
+ *
48035
+ * @param text Numeric text in any accepted form, as {@link truncateNumberText} takes it. Only
48036
+ * digits, `decimal` and an exponent marker are read.
48037
+ * @param decimal The decimal separator `text` is written with.
48038
+ * @returns `false` when the leading significant digit sits outside `1E-309` … `1E+307`
48039
+ * (`1E-310`, `0.00001E-305`, `1E+308`); for a zero mantissa, when its scale — exponent less
48040
+ * fraction digits — is outside ±308 (`0E-309`, `0.0E-308` and `0E+309`, but not `0E-308`,
48041
+ * `000E-308` or `0.0E+309`). Text out of range is not a number: a formula literal will not
48042
+ * commit, `VALUE` is `#VALUE!` and typed entry stays text.
48043
+ */
48044
+ function isNumberTextInRange(text: string, decimal?: string): boolean;
48045
+ /**
48046
+ * Encodings of `ScalarType` for persistence.
48047
+ */
48048
+ type JSONType = 'n' | 's' | 'b' | 'e' | 'r' | 'z';
48049
+ /**
48050
+ * A value encoded as a number with an associated type.
48051
+ */
48052
+ interface JSONTypedValue {
48053
+ t: JSONType;
48054
+ /**
48055
+ * The number, string id, error code or boolean flag; for `'r'`, the rich data's own JSON
48056
+ * (`IRichData.JSON`), which its registered kind reads back.
48057
+ */
48058
+ v: number | IRichData.JSON;
48059
+ }
48060
+ /**
48061
+ * JSON values whose type is implied by their JavaScript type.
48062
+ *
48063
+ * @remarks
48064
+ * What a string means is up to the container: a worksheet stores the id of the string in its
48065
+ * strings collection, while an external link cache stores the string itself.
48066
+ */
48067
+ type JSONUnTypedValue = number | boolean | string;
48068
+ /**
48069
+ * For persisting a single scalar value and its type.
48070
+ */
48071
+ type JSON = JSONUnTypedValue | JSONTypedValue;
46994
48072
  }
46995
48073
 
46996
48074
  /**
@@ -47225,8 +48303,7 @@ declare global {
47225
48303
  *
47226
48304
  * @remarks
47227
48305
  * A Windows path becomes a `file:///` URI with forward slashes and percent-encoding, a UNC path a
47228
- * `file://server/share/…` one, and a URL or a bare relative name is kept verbatim — the three
47229
- * target shapes measured in the corpus (DESIGN-EXTERNAL-LINKS §2.2).
48306
+ * `file://server/share/…` one, and a URL or a bare relative name is kept verbatim.
47230
48307
  */
47231
48308
  export function sourceEntryFromPath(path: string): IExternalBook.SourceEntry;
47232
48309
 
@@ -47419,16 +48496,6 @@ declare global {
47419
48496
  visitTextFrame?: (frame: ITextFrame) => Partial<ITextFrame> | void;
47420
48497
  }
47421
48498
 
47422
- /**
47423
- * Excel's date axis (measured 2026-10-17, `probe-chart-dates.ps1` and `probe-chart-dates-units.ps1`,
47424
- * DESIGN-CHART §4.2). Dates are serials, in the 1900 or 1904 system; lengths are points.
47425
- *
47426
- * @remarks
47427
- * A date axis has one slot per base unit (a day, a month or a year) from its first date, snapped to
47428
- * the start of its unit, to its last; each point is drawn in the slot of its date, so a gap in the
47429
- * dates is a gap on the axis and two points of one date share a slot. Labels are drawn on the
47430
- * major ticks only, from the first slot on, in the axis's number format.
47431
- */
47432
48499
  export type TimeUnit = 'days' | 'months' | 'years';
47433
48500
 
47434
48501
  /**
@@ -47552,14 +48619,6 @@ declare global {
47552
48619
  superscript?: boolean;
47553
48620
  }
47554
48621
 
47555
- /**
47556
- * Excel's trendlines: the fits, their R², the moving average, and the label's equation.
47557
- *
47558
- * @remarks
47559
- * Measured against Excel 16.0 (DESIGN-CHART §4.5, `probe-chart-trendlines.ps1`): every coefficient
47560
- * of the nine types on a line chart and a scatter, a set intercept, and a sweep of numbers through
47561
- * the label's General format.
47562
- */
47563
48622
  export type TrendlineType = 'exp' | 'linear' | 'log' | 'movingAvg' | 'poly' | 'power';
47564
48623
 
47565
48624
  /**
@@ -48065,7 +49124,7 @@ declare global {
48065
49124
  *
48066
49125
  * @remarks
48067
49126
  * A value's kind and its extent are different axes: `{10}`, `A1` and a bare `10` all reach a
48068
- * range-typed parameter as a 1x1 container, yet Excel separates them:
49127
+ * range-typed parameter as a 1x1 container, yet they are distinct:
48069
49128
  * `VLOOKUP(10,10,1,TRUE)` is `#N/A` while `VLOOKUP(10,{10},1,TRUE)` is 10, and `TYPE` answers
48070
49129
  * 1 vs 64. The kind is what the CALLER supplied; the extent is merely its size.
48071
49130
  *
@@ -48074,7 +49133,7 @@ declare global {
48074
49133
  * argument can be: a reference, a non-reference array, a callable, and no argument at all. As an
48075
49134
  * argument kind, {@link ScalarType.Null} means a BLANK value.
48076
49135
  *
48077
- * The names and values are ours. The numeric codes Excel's `TYPE` function answers are a
49136
+ * The names and values are ours. The numeric codes the `TYPE` function answers are a
48078
49137
  * PROJECTION of this kind (see `TYPE`'s implementation), not the kind itself.
48079
49138
  *
48080
49139
  * @see {@link IFunctionArguments.getKindAt}
@@ -48166,7 +49225,7 @@ declare global {
48166
49225
  * Compiles Excel wildcard text into a regex.
48167
49226
  *
48168
49227
  * @param anchor Where the pattern has to line up: `true` for the WHOLE string, `'start'` for a
48169
- * PREFIX, `false` for anywhere in it. Excel matches a whole cell, so every lookup and criteria
49228
+ * PREFIX, `false` for anywhere in it. A criterion matches a whole cell, so every lookup and criteria
48170
49229
  * caller anchors; `SEARCH`, which looks for a substring, does not; and a `D` function's criteria
48171
49230
  * table is the prefix form — `DSUM` with the criterion `appl` takes the row whose value is
48172
49231
  * `Apple`, where `COUNTIF` with the same criterion takes none.