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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (353) hide show
  1. package/THIRD-PARTY-NOTICES.md +1 -1
  2. package/browser/cjs/4f5eoQQfV-V7LO2_.cjs +1 -0
  3. package/browser/cjs/BEnEDC1m546-gzWS.cjs +1 -0
  4. package/browser/cjs/CwCUa4IzGNGissLL.cjs +1 -0
  5. package/browser/cjs/{a0Z-SXs_N71CtqYb.cjs → Dg3GaW0QWwnlqetX.cjs} +1 -1
  6. package/browser/cjs/KWQPie2u7AP69web.cjs +93 -0
  7. package/browser/cjs/index.cjs +2 -2
  8. package/browser/esm/{B0HS42a7lga1k1U_.mjs → BJ9hcZAGY8Tj5_9L.mjs} +1 -1
  9. package/browser/esm/C8vpA2ZBtZf6w4nq.mjs +394 -0
  10. package/browser/esm/DDojiE2-oycJ7qGi.mjs +20 -0
  11. package/browser/esm/DEPT7zmpiMdZ-_qC.mjs +70253 -0
  12. package/browser/esm/DOvCi3lf49To36WP.mjs +8 -0
  13. package/browser/esm/{uyWBMSIxMlt8n5Z3.mjs → Dq3sc4B_HQHBrT5N.mjs} +2 -2
  14. package/browser/esm/index.mjs +871 -696
  15. package/browser/esm/{DlPMeIyxT9tG_WDk.mjs → trwZArJQQq7K9kL7.mjs} +2 -2
  16. package/licenses/dependencies.txt +204 -204
  17. package/node/esm/CGWsQOMWdnDeF4dX.mjs +8 -0
  18. package/node/esm/{Cku7XiUvw1xrRasi.mjs → CL9MI-b6D9BmtVXW.mjs} +1 -1
  19. package/node/esm/CressiwiIhxCVp1v.mjs +28 -0
  20. package/node/esm/O2cOO3xIynWUgOWe.mjs +403 -0
  21. package/node/esm/index.mjs +52356 -37345
  22. package/package.json +6 -7
  23. package/resources/locales/de/model.msg.json +45 -9
  24. package/resources/locales/en/model.msg.json +42 -9
  25. package/types/scripting-api.json +7093 -0
  26. package/types/scripting-enums.json +54 -8
  27. package/types/scripting.d.ts +7006 -1202
  28. package/types/src/anchored/AbstractAnchored.d.ts +18 -8
  29. package/types/src/anchored/AnchoredMap.d.ts +2 -0
  30. package/types/src/anchored/IAnchoredMap.d.ts +52 -4
  31. package/types/src/autoFill/AutoFill.d.ts +316 -32
  32. package/types/src/autoFill/IAutoFill.d.ts +232 -15
  33. package/types/src/border/{IBorder.d.ts → IBorders.d.ts} +41 -40
  34. package/types/src/border/index.d.ts +1 -1
  35. package/types/src/calculation/Calculation.d.ts +740 -35
  36. package/types/src/calculation/ExternalBookBindings.d.ts +118 -0
  37. package/types/src/calculation/FormulaText.d.ts +74 -0
  38. package/types/src/calculation/ICalculation.d.ts +318 -81
  39. package/types/src/calculation/INamedFormulasCollection.d.ts +5 -8
  40. package/types/src/calculation/NamedFormulaCollection.d.ts +139 -107
  41. package/types/src/calculation/NamedLambdaFunction.d.ts +28 -0
  42. package/types/src/calculation/TokenType.d.ts +9 -0
  43. package/types/src/calculation/Types.d.ts +83 -2
  44. package/types/src/calculation/_CloneBoundary.d.ts +80 -0
  45. package/types/src/calculation/compiler/ASTTypes.d.ts +58 -0
  46. package/types/src/calculation/compiler/CompilerUtils.d.ts +134 -12
  47. package/types/src/calculation/compiler/FormulaCompiler.d.ts +29 -4
  48. package/types/src/calculation/compiler/FormulaParser.d.ts +1 -2
  49. package/types/src/calculation/compiler/LiteTransform.d.ts +17 -0
  50. package/types/src/calculation/compiler/ParserUtils.d.ts +26 -1
  51. package/types/src/calculation/compiler/SRParser.d.ts +2 -1
  52. package/types/src/calculation/compiler/Types.d.ts +79 -9
  53. package/types/src/calculation/executor/CalcExecutor.d.ts +312 -33
  54. package/types/src/calculation/executor/CalcExecutorUtils.d.ts +43 -2
  55. package/types/src/calculation/executor/CircularReference.d.ts +2 -0
  56. package/types/src/calculation/formula/Formula.d.ts +58 -21
  57. package/types/src/calculation/formula/FormulaBlock.d.ts +124 -21
  58. package/types/src/calculation/formula/FormulaRecordView.d.ts +79 -0
  59. package/types/src/calculation/formula/IFormulaBlock.d.ts +261 -67
  60. package/types/src/calculation/formula/LambdaValue.d.ts +15 -16
  61. package/types/src/calculation/formula/LazyValue.d.ts +96 -0
  62. package/types/src/calculation/formula/TokenUtils.d.ts +25 -1
  63. package/types/src/calculation/formula/index.d.ts +1 -0
  64. package/types/src/calculation/functions/FunctionDeclarations.d.ts +31 -0
  65. package/types/src/calculation/functions/initializeFunctions.d.ts +15 -2
  66. package/types/src/calculation/grid/CalcGrid.d.ts +384 -158
  67. package/types/src/calculation/grid/CalcGridBackend.d.ts +450 -0
  68. package/types/src/calculation/grid/CalcGridProxy.d.ts +133 -0
  69. package/types/src/calculation/grid/CalcGridUtils.d.ts +62 -12
  70. package/types/src/calculation/grid/FormulaEntry.d.ts +129 -0
  71. package/types/src/calculation/grid/FormulaHost.d.ts +236 -0
  72. package/types/src/calculation/grid/ICalcGrid.d.ts +456 -143
  73. package/types/src/calculation/grid/_CalcRequest.d.ts +272 -0
  74. package/types/src/calculation/grid/index.d.ts +4 -0
  75. package/types/src/calculation/index.d.ts +2 -0
  76. package/types/src/calculation/spatial/ContentfulSpatialValue.d.ts +6 -2
  77. package/types/src/calculation/spatial/FormulaSpatialValue.d.ts +339 -11
  78. package/types/src/calculation/spatial/SpillEntry.d.ts +20 -5
  79. package/types/src/calculation/spatial/TouchedWindows.d.ts +86 -0
  80. package/types/src/calculation/spatial/index.d.ts +1 -0
  81. package/types/src/calculation/state/CalcInputs.d.ts +41 -0
  82. package/types/src/calculation/state/CalcNode.d.ts +141 -30
  83. package/types/src/calculation/state/CalcScope.d.ts +37 -0
  84. package/types/src/calculation/state/CalcState.d.ts +22 -1
  85. package/types/src/calculation/state/CalculationContext.d.ts +36 -2
  86. package/types/src/calculation/state/IContextContainer.d.ts +129 -27
  87. package/types/src/calculation/state/_PendingOverlayGrid.d.ts +163 -0
  88. package/types/src/calculation/state/_ReadObservedGrid.d.ts +74 -8
  89. package/types/src/calculation/state/index.d.ts +1 -0
  90. package/types/src/calculation/symbol/ExternalSheetSymbols.d.ts +80 -0
  91. package/types/src/calculation/symbol/ISymbolRegistry.d.ts +23 -0
  92. package/types/src/calculation/symbol/IndirectSymbolProvider.d.ts +16 -2
  93. package/types/src/calculation/symbol/SheetSymbolProvider.d.ts +63 -3
  94. package/types/src/calculation/symbol/SymbolRegistry.d.ts +20 -0
  95. package/types/src/calculation/symbol/index.d.ts +3 -2
  96. package/types/src/cell/ICell.d.ts +78 -23
  97. package/types/src/cell/ICellProtection.d.ts +50 -10
  98. package/types/src/cellRange/ICellRange.d.ts +329 -72
  99. package/types/src/cellRange/ICellRanges.d.ts +9 -7
  100. package/types/src/chart/Chart.d.ts +72 -2
  101. package/types/src/chart/ChartCollection.d.ts +26 -0
  102. package/types/src/chart/IChart.d.ts +162 -9
  103. package/types/src/chart/IChartCollection.d.ts +25 -0
  104. package/types/src/chart/_ChartXml.d.ts +70 -0
  105. package/types/src/chart/index.d.ts +1 -3
  106. package/types/src/collections/ArraysGrid.d.ts +1 -1
  107. package/types/src/collections/IGrid.d.ts +1 -1
  108. package/types/src/collections/ISparseGrid.d.ts +9 -0
  109. package/types/src/collections/ISpatialMap.d.ts +59 -21
  110. package/types/src/collections/ImmutableList.d.ts +28 -0
  111. package/types/src/collections/MixedTypedArrayList.d.ts +168 -108
  112. package/types/src/collections/OverlappingRangeIterator.d.ts +13 -17
  113. package/types/src/collections/RepeatingList.d.ts +7 -0
  114. package/types/src/collections/ScalarGrid.d.ts +50 -0
  115. package/types/src/collections/SparseGrid.d.ts +1 -1
  116. package/types/src/collections/SpatialMap.d.ts +13 -21
  117. package/types/src/collections/Tuple.d.ts +128 -16
  118. package/types/src/collections/_GridUtils.d.ts +19 -6
  119. package/types/src/collections/_RangeSweep.d.ts +97 -0
  120. package/types/src/collections/_SpatialUtils.d.ts +20 -2
  121. package/types/src/collections/index.d.ts +1 -0
  122. package/types/src/comment/Comment.d.ts +159 -0
  123. package/types/src/comment/CommentCollection.d.ts +40 -0
  124. package/types/src/comment/IComment.d.ts +319 -48
  125. package/types/src/comment/ICommentCollection.d.ts +90 -0
  126. package/types/src/comment/_CommentUtils.d.ts +28 -0
  127. package/types/src/comment/index.d.ts +1 -0
  128. package/types/src/condition/AnchoredConditional.d.ts +76 -17
  129. package/types/src/condition/BuiltInOperators/AbstractOperator.d.ts +8 -7
  130. package/types/src/condition/BuiltInOperators/EqualToOperator.d.ts +2 -1
  131. package/types/src/condition/BuiltInOperators/ExpressionOperator.d.ts +3 -6
  132. package/types/src/condition/BuiltInOperators/InSetOperator.d.ts +1 -1
  133. package/types/src/condition/BuiltinSelectors/BaseSelector.d.ts +7 -0
  134. package/types/src/condition/BuiltinSelectors/ListSelector.d.ts +9 -0
  135. package/types/src/condition/Condition.d.ts +16 -0
  136. package/types/src/condition/ICondition.d.ts +86 -33
  137. package/types/src/condition/_ConditionFormula.d.ts +152 -0
  138. package/types/src/condition/_ConditionUtils.d.ts +73 -10
  139. package/types/src/conditionalFormat/ConditionalFormat.d.ts +21 -10
  140. package/types/src/conditionalFormat/ConditionalFormatCollection.d.ts +19 -8
  141. package/types/src/conditionalFormat/IConditionalFormat.d.ts +5 -3
  142. package/types/src/conditionalFormat/IConditionalFormatCollection.d.ts +2 -0
  143. package/types/src/dataValidation/DataValidation.d.ts +50 -3
  144. package/types/src/dataValidation/DataValidationCollection.d.ts +20 -9
  145. package/types/src/dataValidation/IDataValidation.d.ts +119 -30
  146. package/types/src/dataValidation/IDataValidationCollection.d.ts +10 -2
  147. package/types/src/date/DateUtils.d.ts +20 -0
  148. package/types/src/date/_DateUtils.d.ts +91 -7
  149. package/types/src/externalBook/ExternalBookCollection.d.ts +145 -12
  150. package/types/src/externalBook/ExternalBookName.d.ts +96 -0
  151. package/types/src/externalBook/IExternalBook.d.ts +170 -18
  152. package/types/src/externalBook/IExternalBookCollection.d.ts +79 -7
  153. package/types/src/externalBook/index.d.ts +1 -0
  154. package/types/src/fill/IStroke.d.ts +1 -1
  155. package/types/src/filter/IFilter.d.ts +29 -4
  156. package/types/src/font/IFont.d.ts +17 -0
  157. package/types/src/history/IHistory.d.ts +3 -2
  158. package/types/src/i18n/LanguagePack.d.ts +12 -4
  159. package/types/src/index.d.ts +3 -0
  160. package/types/src/io/AbstractBackingStore.d.ts +24 -1
  161. package/types/src/io/ArrayBackingStore.d.ts +1 -1
  162. package/types/src/io/EmbeddedPart.d.ts +20 -0
  163. package/types/src/io/IEmbeddedPart.d.ts +63 -0
  164. package/types/src/io/IWorkbookIO.d.ts +185 -18
  165. package/types/src/io/WorkbookIO.d.ts +9 -0
  166. package/types/src/io/WorkbookOrigin.d.ts +20 -11
  167. package/types/src/io/WorkbookOriginProvider.d.ts +46 -0
  168. package/types/src/io/_XmlFragment.d.ts +49 -0
  169. package/types/src/io/index.d.ts +1 -0
  170. package/types/src/lib/file/file.browser.d.ts +19 -5
  171. package/types/src/lib/file/file.node.d.ts +5 -0
  172. package/types/src/lib/utils/_Utils.d.ts +11 -0
  173. package/types/src/lib/utils/utils.browser.d.ts +9 -3
  174. package/types/src/license/license-key.d.ts +27 -0
  175. package/types/src/listener/IListener.d.ts +12 -7
  176. package/types/src/listener/ListenerEmitter.d.ts +46 -5
  177. package/types/src/model/AbstractModel.d.ts +14 -5
  178. package/types/src/movable/Control.d.ts +57 -0
  179. package/types/src/movable/IControl.d.ts +84 -0
  180. package/types/src/movable/IMovable.d.ts +23 -1
  181. package/types/src/movable/IMovableCollection.d.ts +2 -0
  182. package/types/src/movable/Movable.d.ts +4 -6
  183. package/types/src/movable/MovableCollection.d.ts +7 -7
  184. package/types/src/movable/index.d.ts +4 -0
  185. package/types/src/named/AbstractNamed.d.ts +1 -1
  186. package/types/src/named/INamed.d.ts +4 -1
  187. package/types/src/named/INamedCollection.d.ts +26 -0
  188. package/types/src/named/NamedCollection.d.ts +16 -15
  189. package/types/src/numFmt/BuiltInFormats.d.ts +15 -7
  190. package/types/src/numFmt/IFormatEngine.d.ts +2 -0
  191. package/types/src/numFmt/NumfmtFormatEngine.d.ts +2 -0
  192. package/types/src/person/IPerson.d.ts +99 -0
  193. package/types/src/person/IPersonCollection.d.ts +51 -0
  194. package/types/src/person/Person.d.ts +32 -0
  195. package/types/src/person/PersonCollection.d.ts +49 -0
  196. package/types/src/person/index.d.ts +3 -0
  197. package/types/src/picture/IPicture.d.ts +2 -0
  198. package/types/src/picture/Picture.d.ts +2 -0
  199. package/types/src/pivot/IPivotTable.d.ts +107 -0
  200. package/types/src/pivot/IPivotTableCollection.d.ts +25 -0
  201. package/types/src/pivot/PivotTable.d.ts +57 -0
  202. package/types/src/pivot/PivotTableCollection.d.ts +25 -0
  203. package/types/src/pivot/index.d.ts +6 -0
  204. package/types/src/primitives/CompositeRangeStats.d.ts +2 -0
  205. package/types/src/primitives/Criteria.d.ts +1 -1
  206. package/types/src/primitives/LambdaBrand.d.ts +21 -0
  207. package/types/src/primitives/PrimitiveUtils.d.ts +56 -19
  208. package/types/src/primitives/Range.d.ts +102 -24
  209. package/types/src/primitives/RangeStats.d.ts +24 -1
  210. package/types/src/primitives/ReferenceRange.d.ts +42 -0
  211. package/types/src/primitives/Runtime.d.ts +15 -2
  212. package/types/src/primitives/stats/FrequencyStats.d.ts +9 -0
  213. package/types/src/primitives/stats/LookupIndex.d.ts +46 -0
  214. package/types/src/primitives/stats/SortedNumbers.d.ts +2 -0
  215. package/types/src/primitives/stats/index.d.ts +1 -0
  216. package/types/src/print/IPrint.d.ts +0 -22
  217. package/types/src/protectedRange/IProtectedRange.d.ts +4 -0
  218. package/types/src/protectedRange/IProtectedRangeCollection.d.ts +2 -0
  219. package/types/src/protectedRange/ProtectedRange.d.ts +1 -4
  220. package/types/src/protectedRange/ProtectedRangeCollection.d.ts +19 -8
  221. package/types/src/protection/DefaultProtection.d.ts +12 -1
  222. package/types/src/protection/IProtection.d.ts +36 -2
  223. package/types/src/reference/ReferenceUtils.d.ts +80 -0
  224. package/types/src/reference/index.d.ts +2 -0
  225. package/types/src/resource/IResource.d.ts +21 -1
  226. package/types/src/resource/IResourceCollection.d.ts +9 -1
  227. package/types/src/resource/ResourceCollection.d.ts +6 -6
  228. package/types/src/scripting/FunctionCollection.d.ts +41 -11
  229. package/types/src/scripting/IFunctionCollection.d.ts +41 -0
  230. package/types/src/scripting/IModule.d.ts +25 -0
  231. package/types/src/scripting/IModuleCollection.d.ts +17 -0
  232. package/types/src/scripting/IScript.d.ts +18 -0
  233. package/types/src/scripting/Module.d.ts +34 -6
  234. package/types/src/scripting/ModuleCollection.d.ts +17 -12
  235. package/types/src/scripting/Runtime.d.ts +15 -0
  236. package/types/src/scripting/Scripts.d.ts +2 -0
  237. package/types/src/scripting/TypedFunction.d.ts +151 -18
  238. package/types/src/scripting/_FunctionIndex.d.ts +5 -0
  239. package/types/src/scripting/_ModuleUtils.d.ts +11 -1
  240. package/types/src/scripting/_ScriptUtils.d.ts +3 -0
  241. package/types/src/scripting/declarations.browser.d.ts +10 -0
  242. package/types/src/scripting/declarations.d.ts +49 -0
  243. package/types/src/scripting/declarations.node.d.ts +9 -0
  244. package/types/src/scripting/index.d.ts +3 -0
  245. package/types/src/selection/IRangeSelection.d.ts +9 -4
  246. package/types/src/selection/RangeSelection.d.ts +2 -0
  247. package/types/src/shape/IShape.d.ts +41 -3
  248. package/types/src/shape/Shape.d.ts +10 -0
  249. package/types/src/shape/_ShapeXml.d.ts +28 -0
  250. package/types/src/sheet/CellRegion.d.ts +6 -0
  251. package/types/src/sheet/ICellContainerOptions.d.ts +50 -0
  252. package/types/src/sheet/ISheet.d.ts +224 -41
  253. package/types/src/sheet/ISheetCollection.d.ts +2 -5
  254. package/types/src/sheet/NamedCellRange.d.ts +16 -7
  255. package/types/src/sheet/Sheet.d.ts +749 -114
  256. package/types/src/sheet/SheetCell.d.ts +81 -21
  257. package/types/src/sheet/SheetCollection.d.ts +19 -8
  258. package/types/src/sheet/SheetRange.d.ts +62 -14
  259. package/types/src/sheet/SheetRanges.d.ts +4 -6
  260. package/types/src/sheet/_CellBuffer.d.ts +214 -0
  261. package/types/src/sheet/_InvalidSheetRange.d.ts +5 -5
  262. package/types/src/sheet/_ListenerAnchor.d.ts +104 -0
  263. package/types/src/sheet/_RangeStateSweep.d.ts +16 -0
  264. package/types/src/sheet/_ScalarListFactory.d.ts +61 -0
  265. package/types/src/sheet/_SheetAutoFillUtils.d.ts +74 -0
  266. package/types/src/sheet/_SheetAutoFitUtils.d.ts +2 -2
  267. package/types/src/sheet/_SheetEvents.d.ts +43 -0
  268. package/types/src/sheet/_SheetFilterUtils.d.ts +32 -1
  269. package/types/src/sheet/_SheetIntents.d.ts +250 -0
  270. package/types/src/sheet/_SheetMutations.d.ts +179 -59
  271. package/types/src/sheet/_SheetStateReader.d.ts +16 -10
  272. package/types/src/sheet/_SheetStateTypes.d.ts +57 -73
  273. package/types/src/sheet/_SheetUtils.d.ts +2 -18
  274. package/types/src/sheet/_WatchAnchor.d.ts +93 -0
  275. package/types/src/sheet/spatial/HeldFormulaEntry.d.ts +36 -0
  276. package/types/src/sheet/spatial/index.d.ts +1 -0
  277. package/types/src/sheet/style/SheetCellStyle.d.ts +91 -64
  278. package/types/src/sheet/style/SheetDirectStyle.d.ts +16 -5
  279. package/types/src/sheet/style/_Resolvers.d.ts +5 -3
  280. package/types/src/sheet/style/_StyleUtils.d.ts +37 -7
  281. package/types/src/sheetHeader/ISheetHeader.d.ts +2 -0
  282. package/types/src/sheetHeader/SheetHeader.d.ts +14 -0
  283. package/types/src/sheetProtection/ISheetProtection.d.ts +41 -7
  284. package/types/src/sheetProtection/SheetProtection.d.ts +12 -0
  285. package/types/src/sheetView/ISheetView.d.ts +45 -1
  286. package/types/src/sheetView/SheetView.d.ts +11 -0
  287. package/types/src/slicer/ISlicer.d.ts +2 -0
  288. package/types/src/slicer/Slicer.d.ts +2 -0
  289. package/types/src/sort/ISort.d.ts +2 -0
  290. package/types/src/string/IStringCollection.d.ts +5 -0
  291. package/types/src/string/StringCollection.d.ts +6 -6
  292. package/types/src/style/INamedStyleCollection.d.ts +72 -0
  293. package/types/src/style/IStyle.d.ts +30 -10
  294. package/types/src/style/IStyleCollection.d.ts +63 -42
  295. package/types/src/style/ITableStyleCollection.d.ts +89 -0
  296. package/types/src/style/NamedStyleCollection.d.ts +39 -0
  297. package/types/src/style/StyleCollection.d.ts +41 -5
  298. package/types/src/style/TableStyleCollection.d.ts +49 -0
  299. package/types/src/style/_BuiltInStyleDefs.d.ts +3 -3
  300. package/types/src/style/index.d.ts +4 -0
  301. package/types/src/table/AnchoredTable.d.ts +644 -68
  302. package/types/src/table/AutoTable.d.ts +5 -5
  303. package/types/src/table/ITable.d.ts +228 -30
  304. package/types/src/table/ITableCollection.d.ts +2 -0
  305. package/types/src/table/TableCollection.d.ts +19 -8
  306. package/types/src/table/_FilterField.d.ts +7 -5
  307. package/types/src/table/_NamedTable.d.ts +17 -1
  308. package/types/src/table/_NamedTableSource.d.ts +1 -0
  309. package/types/src/table/_SortField.d.ts +2 -0
  310. package/types/src/table/_TableColumn.d.ts +13 -2
  311. package/types/src/table/_TableMessages.d.ts +1 -0
  312. package/types/src/table/_TableUtils.d.ts +40 -0
  313. package/types/src/text/Bullet.d.ts +4 -0
  314. package/types/src/text/ITextFrame.d.ts +25 -1
  315. package/types/src/text/TextBoxAlignment.d.ts +15 -6
  316. package/types/src/text/TextFrame.d.ts +4 -0
  317. package/types/src/text/TextLine.d.ts +4 -0
  318. package/types/src/text/TextParagraph.d.ts +4 -0
  319. package/types/src/text/TextRun.d.ts +9 -0
  320. package/types/src/text/TextStacked.d.ts +83 -0
  321. package/types/src/text/index.d.ts +1 -0
  322. package/types/src/theme/ITheme.d.ts +2 -0
  323. package/types/src/theme/IThemeCollection.d.ts +2 -0
  324. package/types/src/theme/ThemeCollection.d.ts +8 -7
  325. package/types/src/transaction/ITransaction.d.ts +238 -36
  326. package/types/src/transaction/Transaction.d.ts +99 -11
  327. package/types/src/type/AbstractCollection.d.ts +101 -0
  328. package/types/src/type/ICollection.d.ts +117 -0
  329. package/types/src/type/ITypes.d.ts +9 -7
  330. package/types/src/type/index.d.ts +1 -0
  331. package/types/src/utils/_CSSUtils.d.ts +3 -3
  332. package/types/src/workbook/IWorkbook.d.ts +171 -40
  333. package/types/src/workbook/Workbook.d.ts +103 -7
  334. package/types/src/workbook/_WorkbookIntents.d.ts +36 -0
  335. package/types/src/workbookProtection/IWorkbookProtection.d.ts +7 -0
  336. package/types/src/workbookProtection/WorkbookProtection.d.ts +3 -0
  337. package/types/src/workbookView/IWorkbookView.d.ts +12 -0
  338. package/types/src/workbookView/WorkbookView.d.ts +5 -0
  339. package/browser/cjs/BatsV2UUraVDCRXm.cjs +0 -57
  340. package/browser/cjs/CUz53T65cRGQRgvv.cjs +0 -33
  341. package/browser/cjs/DU0kYUtdFa3jK-im.cjs +0 -1
  342. package/browser/cjs/Dv4yIPLV98M5zLHa.cjs +0 -1
  343. package/browser/esm/6JKSOvc5czaQB2Bj.mjs +0 -109
  344. package/browser/esm/BtuJ9AGzeURtAsGo.mjs +0 -51241
  345. package/browser/esm/DGU6sM25u0EWCKl1.mjs +0 -824
  346. package/browser/esm/f2G3QRgEbvFJcoa2.mjs +0 -4436
  347. package/node/esm/-pxdn3M3tc6PLHs7.mjs +0 -114
  348. package/node/esm/0n5bslM9jhO1JnI2.mjs +0 -843
  349. package/types/src/cellRange/_GraphNode.d.ts +0 -38
  350. package/types/src/dataValidation/_Utils.d.ts +0 -10
  351. package/types/src/sheet/listener/RangesListener.d.ts +0 -32
  352. package/types/src/sheet/listener/RangesListenerEntry.d.ts +0 -19
  353. package/types/src/sheet/listener/index.d.ts +0 -3
