@sheetxl/sdk 0.7.28-beta.4 → 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 (355) 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/Dg3GaW0QWwnlqetX.cjs +1 -0
  6. package/browser/cjs/KWQPie2u7AP69web.cjs +93 -0
  7. package/browser/cjs/index.cjs +2 -2
  8. package/browser/esm/{DBIu6NUHIcxOOBQp.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/{CHSahmMFYNB0Ajkf.mjs → Dq3sc4B_HQHBrT5N.mjs} +2 -2
  14. package/browser/esm/index.mjs +871 -696
  15. package/browser/esm/{CKk58ZLcrllMzfou.mjs → trwZArJQQq7K9kL7.mjs} +2 -2
  16. package/licenses/dependencies.txt +204 -204
  17. package/node/esm/CGWsQOMWdnDeF4dX.mjs +8 -0
  18. package/node/esm/{DUYP6faJJHCaW1Xf.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 +53973 -38584
  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 -4
  27. package/types/scripting.d.ts +7185 -1079
  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 +745 -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 +422 -34
  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 +160 -29
  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 +39 -3
  86. package/types/src/calculation/state/IContextContainer.d.ts +159 -26
  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 +368 -90
  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 +18 -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 +60 -21
  208. package/types/src/primitives/Range.d.ts +105 -25
  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/FunctionArguments.d.ts +22 -0
  229. package/types/src/scripting/FunctionCollection.d.ts +41 -11
  230. package/types/src/scripting/IFunctionCollection.d.ts +41 -0
  231. package/types/src/scripting/IModule.d.ts +25 -0
  232. package/types/src/scripting/IModuleCollection.d.ts +17 -0
  233. package/types/src/scripting/IScript.d.ts +18 -0
  234. package/types/src/scripting/Module.d.ts +34 -6
  235. package/types/src/scripting/ModuleCollection.d.ts +17 -12
  236. package/types/src/scripting/Runtime.d.ts +15 -0
  237. package/types/src/scripting/Scripts.d.ts +2 -0
  238. package/types/src/scripting/TypedFunction.d.ts +197 -4
  239. package/types/src/scripting/_FunctionIndex.d.ts +5 -0
  240. package/types/src/scripting/_ModuleUtils.d.ts +11 -1
  241. package/types/src/scripting/_ScriptUtils.d.ts +3 -0
  242. package/types/src/scripting/declarations.browser.d.ts +10 -0
  243. package/types/src/scripting/declarations.d.ts +49 -0
  244. package/types/src/scripting/declarations.node.d.ts +9 -0
  245. package/types/src/scripting/index.d.ts +3 -0
  246. package/types/src/selection/IRangeSelection.d.ts +9 -4
  247. package/types/src/selection/RangeSelection.d.ts +2 -0
  248. package/types/src/shape/IShape.d.ts +41 -3
  249. package/types/src/shape/Shape.d.ts +10 -0
  250. package/types/src/shape/_ShapeXml.d.ts +28 -0
  251. package/types/src/sheet/CellRegion.d.ts +6 -0
  252. package/types/src/sheet/ICellContainerOptions.d.ts +50 -0
  253. package/types/src/sheet/ISheet.d.ts +224 -41
  254. package/types/src/sheet/ISheetCollection.d.ts +2 -5
  255. package/types/src/sheet/NamedCellRange.d.ts +16 -7
  256. package/types/src/sheet/Sheet.d.ts +757 -114
  257. package/types/src/sheet/SheetCell.d.ts +81 -21
  258. package/types/src/sheet/SheetCollection.d.ts +19 -8
  259. package/types/src/sheet/SheetRange.d.ts +65 -14
  260. package/types/src/sheet/SheetRanges.d.ts +4 -6
  261. package/types/src/sheet/_CellBuffer.d.ts +214 -0
  262. package/types/src/sheet/_InvalidSheetRange.d.ts +5 -5
  263. package/types/src/sheet/_ListenerAnchor.d.ts +104 -0
  264. package/types/src/sheet/_RangeStateSweep.d.ts +16 -0
  265. package/types/src/sheet/_ScalarListFactory.d.ts +61 -0
  266. package/types/src/sheet/_SheetAutoFillUtils.d.ts +74 -0
  267. package/types/src/sheet/_SheetAutoFitUtils.d.ts +28 -0
  268. package/types/src/sheet/_SheetEvents.d.ts +43 -0
  269. package/types/src/sheet/_SheetFilterUtils.d.ts +32 -1
  270. package/types/src/sheet/_SheetIntents.d.ts +250 -0
  271. package/types/src/sheet/_SheetMutations.d.ts +179 -59
  272. package/types/src/sheet/_SheetStateReader.d.ts +16 -10
  273. package/types/src/sheet/_SheetStateTypes.d.ts +57 -73
  274. package/types/src/sheet/_SheetUtils.d.ts +2 -18
  275. package/types/src/sheet/_WatchAnchor.d.ts +93 -0
  276. package/types/src/sheet/spatial/HeldFormulaEntry.d.ts +36 -0
  277. package/types/src/sheet/spatial/index.d.ts +1 -0
  278. package/types/src/sheet/style/SheetCellStyle.d.ts +91 -64
  279. package/types/src/sheet/style/SheetDirectStyle.d.ts +16 -5
  280. package/types/src/sheet/style/_Resolvers.d.ts +5 -3
  281. package/types/src/sheet/style/_StyleUtils.d.ts +37 -7
  282. package/types/src/sheetHeader/ISheetHeader.d.ts +2 -0
  283. package/types/src/sheetHeader/SheetHeader.d.ts +14 -0
  284. package/types/src/sheetProtection/ISheetProtection.d.ts +41 -7
  285. package/types/src/sheetProtection/SheetProtection.d.ts +12 -0
  286. package/types/src/sheetView/ISheetView.d.ts +45 -1
  287. package/types/src/sheetView/SheetView.d.ts +11 -0
  288. package/types/src/slicer/ISlicer.d.ts +2 -0
  289. package/types/src/slicer/Slicer.d.ts +2 -0
  290. package/types/src/sort/ISort.d.ts +2 -0
  291. package/types/src/string/IStringCollection.d.ts +5 -0
  292. package/types/src/string/StringCollection.d.ts +6 -6
  293. package/types/src/style/INamedStyleCollection.d.ts +72 -0
  294. package/types/src/style/IStyle.d.ts +30 -10
  295. package/types/src/style/IStyleCollection.d.ts +63 -42
  296. package/types/src/style/ITableStyleCollection.d.ts +89 -0
  297. package/types/src/style/NamedStyleCollection.d.ts +39 -0
  298. package/types/src/style/StyleCollection.d.ts +41 -5
  299. package/types/src/style/TableStyleCollection.d.ts +49 -0
  300. package/types/src/style/_BuiltInStyleDefs.d.ts +3 -3
  301. package/types/src/style/index.d.ts +4 -0
  302. package/types/src/table/AnchoredTable.d.ts +644 -68
  303. package/types/src/table/AutoTable.d.ts +5 -5
  304. package/types/src/table/ITable.d.ts +228 -30
  305. package/types/src/table/ITableCollection.d.ts +2 -0
  306. package/types/src/table/TableCollection.d.ts +19 -8
  307. package/types/src/table/_FilterField.d.ts +7 -5
  308. package/types/src/table/_NamedTable.d.ts +17 -1
  309. package/types/src/table/_NamedTableSource.d.ts +1 -0
  310. package/types/src/table/_SortField.d.ts +2 -0
  311. package/types/src/table/_TableColumn.d.ts +13 -2
  312. package/types/src/table/_TableMessages.d.ts +1 -0
  313. package/types/src/table/_TableUtils.d.ts +40 -0
  314. package/types/src/text/Bullet.d.ts +4 -0
  315. package/types/src/text/ITextFrame.d.ts +25 -1
  316. package/types/src/text/TextBoxAlignment.d.ts +15 -6
  317. package/types/src/text/TextFrame.d.ts +4 -0
  318. package/types/src/text/TextLine.d.ts +4 -0
  319. package/types/src/text/TextParagraph.d.ts +4 -0
  320. package/types/src/text/TextRun.d.ts +9 -0
  321. package/types/src/text/TextStacked.d.ts +83 -0
  322. package/types/src/text/index.d.ts +1 -0
  323. package/types/src/theme/ITheme.d.ts +2 -0
  324. package/types/src/theme/IThemeCollection.d.ts +2 -0
  325. package/types/src/theme/ThemeCollection.d.ts +8 -7
  326. package/types/src/transaction/ITransaction.d.ts +238 -36
  327. package/types/src/transaction/Transaction.d.ts +99 -11
  328. package/types/src/type/AbstractCollection.d.ts +101 -0
  329. package/types/src/type/ICollection.d.ts +117 -0
  330. package/types/src/type/ITypes.d.ts +9 -7
  331. package/types/src/type/index.d.ts +1 -0
  332. package/types/src/utils/_CSSUtils.d.ts +3 -3
  333. package/types/src/workbook/IWorkbook.d.ts +171 -40
  334. package/types/src/workbook/Workbook.d.ts +103 -7
  335. package/types/src/workbook/_WorkbookIntents.d.ts +36 -0
  336. package/types/src/workbookProtection/IWorkbookProtection.d.ts +7 -0
  337. package/types/src/workbookProtection/WorkbookProtection.d.ts +3 -0
  338. package/types/src/workbookView/IWorkbookView.d.ts +12 -0
  339. package/types/src/workbookView/WorkbookView.d.ts +5 -0
  340. package/browser/cjs/BF14ZEAnaqxXroSj.cjs +0 -1
  341. package/browser/cjs/BXtvdT1Z-MsB_o5F.cjs +0 -1
  342. package/browser/cjs/Bc4JjVVZfFo3R4He.cjs +0 -33
  343. package/browser/cjs/CD2RXdnfqSYNc6gX.cjs +0 -57
  344. package/browser/cjs/DcLpXGexEtOxi-dD.cjs +0 -1
  345. package/browser/esm/0Mj5WKM362q6CECb.mjs +0 -824
  346. package/browser/esm/CPTtL2f6_4iblmFM.mjs +0 -4436
  347. package/browser/esm/CoA-sUxjiIUIpTUF.mjs +0 -109
  348. package/browser/esm/Dy4Sdpju1T2icURu.mjs +0 -50854
  349. package/node/esm/BtGxbEbBm79YvF_k.mjs +0 -843
  350. package/node/esm/DqgWsVXROpSgKq6c.mjs +0 -114
  351. package/types/src/cellRange/_GraphNode.d.ts +0 -38
  352. package/types/src/dataValidation/_Utils.d.ts +0 -10
  353. package/types/src/sheet/listener/RangesListener.d.ts +0 -32
  354. package/types/src/sheet/listener/RangesListenerEntry.d.ts +0 -19
  355. package/types/src/sheet/listener/index.d.ts +0 -3
@@ -22,7 +22,26 @@ export interface ITransaction {
22
22
  *
23
23
  * @param options A final description or options to apply on commit.
24
24
  */
25
- commit<View = any, P = any>(options?: ITransaction.StoreOperationOptions<View, P>): ITransaction;
25
+ commit<P = any>(options?: ITransaction.StoreOperationOptions<P>): ITransaction;
26
+ /**
27
+ * Close the transaction by folding its writes into the commit it opened on, rather than adding
28
+ * a step to the history.
29
+ *
30
+ * @param options A final description or options to apply, as for {@link commit}.
31
+ *
32
+ * @remarks
33
+ * The same fold as {@link IStore.amend}, which names the commit it lands in; this one always
34
+ * lands in the commit this transaction began from. Reach for `IStore.amend` when the writes
35
+ * belong to a commit you can name - what a calculation produced, where a listener registered -
36
+ * and this when they belong to wherever you started: a model folding its own initialization
37
+ * into the load it is happening during.
38
+ *
39
+ * Either way the writes add no undo entry and no audit of their own; they are undone with the
40
+ * commit they land in. On a nested transaction there is nothing to fold into and this is
41
+ * {@link commit}: the writes join the operation that is open, which is already not a step of
42
+ * their own.
43
+ */
44
+ amend<P = any>(options?: ITransaction.StoreOperationOptions<P>): ITransaction;
26
45
  /**
27
46
  * Discard all changes and children transaction changes.
28
47
  */
@@ -35,10 +54,29 @@ export interface ITransaction {
35
54
  * A unique id for this transaction. This will be the same id for all sub transactions.
36
55
  */
37
56
  getId(): string;
57
+ /**
58
+ * Identifies what a rollback of this transaction undoes on its own.
59
+ *
60
+ * @remarks
61
+ * A root's is its id. A nested transaction has one of its own, unless it was begun as a step
62
+ * of the one it is nested in ({@link ITransaction.StoreOperationOptions.savepoint}). It is the
63
+ * key for a copy-on-write structure that is changed in place: a copy taken under one savepoint
64
+ * is not reachable from a state that outlives that savepoint's rollback.
65
+ */
66
+ getSavepointId(): string;
38
67
  /**
39
68
  * Describes the current transaction.
40
69
  */
41
70
  getDescription(): string;
71
+ /**
72
+ * The operation this transaction was begun for ({@link ITransaction.StoreOperationOptions.operation}),
73
+ * or `null` when it was begun without one.
74
+ *
75
+ * @remarks
76
+ * Its own, not its root's: a transaction nested in an operation that did not name one of its
77
+ * own returns `null`. See {@link ICommit.getOperation} for the operation a commit records.
78
+ */
79
+ getOperation(): Readonly<ITransaction.Operation> | null;
42
80
  /**
43
81
  * 0-Based depth of the current transaction. If 0 then it's globally available.
44
82
  */
@@ -62,9 +100,37 @@ export interface ITransaction {
62
100
  */
63
101
  getStates(): Map<string, any>;
64
102
  /**
65
- * Returns the view associated with this transaction.
103
+ * Reads an intent recorded on the root of this transaction.
104
+ *
105
+ * @param key Names the intent. Owned by whoever records it.
106
+ *
107
+ * @see
108
+ * {@link setIntent}
109
+ */
110
+ getIntent<T = any>(key: string): T | undefined;
111
+ /**
112
+ * Records an intent on the root of this transaction: something to do once the operation
113
+ * completes, rather than a change to the state.
114
+ *
115
+ * @param key Names the intent. Owned by whoever records it.
116
+ * @param value The intent, or a function of the intent currently recorded under `key`.
117
+ *
118
+ * @remarks
119
+ * An intent is data - coords, ids and strings, never a model or a view. It is recorded on
120
+ * the **root**, so every nested transaction of an operation writes the same bag and a batch
121
+ * of N operations resolves one set of intents rather than N. It travels on the commit
122
+ * ({@link ICommit.getIntents}) and so is available again on undo and redo.
123
+ *
124
+ * The store gives a key no meaning and no merge rule beyond last-write-wins. An intent that
125
+ * accumulates - a union of ranges, say - passes a function and merges its own way. The write is
126
+ * kept, so an amend replays it onto the commit it folds into: the accumulating writer runs a
127
+ * second time, handed the TARGET's value, and the union spans both. What this transaction
128
+ * itself holds under the key stays its own contribution, which is what it announces. A writer
129
+ * must therefore produce a new value rather than mutate the one it is handed.
66
130
  */
67
- getView(): Record<string, any> | null;
131
+ setIntent<T = any>(key: string, value: T | ((prev: T | undefined) => T)): void;
132
+ /** For runtime type checking. */
133
+ readonly isITransaction: true;
68
134
  }
69
135
  /**
70
136
  * {@inheritDoc ITransaction}
@@ -179,6 +245,13 @@ export declare namespace ITransaction {
179
245
  * It is possible that a batch operation was used to create the commit.
180
246
  */
181
247
  getOperation(): Readonly<Operation>;
248
+ /**
249
+ * The intents recorded on the commit, keyed by name. Empty if it recorded none.
250
+ *
251
+ * @see
252
+ * {@link ITransaction.setIntent}
253
+ */
254
+ getIntents(): Readonly<Record<string, any>>;
182
255
  }
183
256
  /**
184
257
  * When the first transaction this will contain the name of parameters of the input
@@ -197,15 +270,6 @@ export declare namespace ITransaction {
197
270
  params?: PARAMS;
198
271
  }
199
272
  interface RestoreOptions {
200
- /**
201
- * If provided restore will only select if the view matches the id.
202
- *
203
- * @defaultValue undefined - Any view will be selected.
204
- *
205
- * @remarks
206
- * This is used for collaboration.
207
- */
208
- viewId?: string;
209
273
  /**
210
274
  * If true will force the restore even if there are open transactions.
211
275
  *
@@ -257,7 +321,7 @@ export declare namespace ITransaction {
257
321
  * @param stateId The store-issued record id ({@link create}).
258
322
  * @param listener
259
323
  */
260
- addStateListener<STATE = any, VIEW = any>(stateId: string, listener: ITransaction.IStateListener<STATE, VIEW>): IListener.Remove;
324
+ addStateListener<STATE = any>(stateId: string, listener: ITransaction.IStateListener<STATE>): IListener.Remove;
261
325
  /**
262
326
  * Returns the last commits of commits.
263
327
  * @param commitId The commit id to start from.
@@ -294,18 +358,51 @@ export declare namespace ITransaction {
294
358
  */
295
359
  isOpenTransaction(): boolean;
296
360
  /**
297
- * Returns the current view associated with the entire commit.
361
+ * Returns `true` while a {@link restore} or {@link revert} is being delivered to its
362
+ * listeners.
298
363
  *
299
364
  * @remarks
300
- * Will return `null` if there is no open transaction.
365
+ * No transaction is open then, but the store is mid-change: a listener that acts on what it
366
+ * hears (a transactional emitter listener, a model re-deriving from the restored snapshot)
367
+ * needs to know that the change it is hearing about is a restore, not an operation.
301
368
  */
302
- getPendingView(): Record<string, any> | null;
369
+ isRestoring(): boolean;
370
+ /**
371
+ * The root transaction of the operation that is open.
372
+ *
373
+ * @remarks
374
+ * `null` if none is. What it is for is reaching the operation from outside the call that
375
+ * began it - a model asked to record an intent on whatever is open rather than being handed
376
+ * the transaction. Writes made through it join that operation.
377
+ */
378
+ getPendingTransaction(): ITransaction | null;
379
+ /**
380
+ * The innermost open transaction: the one a transaction begun now would nest in.
381
+ *
382
+ * @remarks
383
+ * `null` if none is open. The root of the operation is {@link getPendingTransaction}.
384
+ */
385
+ getCurrentTransaction(): ITransaction | null;
303
386
  /**
304
387
  * Returns the current state associated to a model for the current transaction or globally if there are no open transactions.
305
388
  *
306
389
  * @param stateId The store-issued record id ({@link create}).
307
390
  */
308
391
  getState<STATE = any>(stateId: string): Readonly<STATE>;
392
+ /**
393
+ * Returns the state a record held as of a commit.
394
+ *
395
+ * @param commitId The commit whose snapshot to read.
396
+ * @param stateId The store-issued record id ({@link create}).
397
+ *
398
+ * @remarks
399
+ * The commit's snapshot, not the current state: what a derived write that lands late - a
400
+ * calculation's compile landing in the commit that entered a formula ({@link amend}) - reads
401
+ * so that it sees the inputs as they were when the operation was made, whatever has changed
402
+ * since. `undefined` when the store no longer holds the commit, or the record did not exist
403
+ * at it.
404
+ */
405
+ getStateAt<STATE = any>(commitId: string, stateId: string): Readonly<STATE> | undefined;
309
406
  /**
310
407
  * Returns the version id of a record at the current commit.
311
408
  *
@@ -333,6 +430,36 @@ export declare namespace ITransaction {
333
430
  * their own internal transactions.
334
431
  */
335
432
  doBatch<R>(callback: (commit: ITransaction.ICommit) => R | Promise<R>, options?: ITransaction.StoreOperationOptions, onClose?: ITransaction.CloseCallback): Promise<R> | R;
433
+ /**
434
+ * Fold a set of writes into an existing commit, by id, without a log entry.
435
+ *
436
+ * @param commitId The commit the writes belong to.
437
+ * @param callback Performs the writes, handed the commit they fold into (its intents are
438
+ * what an amend reads). Runs synchronously; whatever it commits joins the target rather than
439
+ * becoming a commit of its own.
440
+ *
441
+ * @remarks
442
+ * An amend is how derived data lands: what a calculation produced for a commit, or a listener
443
+ * registration that must never read as an edit. It is not a step in the history:
444
+ * * it adds no commit and fires no {@link IListeners.onCommitChange} / {@link IListeners.onCommitEnd},
445
+ * so the undo manager never sees it;
446
+ * * it leaves the tip where it is and prunes no redo branch, so it may target a commit the
447
+ * store has been restored to;
448
+ * * its intent writes are replayed onto the target, so an undo of that commit replays them
449
+ * and an accumulating {@link ITransaction.setIntent} writer unions with what the target
450
+ * already held;
451
+ * * state listeners are told what the amend recorded, not what the target holds.
452
+ *
453
+ * The writes read from and land in the named commit's own snapshot, whichever commit the
454
+ * store is at, and later snapshots are not touched: a later commit answers for its own
455
+ * writes. That is the fold for a result computed against a snapshot, a calculation's answer
456
+ * to a request made at that commit. A target that is not the current commit notifies no
457
+ * state listener; the current state did not change. A target the store no longer has folds
458
+ * into the current commit. Called while a transaction is open, the callback runs inside it
459
+ * and its writes land wherever that operation's commit does: an amend cannot re-target an
460
+ * operation in progress.
461
+ */
462
+ amend<R>(commitId: string, callback: (commit: ITransaction.ICommit) => R): R;
336
463
  /**
337
464
  * Create a record, minting its stable state id. The opposite of {@link remove}.
338
465
  *
@@ -370,8 +497,8 @@ export declare namespace ITransaction {
370
497
  */
371
498
  restore(commitId: string, options?: ITransaction.RestoreOptions): ITransaction.ICommit;
372
499
  /**
373
- * Revert is similar to restore in that it moves the state but it applies view
374
- * updates in reverse order.
500
+ * Revert is similar to restore in that it moves the state, but it replays the commit's
501
+ * intents in reverse - an undo lands where the operation began rather than where it ended.
375
502
  *
376
503
  * @param commitId
377
504
  * @param options
@@ -405,12 +532,47 @@ export declare namespace ITransaction {
405
532
  * * A restore/revert will trigger this event.
406
533
  */
407
534
  onCommitEnd?(commit: ITransaction.ICommit): void;
535
+ /**
536
+ * Called after an amend has landed in the commit it targets ({@link IStore.amend},
537
+ * {@link ITransaction.amend}).
538
+ *
539
+ * @param commit The commit that was amended.
540
+ *
541
+ * @remarks
542
+ * The counterpart of {@link onCommitEnd} for a change that is not a commit of its own: the
543
+ * history did not move, but the current snapshot did, and a listener deferring work until
544
+ * the store has settled needs to hear it.
545
+ */
546
+ onAmendEnd?(commit: ITransaction.ICommit): void;
408
547
  /**
409
548
  * Called if the commit changes for any reason.
410
549
  *
411
550
  * @param commit
412
551
  */
413
552
  onCommitChange?(commit: ITransaction.ICommit): void;
553
+ /**
554
+ * Called when the root transaction closes, whether it committed or rolled back.
555
+ *
556
+ * @param commit The commit handle.
557
+ * @param isRollback `true` if the transaction was rolled back.
558
+ * @param isElided `true` if the root wrote nothing and no commit will land.
559
+ *
560
+ * @remarks
561
+ * Called synchronously, once per operation, after the last nested transaction has closed and
562
+ * before the commit reaches the log. This is where an operation's intents
563
+ * ({@link ITransaction.setIntent}) are resolved: no transaction is open, so the work is not
564
+ * part of the commit, and the depth a nested operation ran at cannot make it fire early.
565
+ *
566
+ * A commit that wrote nothing is elided but still closes, so this still fires - and `isElided`
567
+ * is the only warning a listener gets that {@link onCommitEnd} is NOT coming. An amend closes
568
+ * here too, with `isAmend`: the id it closes under never lands, its writes fold into another
569
+ * commit ({@link onAmendEnd}). The three
570
+ * outcomes are distinct and a listener holding work until the operation settles has to tell
571
+ * them apart: a rollback (`isRollback`) discards what the operation announced, a landing
572
+ * commit releases it at {@link onCommitEnd}, and an elided root releases it here, because
573
+ * nothing further will happen.
574
+ */
575
+ onCommitClose?(commit: ITransaction.ICommit, isRollback: boolean, isElided?: boolean, isAmend?: boolean): void;
414
576
  }
415
577
  /**
416
578
  * A source of **durable-commit** notifications: something that announces when a store's committed
@@ -465,30 +627,31 @@ export declare namespace ITransaction {
465
627
  onCommit?(event: ITransaction.ICommitSource.CommitEvent): void;
466
628
  }
467
629
  }
468
- interface IStateListener<STATE = any, VIEW = any> {
630
+ interface IStateListener<STATE = any> {
469
631
  /**
470
632
  * Called synchronously at the beginning of a transaction before a record is changed.
471
633
  *
472
634
  * @remarks
473
635
  * If this throws an exception then all records within the transaction will not
474
- * be applied.
636
+ * be applied. `intents` are the record's so far: what the operation has declared about
637
+ * itself by the time it commits (see {@link ITransaction.setIntent}).
475
638
  */
476
- onBeforeCommitStart?(state: STATE, view: VIEW, commit: ITransaction.ICommit): void;
639
+ onBeforeCommitStart?(state: STATE, commit: ITransaction.ICommit, isRevert: boolean, isRestore: boolean, intents: Readonly<Record<string, any>>): void;
477
640
  /**
478
641
  * Called during a transaction.
479
642
  *
480
643
  * @remarks
481
- * This is when changes should be applied. The view will only be provided if restore is used.
644
+ * This is when changes should be applied.
482
645
  */
483
- onBeforeCommitEnd?(state: STATE, view: VIEW, commit: ITransaction.ICommit): void;
646
+ onBeforeCommitEnd?(state: STATE, commit: ITransaction.ICommit, isRevert: boolean, isRestore: boolean, intents: Readonly<Record<string, any>>): void;
484
647
  /**
485
648
  * Called after the transaction. This is generally used for cleanup or ui notification.
486
649
  */
487
- onAfterStateChange?(state: STATE, view: VIEW, commit: ITransaction.ICommit, isRevert: boolean, isRestore: boolean): void;
650
+ onAfterStateChange?(state: STATE, commit: ITransaction.ICommit, isRevert: boolean, isRestore: boolean, intents: Readonly<Record<string, any>>): void;
488
651
  /**
489
652
  * Called if the restore or revert is called. This is called asynchronously As should only have passive actions.
490
653
  */
491
- onRestoreOrRevert?(state: STATE, view: VIEW, commit: ITransaction.ICommit, isUndo: boolean): void;
654
+ onRestoreOrRevert?(state: STATE, commit: ITransaction.ICommit, isUndo: boolean, isRestore: boolean, intents: Readonly<Record<string, any>>): void;
492
655
  /**
493
656
  * Called when a model is removed from the transaction.
494
657
  */
@@ -556,10 +719,53 @@ export declare namespace ITransaction {
556
719
  */
557
720
  expectedCommitId?: string;
558
721
  }
722
+ /**
723
+ * Callbacks a transaction is begun with, called by the store as the transaction and the
724
+ * operation it belongs to settle.
725
+ *
726
+ * @remarks
727
+ * A nested transaction is a savepoint: committing it merges its writes into its parent, where
728
+ * they can still be rolled back with an outer transaction. So the outcome hooks report the
729
+ * OPERATION's outcome - {@link onCommit} once the root lands, {@link onRollback} when this
730
+ * transaction or any one it is nested in rolls back - and only one of them is ever called.
731
+ */
732
+ interface Hooks {
733
+ /**
734
+ * Make the writes the caller holds for this transaction, into it.
735
+ *
736
+ * @remarks
737
+ * The caller holds writes to make them together; the store calls this whenever something
738
+ * needs them made: before another transaction begins inside this one, before this one
739
+ * commits, and before a read of a record the writes change ({@link writes}). A flush writes
740
+ * by beginning transactions inside this one; those do not flush it again.
741
+ */
742
+ flush?(): void;
743
+ /**
744
+ * The records {@link flush} writes: a read of one from the store ({@link IStore.getState})
745
+ * flushes first, so a reader never sees them without the held writes.
746
+ *
747
+ * @remarks
748
+ * Only the records the held writes change - a reader of anything else, including the writer
749
+ * itself deciding what to hold, reads as it would. A read made through a transaction
750
+ * ({@link ITransaction.getState}) sees that transaction and does not flush.
751
+ */
752
+ writes?: readonly string[];
753
+ /**
754
+ * Called once the operation this transaction belongs to has landed.
755
+ *
756
+ * @param commit The root's commit. An operation that wrote nothing is elided but still counts
757
+ * as landed.
758
+ */
759
+ onCommit?(commit: ITransaction.ICommit): void;
760
+ /**
761
+ * Called when this transaction, or any transaction it is nested in, rolls back.
762
+ */
763
+ onRollback?(): void;
764
+ }
559
765
  /**
560
766
  * Options for operations with the store.
561
767
  */
562
- interface StoreOperationOptions<VIEW = any, PARAMS = any> extends OperationOptions {
768
+ interface StoreOperationOptions<PARAMS = any> extends OperationOptions, Hooks {
563
769
  /**
564
770
  * If set to `true`, prevents further transactions from being pushed onto the stack
565
771
  * until the current transaction is complete. Once the current transaction is either
@@ -569,16 +775,14 @@ export declare namespace ITransaction {
569
775
  */
570
776
  preventFurtherTransactions?: boolean;
571
777
  /**
572
- * If set to `true`, The commit will not create a new snapshot but instead merge with the existing.
573
- *
574
- * @defaultValue false
778
+ * `false` begins a nested transaction as a step of the one it is nested in: it shares that
779
+ * one's {@link ITransaction.getSavepointId}, so structures the two change in place are the
780
+ * same copies. For a transaction that wraps one write. A rollback of it alone does not
781
+ * restore what it changed in place.
575
782
  *
576
- * @remarks
577
- * * Ths is used for internal listeners and historical corrections.
578
- * * This is only read for the top transaction.
579
- * * This should generally be avoided as the audits and history are lost.
783
+ * @defaultValue true
580
784
  */
581
- forceAmend?: boolean;
785
+ savepoint?: boolean;
582
786
  /**
583
787
  * Stored with the commit.
584
788
  */
@@ -587,8 +791,6 @@ export declare namespace ITransaction {
587
791
  * Used to record audit points.
588
792
  */
589
793
  operation?: ITransaction.Operation<PARAMS>;
590
- viewAfter?: VIEW | ((prev: VIEW) => VIEW);
591
- viewBefore?: VIEW | ((prev: VIEW) => VIEW);
592
794
  }
593
795
  }
594
796
  //# sourceMappingURL=ITransaction.d.ts.map
@@ -24,14 +24,15 @@ interface CommitRecord {
24
24
  author?: any;
25
25
  states: Map<string, any>;
26
26
  operation?: ITransaction.Operation<any>;
27
- viewBefore?: Record<string, any> | null;
28
- viewAfter?: Record<string, any> | null;
27
+ intents: Record<string, any>;
28
+ intentWrites: [string, any][];
29
29
  previousId?: string | null;
30
30
  version: number;
31
31
  }
32
32
  interface CommitContainer {
33
33
  record: CommitRecord;
34
34
  commit: ITransaction.ICommit;
35
+ amendOf?: string;
35
36
  }
36
37
  /**
37
38
  * Events are never fired on sub transactions. Only when making changes to the root
@@ -43,7 +44,7 @@ export declare class TransactionStore implements ITransaction.IStore {
43
44
  protected _listenersState: Map<any, Set<ITransaction.IStateListener>>;
44
45
  protected _commits: Map<string, CommitContainer>;
45
46
  protected _transactionStack: AbstractTransaction[];
46
- protected _transactionOpen: boolean;
47
+ protected _restoring: boolean;
47
48
  protected _locked: boolean;
48
49
  protected _isSync: boolean;
49
50
  protected _isTransient: boolean;
@@ -70,6 +71,7 @@ export declare class TransactionStore implements ITransaction.IStore {
70
71
  * branch is never reissued.
71
72
  */
72
73
  protected _versionCounter: number;
74
+ protected _flushOnRead: number;
73
75
  constructor(options?: ITransaction.StoreConstructorOptions);
74
76
  /**
75
77
  * Sets the transaction store to be synchronous or asynchronous.
@@ -86,10 +88,26 @@ export declare class TransactionStore implements ITransaction.IStore {
86
88
  getCommitCount(): number;
87
89
  /** {@inheritDoc ITransaction.IStore.isOpenTransaction} */
88
90
  isOpenTransaction(): boolean;
89
- /** {@inheritDoc ITransaction.IStore.getView} */
90
- getPendingView(): Record<string, any> | null;
91
+ /** {@inheritDoc ITransaction.IStore.isRestoring} */
92
+ isRestoring(): boolean;
93
+ /** {@inheritDoc ITransaction.IStore.getPendingTransaction} */
94
+ getPendingTransaction(): ITransaction | null;
95
+ /** {@inheritDoc ITransaction.IStore.getCurrentTransaction} */
96
+ getCurrentTransaction(): ITransaction | null;
97
+ /** {@inheritDoc ITransaction.IStore.amend} */
98
+ amend<R>(commitId: string, callback: (commit: ITransaction.ICommit) => R): R;
99
+ /**
100
+ * Fold the tip commit into the one before it: its snapshot becomes that commit's, its intents
101
+ * merge in, and it leaves the log. For a store mirroring a history in which the tip's id never
102
+ * landed (an amended or elided root). `false` when there is nothing to fold, or a transaction
103
+ * is open.
104
+ * @internal
105
+ */
106
+ _squashTip(mergeIntents: (into: Record<string, any>, from: Record<string, any>) => Record<string, any>): boolean;
91
107
  /** {@inheritDoc ITransaction.IStore.create} */
92
108
  create<STATE = any>(initial?: Readonly<STATE>): string;
109
+ /** {@inheritDoc ITransaction.IStore.getStateAt} */
110
+ getStateAt<STATE = any>(commitId: string, stateId: string): Readonly<STATE> | undefined;
93
111
  /** {@inheritDoc ITransaction.IStore.getState} */
94
112
  getState<STATE = any>(stateId: string): Readonly<STATE>;
95
113
  /** {@inheritDoc ITransaction.IStore.getCurrentCommit} */
@@ -124,26 +142,88 @@ export declare class TransactionStore implements ITransaction.IStore {
124
142
  /** {@inheritDoc ITransaction.IStore.addListener} */
125
143
  addListener(listener: ITransaction.IListeners): IListener.Remove;
126
144
  /** {@inheritDoc ITransaction.IStore.addStateListener} */
127
- addStateListener<State = any, View = any>(stateId: string, listener: ITransaction.IStateListener<State, View>): IListener.Remove;
145
+ addStateListener<State = any>(stateId: string, listener: ITransaction.IStateListener<State>): IListener.Remove;
128
146
  protected dispatchEvents(dispatcher: () => void, async?: boolean): void | Promise<any>;
129
- protected _commitRecord(container: CommitContainer, states: Map<any, any>, forceAmend: boolean): void;
130
- _notifyStates(event: keyof ITransaction.IStateListener, container: CommitContainer, states: Map<any, any>, view?: Record<string, any> | null, isRevert?: boolean, isRestore?: boolean, async?: boolean): void;
131
- _notify(event: keyof ITransaction.IListeners, commit: ITransaction.ICommit, async?: boolean): void | Promise<any>;
147
+ /**
148
+ * Land a sealed root record: as a new commit, or, when `amendOf` names a commit, folded into
149
+ * that one.
150
+ *
151
+ * @remarks
152
+ * An amend is not a log entry. It writes the states it produced into the current snapshot
153
+ * and folds its intents into the commit it targets, and nothing else moves: no
154
+ * `onCommitChange` / `onCommitEnd`, the tip stays, no redo branch is pruned. State listeners
155
+ * are told what the amend recorded, not what its target holds.
156
+ *
157
+ * A target the store no longer has (trimmed, or on a pruned redo branch) folds into the
158
+ * current commit. A target that is not the current commit takes the amend's intents only:
159
+ * the states were computed against the current snapshot and belong to it.
160
+ */
161
+ protected _commitRecord(container: CommitContainer, states: Map<any, any>, amendOf: string | null): void;
162
+ _notifyStates(event: keyof ITransaction.IStateListener, container: CommitContainer, states: Map<any, any>, isRevert?: boolean, isRestore?: boolean, async?: boolean, source?: CommitContainer): void;
163
+ protected _notifyClose(commit: ITransaction.ICommit, isRollback: boolean, isElided?: boolean, isAmend?: boolean): void;
164
+ _notify(event: Exclude<keyof ITransaction.IListeners, 'onCommitClose'>, commit: ITransaction.ICommit, async?: boolean): void | Promise<any>;
132
165
  }
133
166
  declare abstract class AbstractTransaction implements ITransaction {
134
167
  protected _store: TransactionStore;
135
168
  protected _states: Map<string, any>;
136
169
  protected _description: string;
170
+ protected _operation: Readonly<ITransaction.Operation> | null;
137
171
  protected _meta: Record<string, string>;
138
172
  protected _children: Set<AbstractTransaction>;
139
173
  protected _depth: number;
140
174
  protected _descriptions?: string[];
141
175
  protected _container: CommitContainer;
142
176
  protected _closed: boolean;
177
+ protected _isAmend: boolean;
143
178
  protected _readOnly: boolean;
179
+ protected _hooks: ITransaction.Hooks | null;
180
+ protected _flushing: boolean;
181
+ protected _outcomes: ITransaction.Hooks[] | null;
144
182
  constructor(store: TransactionStore, container: CommitContainer, options: ITransaction.StoreOperationOptions | string | undefined);
145
- /** {@inheritDoc ITransaction.getView} */
146
- getView(): Record<string, any> | null;
183
+ /** @internal Whether a read of some record flushes this transaction. */
184
+ _isFlushedOnRead(): boolean;
185
+ /** @internal Whether a read of `stateId` flushes this transaction. */
186
+ _isFlushedBy(stateId: string): boolean;
187
+ /**
188
+ * Calls the `flush` hook, unless it is running: its writes begin transactions inside this one.
189
+ * @internal
190
+ */
191
+ _flush(): void;
192
+ /**
193
+ * Commits the transactions still open inside this one, then flushes this one: after it, every
194
+ * write of this transaction has been made.
195
+ * @internal
196
+ */
197
+ protected _settle(options?: ITransaction.StoreOperationOptions): void;
198
+ /** @internal A committed child's outcome hooks, now waiting on this transaction's outcome. */
199
+ _adoptOutcomes(child: AbstractTransaction): void;
200
+ /** @internal Tells the outcome hooks waiting on this transaction how the operation ended. */
201
+ protected _notifyOutcome(commit: ITransaction.ICommit | null): void;
202
+ /**
203
+ * The commit this transaction is writing into.
204
+ * @internal
205
+ */
206
+ _getCommit(): ITransaction.ICommit;
207
+ /**
208
+ * Whether this closed without writing anything, so no commit will land.
209
+ *
210
+ * @remarks
211
+ * Only a root can elide, and only `RootTransaction` overrides this — a nested transaction
212
+ * closing says nothing about the operation's outcome.
213
+ * @internal
214
+ */
215
+ _isElided(): boolean;
216
+ /**
217
+ * Name the commit this root folds into when it commits. See `IStore.amend`.
218
+ * @internal
219
+ */
220
+ _setAmendOf(commitId: string): void;
221
+ /** @internal Whether this root closes by folding into another commit: its own id never lands. */
222
+ _isAmendClose(): boolean;
223
+ /** {@inheritDoc ITransaction.getIntent} */
224
+ getIntent<T = any>(key: string): T | undefined;
225
+ /** {@inheritDoc ITransaction.setIntent} */
226
+ setIntent<T = any>(key: string, value: T | ((prev: T | undefined) => T)): void;
147
227
  /** {@inheritDoc ITransaction.getState} */
148
228
  abstract getState<STATE = any>(model: any): STATE;
149
229
  /** {@inheritDoc ITransaction.rollback} */
@@ -152,10 +232,14 @@ declare abstract class AbstractTransaction implements ITransaction {
152
232
  abstract getParent(): ITransaction;
153
233
  /** {@inheritDoc ITransaction.getId} */
154
234
  abstract getId(): string;
235
+ /** {@inheritDoc ITransaction.getSavepointId} */
236
+ abstract getSavepointId(): string;
155
237
  /** {@inheritDoc ITransaction.getDepth} */
156
238
  getDepth(): number;
157
239
  /** {@inheritDoc ITransaction.getDescription} */
158
240
  getDescription(): string;
241
+ /** {@inheritDoc ITransaction.getOperation} */
242
+ getOperation(): Readonly<ITransaction.Operation> | null;
159
243
  /** {@inheritDoc ITransaction.getStates} */
160
244
  getStates(): Map<any, any>;
161
245
  /** {@inheritDoc ITransaction.beginTransaction} */
@@ -167,6 +251,8 @@ declare abstract class AbstractTransaction implements ITransaction {
167
251
  isReadOnly(): boolean;
168
252
  /** {@inheritDoc ITransaction.updateState} */
169
253
  updateState<STATE = any>(stateId: string, state: Readonly<Partial<STATE>> | ((prev: Readonly<STATE>) => Readonly<STATE>)): STATE;
254
+ /** {@inheritDoc ITransaction.amend} */
255
+ amend(options?: ITransaction.StoreOperationOptions): ITransaction;
170
256
  /** {@inheritDoc ITransaction.commit} */
171
257
  commit(options?: ITransaction.StoreOperationOptions): ITransaction;
172
258
  /** {@inheritDoc ITransaction.isClose} */
@@ -179,6 +265,8 @@ declare abstract class AbstractTransaction implements ITransaction {
179
265
  */
180
266
  _purgeState(id: string): void;
181
267
  protected _mergeStates(statesChild: Map<string, any>): Map<string, any> | undefined;
268
+ /** {@inheritDoc ITransaction.isITransaction} */
269
+ get isITransaction(): true;
182
270
  }
183
271
  export {};
184
272
  //# sourceMappingURL=Transaction.d.ts.map