@@ -1,4 +1,4 @@
1
- import { IRange } from '@sheetxl/primitives';
1
+ import { IRange, Scalar } from '@sheetxl/primitives';
2
2
  import { ReferenceableClipboard } from '@sheetxl/utils';
3
3
  import { ITransaction } from '../transaction';
4
4
  import { IHistory } from '../history';
@@ -9,10 +9,19 @@ import { ICondition } from '../condition';
9
9
  import { ICellRange, ICellRanges } from '../cellRange';
10
10
  import { IDataValidationCollection } from './IDataValidationCollection';
11
11
  /**
12
- * Represents a data validation range.
12
+ * A data validation: a rule that a cell's value must satisfy, over one or more ranges of a sheet,
13
+ * with the prompt shown when the cell is selected and the alert for a value that fails.
13
14
  *
14
15
  * @remarks
15
- * Used for modifying the type and rules of a data validation entry.
16
+ * Validations may overlap, and every one covering a cell applies: the cell is valid only when each
17
+ * of them accepts its value. Where a single answer is needed, the rule with the lowest
18
+ * {@link getIndex} wins: the prompt is the first covering rule's that has one, the alert the first
19
+ * failing rule's, and the dropdown offers the items every covering list rule accepts. Excel keeps
20
+ * one validation per cell, and when it opens a file whose validations overlap it honors only the
21
+ * first; see {@link ICell.getDataValidation}.
22
+ *
23
+ * The rule judges the value a cell holds, whatever wrote it. A value set through the API, pasted
24
+ * or filled is never refused; it is simply invalid, and {@link getAlertAt} says so.
16
25
  */
17
26
  export interface IDataValidation extends IAnchored, ICondition.Stateful {
18
27
  /** @inheritdoc ICondition.Stateful.getCondition */
@@ -22,27 +31,57 @@ export interface IDataValidation extends IAnchored, ICondition.Stateful {
22
31
  */
23
32
  setCondition(condition: ICondition.Input | null, options?: ITransaction.OperationOptions): this;
24
33
  /**
25
- * Creates a default condition for the data validation based on its range and the data.
26
- */
27
- createDefaultCondition(): ICondition;
28
- /**
29
- * Returns the validation results at the specified cell coordinates.
34
+ * Whether the cell at the specified coordinates fails this validation.
35
+ *
36
+ * @param rowIndex The sheet row.
37
+ * @param columnIndex The sheet column.
30
38
  *
31
39
  * @remarks
32
- * If there are multiple validations this will return the first one to fail.
40
+ * This validation's answer alone. Where validations overlap, a cell is invalid when any of the
41
+ * ones covering it fails ({@link ICellRange.getDataValidations}).
42
+ *
43
+ * An empty cell fails when Ignore blank is off ({@link isIncludeBlanks} is `false`) and the rule
44
+ * rejects a blank there, as Excel's Circle Invalid Data circles it. With Ignore blank on, an
45
+ * empty cell never fails. A cell holding `""` (a formula's empty text) is a value, and is judged.
33
46
  */
34
47
  getAlertAt(rowIndex: number, columnIndex: number): boolean;
35
48
  /**
36
- * Returns an iterator that allows you to iterate over the individual alert entries within the range,
37
- * yielding pairs of `IteratorContext` and a `Value`.
49
+ * The cells that fail this validation, each as a `[coords, true]` entry, empty cells included.
38
50
  *
39
- * @returns An iterator that yields `ICellRange.Entry<IDataValidation.Results>` tuples for each value within the range.
51
+ * @param options `axis` and `reverse` set the order within each of the validation's ranges; the
52
+ * ranges are visited in their own order.
53
+ *
54
+ * @remarks
55
+ * Lazy: the cost is what the caller reads. Stop early to pay for the first few entries only. When
56
+ * empty cells pass (Ignore blank on), they are skipped without being visited. When they fail, a
57
+ * whole-column rule yields every one of its empty cells, so take what you need.
40
58
  */
41
59
  getAlertEntries(options?: ICellRange.IteratorOptions): IGrid.EntryIterator<boolean>;
42
60
  /**
43
- * Returns the count of alert entries within the range.
61
+ * The number of cells that fail this validation, empty cells included.
62
+ *
63
+ * @remarks
64
+ * A rule that judges every empty cell alike (no formula) counts them without visiting any. A rule
65
+ * with a formula, a custom formula or a range list source, reads each empty cell's answer, so
66
+ * the first call over a large range can be slow. The answer is kept until the values change.
44
67
  */
45
68
  getAlertCount(): number;
69
+ /**
70
+ * The items a list validation offers at a cell: what its in-cell dropdown lists.
71
+ *
72
+ * @param rowIndex The cell's row.
73
+ * @param columnIndex The cell's column. A relative source (`$F1:$G1`, `INDIRECT($E1)`) gives each
74
+ * cell its own list, as it does in Excel.
75
+ *
76
+ * @returns The items in source order, duplicates kept; empty when this is not a list validation or
77
+ * its source lists nothing. Blank source cells are not listed.
78
+ *
79
+ * @remarks
80
+ * Evaluated when asked, for one cell — the check itself does not need the items, so nothing is
81
+ * resolved until a dropdown or a preview asks. `text` is what a source cell shows (a date list
82
+ * reads as dates), the item itself for a literal list.
83
+ */
84
+ getListItemsAt(rowIndex: number, columnIndex: number): Promise<readonly IDataValidation.ListItem[]>;
46
85
  /**
47
86
  * Set whether to suppress the in-cell dropdown arrow for a list validation.
48
87
  *
@@ -59,10 +98,11 @@ export interface IDataValidation extends IAnchored, ICondition.Stateful {
59
98
  */
60
99
  isHideDropdown(): boolean;
61
100
  /**
62
- * Message for a user prompt.
101
+ * The message shown while a cell the rule covers is selected (Excel's *Input Message*).
63
102
  *
64
103
  * @remarks
65
- * This may be a tooltip or other indicator depending on the client.
104
+ * Shown only while {@link isShowPromptMessage} is on. Where validations overlap, the first
105
+ * covering rule with a prompt shows its own.
66
106
  */
67
107
  setPromptMessage(message: string, options?: ITransaction.OperationOptions): this;
68
108
  /**
@@ -80,7 +120,11 @@ export interface IDataValidation extends IAnchored, ICondition.Stateful {
80
120
  */
81
121
  getPromptTitle(): string;
82
122
  /**
83
- * Sets whether to show the prompt message when the cell is selected.
123
+ * Sets whether to show the prompt when a cell the rule covers is selected.
124
+ *
125
+ * @remarks
126
+ * Separate from the prompt's text, as in Excel: turning the prompt off keeps its title and
127
+ * message, and turning it back on shows them again.
84
128
  */
85
129
  setShowPromptMessage(show: boolean, options?: ITransaction.OperationOptions): this;
86
130
  /**
@@ -88,7 +132,7 @@ export interface IDataValidation extends IAnchored, ICondition.Stateful {
88
132
  */
89
133
  isShowPromptMessage(): boolean;
90
134
  /**
91
- * Message text of the alert.
135
+ * The message of the alert raised for a value that fails the rule (Excel's *Error Message*).
92
136
  */
93
137
  setAlertMessage(message: string, options?: ITransaction.OperationOptions): this;
94
138
  /**
@@ -106,7 +150,11 @@ export interface IDataValidation extends IAnchored, ICondition.Stateful {
106
150
  */
107
151
  getAlertTitle(): string;
108
152
  /**
109
- * Sets whether to show the alert message when the cell is selected.
153
+ * Sets whether a value that fails the rule raises the alert when a user enters it.
154
+ *
155
+ * @remarks
156
+ * With the alert off, a failing entry is accepted silently, whatever the {@link getAlertStyle}.
157
+ * It is still invalid: {@link getAlertAt} reports it either way.
110
158
  */
111
159
  setShowAlertMessage(show: boolean, options?: ITransaction.OperationOptions): this;
112
160
  /**
@@ -114,12 +162,20 @@ export interface IDataValidation extends IAnchored, ICondition.Stateful {
114
162
  */
115
163
  isShowAlertMessage(): boolean;
116
164
  /**
117
- * Sets the style of the alert shown when validation fails.
165
+ * Sets the style of the alert raised when a user enters a value that fails the rule.
118
166
  *
119
167
  * @remarks
120
- * This controls whether alert values are blocked (`Stop`),
121
- * allowed with a warning (`Warning`), or allowed with an informational
122
- * message (`Information`).
168
+ * `Stop` refuses the entry, `Warning` asks before accepting it, and `Information` accepts it with
169
+ * a message. Where validations overlap, the first failing rule's style is the one used.
170
+ *
171
+ * The alert answers what a user types or picks, as in Excel. A value written through the API,
172
+ * pasted or filled raises no alert and is never refused.
173
+ *
174
+ * The style applies only while {@link setShowAlertMessage} is on. With it off, an invalid entry
175
+ * is accepted without a word whatever the style, as in Excel, so a rule meant to refuse entry
176
+ * needs both.
177
+ *
178
+ * @defaultValue `Stop`
123
179
  */
124
180
  setAlertStyle(alertStyle: IDataValidation.AlertStyle, options?: ITransaction.OperationOptions): this;
125
181
  /**
@@ -127,10 +183,11 @@ export interface IDataValidation extends IAnchored, ICondition.Stateful {
127
183
  */
128
184
  getAlertStyle(): IDataValidation.AlertStyle;
129
185
  /**
130
- * If the cell has custom rendering.
186
+ * How a cell the rule covers asks to be drawn and edited, as keywords a client may honor.
131
187
  *
132
188
  * @remarks
133
- * This could be a list or a checkbox or a custom editor
189
+ * From the condition's selector. A list rule answers `list`, which is what an in-cell dropdown
190
+ * is shown for. Empty when the rule has no condition or nothing to ask for.
134
191
  */
135
192
  getRenderHints(): readonly string[];
136
193
  /**
@@ -154,12 +211,16 @@ export interface IDataValidation extends IAnchored, ICondition.Stateful {
154
211
  */
155
212
  update(update: Partial<IDataValidation.Properties> | IDataValidation, options?: ITransaction.OperationOptions): this;
156
213
  /**
157
- * Returns the index of this data validation within its container.
214
+ * Returns the index of this data validation within its container: its priority, `0` first.
215
+ *
216
+ * @remarks
217
+ * Where validations overlap, the lowest index supplies the prompt and the alert style; see
218
+ * {@link IDataValidation}. The writer saves the rules in this order.
158
219
  */
159
220
  getIndex(): number;
160
221
  /**
161
222
  * Sets the index of this data validation within its container.
162
- * @param index The new index to set.
223
+ * @param index The new index to set. See {@link getIndex}.
163
224
  */
164
225
  setIndex(index: number): this;
165
226
  /**
@@ -199,7 +260,7 @@ export interface IDataValidation extends IAnchored, ICondition.Stateful {
199
260
  readonly isIDataValidation: true;
200
261
  }
201
262
  /**
202
- * Capabilities for working with conditional styling ranges.
263
+ * Types for working with data validations.
203
264
  *
204
265
  * @see
205
266
  * ### **Interface**
@@ -215,19 +276,28 @@ export declare namespace IDataValidation {
215
276
  */
216
277
  const AlertStyle: {
217
278
  /**
218
- * Stops the user from entering alert data.
279
+ * Refuses an invalid entry.
219
280
  */
220
281
  readonly Stop: "stop";
221
282
  /**
222
- * Shows a warning message when the user enters alert data.
283
+ * Warns about an invalid entry and asks whether to keep it.
223
284
  */
224
285
  readonly Warning: "warning";
225
286
  /**
226
- * Shows an information message when the user enters alert data.
287
+ * Accepts an invalid entry with an informational message.
227
288
  */
228
289
  readonly Information: "information";
229
290
  };
230
291
  type AlertStyle = typeof AlertStyle[keyof typeof AlertStyle];
292
+ /**
293
+ * One item a list validation offers. See {@link IDataValidation.getListItemsAt}.
294
+ */
295
+ interface ListItem {
296
+ /** The value a pick enters. */
297
+ value: Scalar;
298
+ /** The item as shown. */
299
+ text: string;
300
+ }
231
301
  /**
232
302
  * A set of values that can be set on a IDataValidation.
233
303
  *
@@ -235,12 +305,31 @@ export declare namespace IDataValidation {
235
305
  * {@link IDataValidation}
236
306
  */
237
307
  interface Properties {
308
+ /** See {@link IDataValidation.setPromptMessage}. */
238
309
  prompt?: string;
310
+ /** See {@link IDataValidation.setPromptTitle}. */
239
311
  promptTitle?: string;
312
+ /**
313
+ * See {@link IDataValidation.setShowPromptMessage}.
314
+ *
315
+ * @defaultValue false
316
+ */
240
317
  showPromptMessage?: boolean;
318
+ /** See {@link IDataValidation.setAlertMessage}. */
241
319
  alert?: string;
320
+ /** See {@link IDataValidation.setAlertTitle}. */
242
321
  alertTitle?: string;
322
+ /**
323
+ * See {@link IDataValidation.setShowAlertMessage}.
324
+ *
325
+ * @defaultValue false
326
+ */
243
327
  showAlertMessage?: boolean;
328
+ /**
329
+ * See {@link IDataValidation.setAlertStyle}.
330
+ *
331
+ * @defaultValue `Stop`
332
+ */
244
333
  alertStyle?: IDataValidation.AlertStyle;
245
334
  /**
246
335
  * The predicate a value must satisfy to be valid.
@@ -7,7 +7,8 @@ import { IDataValidation } from './IDataValidation';
7
7
  */
8
8
  export interface IDataValidationCollection extends ICollection<IDataValidation> {
9
9
  /**
10
- * Returns items that match the filter criteria.
10
+ * Returns items that match the filter criteria, in priority order
11
+ * ({@link IDataValidation.getIndex}).
11
12
  *
12
13
  * If no filter criteria is provided, all items will be returned.
13
14
  *
@@ -18,7 +19,12 @@ export interface IDataValidationCollection extends ICollection<IDataValidation>
18
19
  * Add an `IDataValidation` to the container.
19
20
  *
20
21
  * @param address The address of the item. May name several discontiguous ranges.
21
- * @param options Additional options available when adding a table or a `boolean` that indicates if the table has headers.
22
+ * @param options The new validation's properties, and where it goes in priority order.
23
+ *
24
+ * @remarks
25
+ * A validation already covering some of the cells keeps them, and both apply there (see
26
+ * {@link IDataValidation}); Excel's dialog would replace it. To take cells away from an existing
27
+ * validation, clear them first with `ICellRange.clear(ICell.Content.DataValidations)`.
22
28
  */
23
29
  add(address: ICellRanges.Address | IDataValidation, options?: IDataValidationCollection.AddOptions): IDataValidation;
24
30
  /**
@@ -27,6 +33,8 @@ export interface IDataValidationCollection extends ICollection<IDataValidation>
27
33
  * @param template A template to use for the temporary item.
28
34
  */
29
35
  createItem(template?: IDataValidation): IDataValidation;
36
+ /** For runtime type checking. */
37
+ readonly isIDataValidationCollection: true;
30
38
  }
31
39
  /**
32
40
  * {@inheritDoc IDataValidationCollection}
@@ -1,3 +1,23 @@
1
+ /**
2
+ * The unit a date step counts — what makes one date series a different series from another.
3
+ *
4
+ * @remarks
5
+ * `Weekday` is a BUSINESS day: Saturday and Sunday are not units of it, so `Fri` plus one weekday
6
+ * is the following Monday.
7
+ *
8
+ * @see {@link IAutoFill.DateSeries}, which reports the unit a template turns out to hold.
9
+ */
10
+ export declare const DateUnit: {
11
+ /** A calendar day. */
12
+ readonly Day: "d";
13
+ /** A business day — Saturday and Sunday are skipped. */
14
+ readonly Weekday: "wd";
15
+ /** A calendar month, the day-of-month carried across it. */
16
+ readonly Month: "m";
17
+ /** A calendar year. */
18
+ readonly Year: "y";
19
+ };
20
+ export type DateUnit = typeof DateUnit[keyof typeof DateUnit];
1
21
  /**
2
22
  * Returns Date.now() rounded to a nearest time.
3
23
  *
@@ -1,5 +1,6 @@
1
1
  import { NumberFormatRef } from '../numFmt/BuiltInFormats';
2
2
  import { IRuntime } from '@sheetxl/primitives';
3
+ import { DateUnit } from './DateUtils';
3
4
  export declare const MAX_SERIAL_DATE = 2958465;
4
5
  export declare function isValidDate(d: any, jsDateOnly?: boolean): boolean;
5
6
  export declare function minutesSinceMidnight(date: Date): number;
@@ -7,12 +8,82 @@ export declare function dayDiff(d1: Date, d2: Date): number;
7
8
  export declare function monthDiff(startDate: Date, endDate: Date): number;
8
9
  export declare function yearDiff(d1: Date, d2: Date): number;
9
10
  export declare function dateUnitDiff(d1: Date, d2: Date, unit: DateUnit | string): number | undefined;
10
- export declare const DateUnit: {
11
- readonly Day: "d";
12
- readonly Month: "m";
13
- readonly Year: "y";
14
- };
15
- export type DateUnit = typeof DateUnit[keyof typeof DateUnit];
11
+ /**
12
+ * Days in a 1-based `month` — the real calendar. Excel's phantom `1900-02-29` is not modelled here;
13
+ * `serialFromCivil` carries it in serial space, which is where it matters.
14
+ */
15
+ export declare function daysInMonth(year: number, month: number): number;
16
+ /**
17
+ * The month a serial falls in, as a single ordinal, so a whole-month delta is plain subtraction.
18
+ * `NaN` for a serial outside the calendar.
19
+ */
20
+ export declare function serialMonthOrdinal(serial: number, date1904?: boolean): number;
21
+ /** The day-of-month a serial falls on, or `NaN` for a serial outside the calendar. */
22
+ export declare function serialDayOfMonth(serial: number, date1904?: boolean): number;
23
+ /** `true` when the serial falls on the last day of its own month. */
24
+ export declare function serialIsMonthEnd(serial: number, date1904?: boolean): boolean;
25
+ /**
26
+ * Step `count` whole months in SERIAL space — no `Date` is constructed. The day-of-month is kept
27
+ * where the target month is long enough and clamped where it is not (Excel's `EDATE`: Jan 31 plus
28
+ * one month is Feb 28), and because every step is measured from the same anchor serial a day
29
+ * clamped through a short month recovers afterwards (Dec 29 → Feb 28 → Mar 29).
30
+ *
31
+ * @param monthEnd Land on the target month's LAST day instead — Excel's end-of-month series, where
32
+ * Feb 28 continues Mar 31, Apr 30 rather than Mar 28, Apr 28.
33
+ *
34
+ * @remarks
35
+ * The time-of-day fraction rides along untouched.
36
+ */
37
+ export declare function addMonthsToSerial(serial: number, count: number, monthEnd?: boolean, date1904?: boolean): number;
38
+ /**
39
+ * `true` when the serial falls on a Saturday or a Sunday.
40
+ *
41
+ * @remarks
42
+ * A weekend serial has no business day of its own, so this is what a caller checks before reading
43
+ * {@link serialWeekdayOrdinal} as a position: the ordinal rounds a weekend forward to the following
44
+ * Monday, which is right for stepping and wrong for deciding whether a template is a weekday series.
45
+ */
46
+ export declare function serialIsWeekend(serial: number, date1904?: boolean): boolean;
47
+ /**
48
+ * A serial's position in the run of BUSINESS days, so a difference of two of these is a count of
49
+ * weekdays — `Fri` to the following `Mon` is `1`, not `3`.
50
+ *
51
+ * @remarks
52
+ * A weekend serial has no business day of its own and takes the following Monday's, which makes
53
+ * this monotonic but not injective: `Sat`, `Sun` and `Mon` all report the same ordinal, so a
54
+ * template of weekend dates reads as a step of zero rather than as a series.
55
+ */
56
+ export declare function serialWeekdayOrdinal(serial: number, date1904?: boolean): number;
57
+ /**
58
+ * Step `count` BUSINESS days in SERIAL space — Saturday and Sunday are skipped, and no `Date` is
59
+ * constructed. The time-of-day fraction rides along untouched.
60
+ *
61
+ * @remarks
62
+ * A weekend anchor is not a business day, so it steps off in the direction of travel first: a
63
+ * Saturday going forward is one step from Monday (Excel's `Fri + 1` and `Sat + 1` are both Monday),
64
+ * and going back is one step from Friday. A `count` of zero simply lands on the next business day,
65
+ * which is what Excel's weekday series does from a weekend.
66
+ */
67
+ export declare function addWeekdaysToSerial(serial: number, count: number, date1904?: boolean): number;
68
+ /** The number of days in `month` (0-based) of `year` — JS day `0` is the previous month's last. */
69
+ export declare function lastDayOfMonth(year: number, month: number): number;
70
+ /** `true` when `date` falls on the last day of its own month. */
71
+ export declare function isMonthEnd(date: Date): boolean;
72
+ /** A date's month as a single ordinal, so a whole-month delta is plain subtraction. */
73
+ export declare function monthOrdinal(date: Date): number;
74
+ /**
75
+ * Step `count` whole months from `date`, keeping the day-of-month where the target month is long
76
+ * enough and clamping it where it is not — Excel's `EDATE`: Jan 31 plus one month is Feb 28, NOT
77
+ * March 3. Because every step is measured from the same anchor, a day clamped through a short month
78
+ * recovers afterwards (Dec 29 → Feb 28 → Mar 29).
79
+ *
80
+ * @param monthEnd Land on the target month's LAST day instead of the anchor's day — Excel's
81
+ * end-of-month series, where Feb 28 continues Mar 31, Apr 30 rather than Mar 28, Apr 28.
82
+ *
83
+ * @remarks
84
+ * Time-of-day is carried through untouched.
85
+ */
86
+ export declare function addMonthsClamped(date: Date, count: number, monthEnd?: boolean): Date;
16
87
  export declare function addDateUnit(date: Date, count: number, unit: DateUnit | string): Date | null;
17
88
  export declare function stringToLocalDate(value: string): Date | null;
18
89
  export declare function isISODateString(value: string): boolean;
@@ -46,6 +117,19 @@ export interface ParsedDateTime {
46
117
  /**
47
118
  * Splits a serial date into its calendar and clock fields.
48
119
  *
120
+ * @remarks
121
+ * Excel resolves a serial to whole seconds by adding HALF A SECOND TO THE SERIAL and then
122
+ * truncating — not by rounding the seconds themselves. The distinction is measurable, because
123
+ * the addition happens at the serial's magnitude, where a day is ~3e-7 s wide in the last bit:
124
+ * 12:30:30.5 comes back as :30 (the half second is lost in the sum) while 23:59:59.5 comes back
125
+ * as the next day's midnight. So a serial within half a second of midnight belongs to the NEXT
126
+ * day, in every field at once — `DAY`, `MONTH`, `YEAR` and `WEEKDAY` move together with the
127
+ * clock.
128
+ *
129
+ * Not every date function reads its argument through this. `WEEKNUM`, `ISOWEEKNUM`, `DAYS`,
130
+ * `EDATE`, `EOMONTH`, `WORKDAY` and `NETWORKDAYS` TRUNCATE the same serial instead, and each
131
+ * floors before it gets here — a per-function fact, not a rule with exceptions.
132
+ *
49
133
  * @param reuseParts Avoids allocating a fresh `ParsedDateTime`:
50
134
  * - An object: the fields are written into THIS object, which is returned. The caller owns the
51
135
  * buffer's lifetime — do not hold onto a previous result across a reused call, each call
@@ -60,7 +144,7 @@ export declare function parseSerialDate(serialDate: number, date1904?: boolean,
60
144
  * Serial date from parsed date/time fields.
61
145
  *
62
146
  * Computed directly from the fields (see {@link serialFromFields}) rather than
63
- * by building a JS `Date` and converting it — that round trip was both lossy
147
+ * by building a JS `Date` and converting it — that round trip is both lossy
64
148
  * (~1e-12, catastrophic for bare times) and unable to express Excel's phantom
65
149
  * `1900-02-29`, which a `Date` normalizes away.
66
150
  */
@@ -1,36 +1,169 @@
1
+ import { IRange } from '@sheetxl/primitives';
2
+ import { AbstractCollection } from '../type';
3
+ import { ITransaction } from '../transaction';
4
+ import { IListener } from '../listener';
5
+ import { ICellRange } from '../cellRange';
1
6
  import { IExternalBook } from './IExternalBook';
2
7
  import { IExternalBookCollection } from './IExternalBookCollection';
3
8
  /**
4
- * Implementation for {@link IExternalBookCollection}.
9
+ * A single cached snapshot of another workbook — the read-only view over one {@link IExternalBook.JSON}.
5
10
  */
6
- export declare class ExternalBookCollection implements IExternalBookCollection {
11
+ declare class ExternalBook implements IExternalBook {
12
+ private _json;
13
+ private _id;
14
+ /** The owner, for the `[n]` projection — a book's position is the collection's fact, not its own. */
15
+ private _collection;
16
+ constructor(json: IExternalBook.JSON, id: string, collection: ExternalBookCollection);
17
+ getId(): string;
18
+ getDisplayName(sheetName?: string | null): string;
19
+ getSources(): readonly IExternalBook.SourceEntry[];
20
+ getSheetNames(): readonly string[];
21
+ getDefinedNames(): readonly IExternalBook.DefinedNameEntry[];
22
+ getSheetData(sheetIndex: number): IExternalBook.SheetData | null;
23
+ getDependents(): readonly IRange.Coords[];
24
+ delete(txOptions?: ITransaction.OperationOptions): void;
25
+ breakLink(txOptions?: ITransaction.OperationOptions): void;
26
+ refresh(): Promise<IExternalBook.RefreshResult>;
27
+ toJSON(): IExternalBook.JSON | null;
28
+ /** A copy holding a source's current contents in place of the cache; the sources stay. */
29
+ _withSnapshot(snapshot: IExternalBook.Snapshot): ExternalBook;
30
+ /** A copy with every cached sheet marked `refreshError` — the values themselves untouched. */
31
+ _withRefreshError(): ExternalBook;
32
+ /** A copy with one more sheet name — the book is immutable; the collection swaps it. */
33
+ _withSheetName(sheetName: string): ExternalBook;
34
+ readonly isIExternalBook: true;
35
+ }
36
+ interface State {
7
37
  /**
8
- * Positional, `[n]`-indexed (`_items[0]` is `[1]`) — `null` at a position is a DDE/OLE link or
38
+ * Positional, `[n]`-indexed (`items[0]` is `[1]`) — `null` at a position is a DDE/OLE link or
9
39
  * otherwise unmodeled. Gaps carry meaning (the position still counts), so this is never compacted.
10
40
  */
11
- private _items;
41
+ items: readonly (ExternalBook | null)[];
42
+ /**
43
+ * Runtime ids, parallel to {@link items} and one per POSITION — a `null` DDE/OLE slot gets one
44
+ * too, so a formula citing it keeps its place when a book in front of it is removed.
45
+ */
46
+ ids: readonly string[];
47
+ }
48
+ /**
49
+ * Implementation for {@link IExternalBookCollection}.
50
+ *
51
+ * @remarks
52
+ * The positional list lives in the transaction store rather than in fields, so `add`, `delete` and
53
+ * `breakLink` undo — and an undo brings a slot's id back with it, which is what heals the formulas
54
+ * that kept citing it (see {@link _remove}).
55
+ */
56
+ export declare class ExternalBookCollection extends AbstractCollection<IExternalBook> implements IExternalBookCollection {
57
+ protected _transactions: ITransaction.IStore;
58
+ private _stateId;
59
+ private _transactionsRemoveListener;
60
+ private _getDependentsById;
61
+ private _getSheetRange;
62
+ private readonly _resolver;
12
63
  constructor(options?: ExternalBookCollection.ConstructorOptions);
13
- [Symbol.iterator](): IterableIterator<IExternalBook>;
14
- /** Only the modeled books — gaps (DDE/OLE) are omitted, not positional. Use {@link getByIndex} for `[n]` lookup. */
15
- getItems(): IExternalBook[];
16
- getCount(): number;
17
- getByIndex(n: number): IExternalBook | null;
64
+ /**
65
+ * @internal
66
+ * The runtime id at `[n]` (1-based), including a DDE/OLE gap's, or `null` if there is no such
67
+ * position. `[n]` is where the SOURCE FILE stores a book — it renumbers when another is broken,
68
+ * and no surface a reader sees spells one — so this and its inverse are the compiler's, for
69
+ * parsing a typed `[7]` and for imaging an id back into canonical text. Not on
70
+ * {@link IExternalBookCollection}: a consumer wanting one book wants `getById`.
71
+ */
72
+ _getIdByIndex(n: number): string | null;
73
+ /**
74
+ * @internal
75
+ * The 1-based `[n]` a runtime id currently sits at, or `-1` — the inverse of
76
+ * {@link _getIdByIndex}. Linear: a workbook has a handful of books.
77
+ */
78
+ _getIndexById(id: string): number;
79
+ getById(id: string): IExternalBook | null;
80
+ /** Only the modeled books — gaps (DDE/OLE) are omitted, not positional. */
81
+ protected _getItems(): IExternalBook[];
82
+ /**
83
+ * @internal
84
+ * The book at `[n]` (1-based), or `null` where `n` is past the end or holds a DDE/OLE gap.
85
+ * Slot-numbered, so it is the compiler's and the tests' — not on
86
+ * {@link IExternalBookCollection}, where `at()` gives position among the books that exist and
87
+ * `toJSON()` gives the slots with their gaps.
88
+ */
89
+ _getByIndex(n: number): IExternalBook | null;
90
+ /** {@inheritDoc IExternalBookCollection.add} */
91
+ add(options: IExternalBookCollection.AddOptions, txOptions?: ITransaction.OperationOptions): IExternalBook;
92
+ /**
93
+ * @internal
94
+ * {@link IExternalBook.delete} — the book delegates here, where the state lives. Takes an id
95
+ * rather than a book so a DDE/OLE gap, which has no book object, can go too.
96
+ *
97
+ * @returns `false` if nothing was at that id.
98
+ */
99
+ _remove(id: string, txOptions?: ITransaction.OperationOptions): boolean;
100
+ /** @internal {@link IExternalBook.breakLink} — the book delegates here, where the state lives. */
101
+ _breakLink(id: string, txOptions?: ITransaction.OperationOptions): boolean;
102
+ /** {@inheritDoc IExternalBookCollection.breakAll} */
103
+ breakAll(txOptions?: ITransaction.OperationOptions): number;
104
+ /** {@inheritDoc IExternalBookCollection.refreshAll} */
105
+ refreshAll(): Promise<IExternalBook.RefreshResult[]>;
106
+ /**
107
+ * @internal
108
+ * {@link IExternalBook.refresh}: the resolver is asked, and its answer replaces the book's cache
109
+ * in one transaction — the engine rebuilds the book's grids from it on the change notification.
110
+ */
111
+ _refresh(bookId: string): Promise<IExternalBook.RefreshResult>;
112
+ /** Excel's record of a refresh that could not complete: `refreshError` on each cached sheet. */
113
+ protected _markRefreshError(bookId: string): void;
114
+ /**
115
+ * The value pass in front of a removal: every cell block that cites the book becomes its current
116
+ * values — the WHOLE formula, as Excel does, not only the external operand.
117
+ *
118
+ * @remarks
119
+ * A dependent that is a NAME (its scope is the name's virtual grid, not a sheet) is left as it
120
+ * is. Its citation then images as `#REF!` once the slot goes, which is one of the three outcomes
121
+ * DESIGN-EXTERNAL-LINKS §6 item 8 lists for Excel; the measurement that picks between them has
122
+ * not been taken, and a name has no computed value to write back until phase D in any case.
123
+ */
124
+ protected _breakDependents(book: IExternalBook): void;
125
+ /** @internal Backs {@link IExternalBook.getDependents}; empty without an engine to ask. */
126
+ _getDependents(bookId: string): readonly IRange.Coords[];
127
+ /**
128
+ * @internal
129
+ * Records a sheet name a formula cited on a book that did not list it — the authoring half of
130
+ * the bind rule (DESIGN-EXTERNAL-LINKS §5 step 13). Returns the sheet's index in the book.
131
+ */
132
+ _addSheetName(bookId: string, sheetName: string): number;
18
133
  toJSON(): (IExternalBook.JSON | null)[] | null;
134
+ /** {@inheritDoc IListener.ISource.addListeners} */
135
+ addListeners(listeners: IExternalBookCollection.IListeners, options?: IListener.Options): IListener.Remove;
136
+ close(): void;
137
+ protected _assertWritable(): void;
138
+ protected _getState(): State;
139
+ protected _beginCommit(options?: string | ITransaction.OperationOptions): ITransaction;
140
+ protected _updateState(state: (prevState: State) => State, options: ITransaction.OperationOptions): void;
19
141
  readonly isIExternalBookCollection: true;
20
142
  }
21
143
  export declare namespace ExternalBookCollection {
22
144
  interface ConstructorOptions {
23
145
  /**
24
146
  * Books to hydrate at construction, in `IWorkbook.JSON.externalBooks` order — which IS `[n]`
25
- * order (1-based). A `null` entry is a preserved gap (see {@link IExternalBookCollection.getByIndex}).
147
+ * order (1-based). A `null` entry is a preserved gap.
26
148
  *
27
149
  * @remarks
28
150
  * Taken here rather than through a separate `fromJSON()` call — mirrors
29
151
  * `NamedFormulaCollection`'s reasoning: this collection owns the items, so hydrating at
30
- * construction avoids a pre-load lifecycle state. Unlike named formulas, nothing here is
31
- * mutable yet, so there is no transactional persist scope to speak of either.
152
+ * construction avoids a pre-load lifecycle state.
32
153
  */
33
154
  json?: (IExternalBook.JSON | null)[];
155
+ /** Shared with the workbook so `add`/`delete`/`breakLink` undo with everything else. */
156
+ transactions?: ITransaction.IStore;
157
+ /** The engine's citation index — backs {@link IExternalBook.getDependents}. */
158
+ getDependents?: (bookId: string) => readonly IRange.Coords[];
159
+ /** Opens a source on refresh — `ICellContainerOptions.externalBookResolver`, for the collection's life. */
160
+ resolver?: IExternalBook.IResolver | null;
161
+ /**
162
+ * A range over a dependent's coords, whose `scope` is a sheet's stable id — or `null` for a
163
+ * scope that is not a sheet (a name's virtual grid). Backs the value pass of `breakLink`.
164
+ */
165
+ getSheetRange?: (coords: IRange.Coords) => ICellRange | null;
34
166
  }
35
167
  }
168
+ export {};
36
169
  //# sourceMappingURL=ExternalBookCollection.d.ts.map