@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
@@ -16,6 +16,28 @@ export declare abstract class AbstractBackingStore implements IWorkbookIO.IBacki
16
16
  abstract write(request: IWorkbookIO.WriteRequest): Promise<IWorkbookIO.Origin | null>;
17
17
  /** @inheritdoc IWorkbookIO.IBackingStore.read */
18
18
  read(request: IWorkbookIO.ReadRequest): Promise<IWorkbook | null>;
19
+ /**
20
+ * The origin of an open workbook that saves back to the file being read, or `null`.
21
+ *
22
+ * @remarks
23
+ * Whether two sources are the same file is store knowledge — two stores never share a file. The
24
+ * base compares paths with {@link findOpenPath}; a store whose sources are handles rather than
25
+ * paths (the browser) overrides this.
26
+ */
27
+ protected findOpenOrigin(_acquired: any, info: IWorkbookIO.ReadInfo): Promise<IWorkbookIO.Origin | null>;
28
+ /**
29
+ * The origin of an open workbook that saves back to `path`, other than `except`, or `null`. Only a
30
+ * writable origin counts: a read-only one (a URL, a copy) never writes the file.
31
+ */
32
+ protected findOpenPath(path: string, except?: IWorkbookIO.Origin): IWorkbookIO.Origin | null;
33
+ /** Whether two paths name the same file. Exact by default; a store knows its file system's rules. */
34
+ protected isSamePath(a: string, b: string): boolean;
35
+ /**
36
+ * Reads a writable file handle (for example a browser `FileSystemFileHandle` from an open picker
37
+ * or a drop) into its `File`, or returns `null` when the source is not one. A source read this way
38
+ * mints a writable origin. The base implementation recognizes no handles.
39
+ */
40
+ protected fileFromHandle(_source: any): Promise<File | null>;
19
41
  /**
20
42
  * Resolves a source when {@link AbstractBackingStore.read} is called without one — for example
21
43
  * a browser open picker. The base implementation resolves nothing.
@@ -23,7 +45,8 @@ export declare abstract class AbstractBackingStore implements IWorkbookIO.IBacki
23
45
  protected resolveSource(_request: IWorkbookIO.ReadRequest): Promise<any>;
24
46
  /**
25
47
  * Hook invoked after a workbook has been read, so a subclass can associate session state with
26
- * it (e.g. cache an opened file handle for silent save-back). The base implementation is a no-op.
48
+ * it (e.g. cache an opened file handle for silent save-back). `source` is the source as acquired —
49
+ * the handle itself, not the `File` read from it. The base implementation is a no-op.
27
50
  */
28
51
  protected onWorkbookRead(_workbook: IWorkbook, _source: any): Promise<void>;
29
52
  /**
@@ -27,7 +27,7 @@ export declare class ArrayBackingStore implements IWorkbookIO.IBackingStore {
27
27
  */
28
28
  get buffer(): ArrayBufferLike | null;
29
29
  /** @inheritdoc IWorkbookIO.IBackingStore.write */
30
- write(request: IWorkbookIO.WriteRequest): Promise<IWorkbookIO.Origin>;
30
+ write(request: IWorkbookIO.WriteRequest): Promise<IWorkbookIO.Origin | null>;
31
31
  /** @inheritdoc IWorkbookIO.IBackingStore.read */
32
32
  read(request: IWorkbookIO.ReadRequest): Promise<IWorkbook | null>;
33
33
  }
@@ -0,0 +1,20 @@
1
+ import { IResource } from '../resource';
2
+ import { IEmbeddedPart } from './IEmbeddedPart';
3
+ /**
4
+ * Reading and writing an {@link IEmbeddedPart} tree, shared by every model that carries one.
5
+ *
6
+ * @internal
7
+ */
8
+ export declare namespace EmbeddedPart {
9
+ /**
10
+ * A carried part with its content resolved back to the resource holding it.
11
+ *
12
+ * @remarks
13
+ * A part whose content no longer resolves is carried without it rather than dropped: the markup
14
+ * that references it is still there, and dropping the part would leave that reference dangling,
15
+ * which is the one failure this whole subtree exists to prevent.
16
+ */
17
+ const fromJSON: (json: IEmbeddedPart.JSON | undefined, fromResourceId?: (resourceId: number) => IResource) => IEmbeddedPart | null;
18
+ const toJSON: (part: IEmbeddedPart | null, toResourceId?: (resource: IResource) => number | null) => IEmbeddedPart.JSON | null;
19
+ }
20
+ //# sourceMappingURL=EmbeddedPart.d.ts.map
@@ -0,0 +1,63 @@
1
+ import { IResource } from '../resource';
2
+ /**
3
+ * A document part carried on the model, together with the parts its own markup references.
4
+ *
5
+ * @remarks
6
+ * Some of what a spreadsheet contains is not one part but a small tree of them. A chart's markup
7
+ * names a style definition, a color definition, the shapes drawn on top of it, sometimes a whole
8
+ * embedded workbook holding its data; a form control names the part describing what kind of control
9
+ * it is. Each is named by relationship id, so a reference that does not come back makes the
10
+ * document unreadable rather than merely plainer. The whole subtree is carried rather than an
11
+ * enumerated few of it, which is what makes that impossible: nothing referenced can be missing,
12
+ * whether or not this version knows what it was for.
13
+ *
14
+ * The same shape describes every level, `id` and `type` being the edge from the part that
15
+ * references it.
16
+ */
17
+ export interface IEmbeddedPart {
18
+ /** The relationship id the referencing markup cites this part by. */
19
+ id: string;
20
+ /** The relationship type URI. */
21
+ type: string;
22
+ /**
23
+ * The markup, for a part that has any.
24
+ *
25
+ * @remarks
26
+ * Opaque: held as it was read and replayed unchanged, since what it describes has no model yet.
27
+ */
28
+ xml?: string;
29
+ /** The content, for a part that is not markup — an embedded workbook, an image. */
30
+ resource?: IResource;
31
+ /**
32
+ * The content type.
33
+ *
34
+ * @remarks
35
+ * Carried because it cannot be derived: `style1.xml` and `colors1.xml` are both `.xml` and are
36
+ * different types, and a reader that gets this wrong is handed a part it cannot interpret.
37
+ */
38
+ contentType?: string;
39
+ /** What the part was called where it was read from, so it can be called that again. */
40
+ name?: string;
41
+ /** The parts this one's markup references. */
42
+ parts?: IEmbeddedPart[];
43
+ }
44
+ /**
45
+ * {@inheritDoc IEmbeddedPart}
46
+ * @see
47
+ * ### **Interface**
48
+ *
49
+ * {@link IEmbeddedPart}
50
+ */
51
+ export declare namespace IEmbeddedPart {
52
+ /** {@link IEmbeddedPart} as JSON — its content by {@link IResource} id. */
53
+ interface JSON {
54
+ id: string;
55
+ type: string;
56
+ xml?: string;
57
+ resId?: number;
58
+ contentType?: string;
59
+ name?: string;
60
+ parts?: JSON[];
61
+ }
62
+ }
63
+ //# sourceMappingURL=IEmbeddedPart.d.ts.map
@@ -2,6 +2,7 @@ import { FetchArgs, Base64Args, ITaskProgress, MaybePromise } from '@sheetxl/uti
2
2
  import { IListener } from '../listener';
3
3
  import { ITransaction } from '../transaction';
4
4
  import { IWorkbook } from '../workbook';
5
+ import { ICellContainerOptions } from '../sheet';
5
6
  /**
6
7
  * Interface for workbook input/output operations across multiple source types and formats.
7
8
  *
@@ -387,6 +388,8 @@ export interface IWorkbookIO extends IListener.ISource<IWorkbookIO, IWorkbookIO.
387
388
  * {@link TransactionSaveStateManager} to track a workbook's dirty state with no extra wiring.
388
389
  */
389
390
  addCommitListener(listener: ITransaction.ICommitSource.IListeners): IListener.Remove;
391
+ /** For runtime type checking. */
392
+ readonly isIWorkbookIO: true;
390
393
  }
391
394
  export declare namespace IWorkbookIO {
392
395
  /**
@@ -394,11 +397,13 @@ export declare namespace IWorkbookIO {
394
397
  * whether it can be written back to. The IO analog of a `Uri` / `FileSystemFileHandle`.
395
398
  *
396
399
  * @remarks
397
- * Minted and owned by the IO/store layer, never by the workbook model — but every workbook holds
398
- * a stable, *read-only* reference to one (see {@link IWorkbook.getOrigin}), like the DOM's
399
- * `document.URL`. The origin **object** is mutable in place by its owner (a save that resolves a
400
- * destination fills an unbound origin; a store rename moves it), firing `onChange` so holders
401
- * follow; the workbook's *reference* to it never changes.
400
+ * Minted and owned by the IO/store layer, never by the workbook model. An origin names **one**
401
+ * file for its whole life: its path and format never change. What can change in place is what is
402
+ * known about that file (its size, whether it is encrypted, its display label), firing `onChange`.
403
+ *
404
+ * *Which* origin a workbook lives in can change: a save that resolves a new destination (a first
405
+ * save, a Save As) moves the workbook to a new origin, and the one it left keeps naming its own
406
+ * file — see {@link IWorkbook.getOrigin}. An origin backs one open workbook at a time.
402
407
  *
403
408
  * An **unbound** origin (`getPath()` returns `null`) belongs to an in-memory workbook with no
404
409
  * destination yet. A **read-only** origin (`canWrite()` is `false`) is real provenance that cannot
@@ -493,6 +498,16 @@ export declare namespace IWorkbookIO {
493
498
  * each read/write of this handle.
494
499
  */
495
500
  getSize(): number | null;
501
+ /**
502
+ * When the file was last modified, in milliseconds since the epoch, or `null` if unknown — a
503
+ * stat-style property like {@link getSize} (the analog of `File.lastModified`), recorded when
504
+ * the file is read and updated when it is written.
505
+ *
506
+ * @remarks
507
+ * What the store last saw, not a live check: comparing it with the file's current time is how a
508
+ * host notices the file changed on disk since it was opened.
509
+ */
510
+ getLastModified(): number | null;
496
511
  /**
497
512
  * Whether this source can be written back to (a silent re-save). A read-only source (e.g. a
498
513
  * fetched URL) returns `false`, signalling callers to prompt for a destination ("Save As").
@@ -522,6 +537,39 @@ export declare namespace IWorkbookIO {
522
537
  interface IListeners extends IListener.Callbacks<Origin, Origin.Events> {
523
538
  }
524
539
  }
540
+ /**
541
+ * Supplies a workbook's current {@link IWorkbookIO.Origin} — the file it lives in now.
542
+ *
543
+ * @remarks
544
+ * An origin names one file for its whole life; which file a *workbook* lives in changes when a
545
+ * save resolves a new destination (a first save, a Save As). The workbook reads its origin
546
+ * through this and follows `onOriginChange`, so the same workbook moves to the new file while
547
+ * the origin it held keeps naming the old one.
548
+ *
549
+ * Read-only by design: the workbook consumes it and never sets it. Whoever implements it decides
550
+ * when it moves. The default implementation (`WorkbookOriginProvider`) is moved by the IO layer
551
+ * after a successful save; a host with its own save flow can pass its own implementation through
552
+ * `IWorkbook.ConstructorOptions.origin` and move it on {@link IWorkbookIO.Events.onWrite}.
553
+ */
554
+ interface OriginProvider extends IListener.ISource<OriginProvider, OriginProvider.IListeners> {
555
+ /**
556
+ * The origin the workbook lives in now. Always present; unbound for a never-saved workbook.
557
+ */
558
+ getOrigin(): Origin;
559
+ }
560
+ namespace OriginProvider {
561
+ /**
562
+ * IListener interface for {@link IWorkbookIO.OriginProvider} events.
563
+ */
564
+ interface Events {
565
+ /**
566
+ * Called when the provider supplies a different origin.
567
+ */
568
+ onOriginChange?(source: OriginProvider): void;
569
+ }
570
+ interface IListeners extends IListener.Callbacks<OriginProvider, OriginProvider.Events> {
571
+ }
572
+ }
525
573
  /**
526
574
  * Common fields shared by all ambient I/O events.
527
575
  */
@@ -532,8 +580,10 @@ export declare namespace IWorkbookIO {
532
580
  */
533
581
  workbook: IWorkbook;
534
582
  /**
535
- * The {@link IWorkbookIO.Origin} handle the operation actually used — the workbook's own
536
- * origin for a read or a save; the (distinct) target handle for an export.
583
+ * The {@link IWorkbookIO.Origin} handle the operation actually used — the file read, or the file
584
+ * written: the workbook's own origin for a plain save, a new one for a save that resolved a
585
+ * destination (a first save, a Save As), the target for an export. Its format is the one read or
586
+ * written.
537
587
  *
538
588
  * @remarks
539
589
  * Uniform across read and write, so an ambient listener (e.g. recent-files) can track "the
@@ -776,6 +826,18 @@ export declare namespace IWorkbookIO {
776
826
  * If it is set in the createWorkbookOptions it will override this value.
777
827
  */
778
828
  readonly?: boolean;
829
+ /**
830
+ * Open the source as a copy: the workbook gets its own read-only origin for the same path, so it
831
+ * never saves back over the original — its first save asks where.
832
+ *
833
+ * @defaultValue false
834
+ *
835
+ * @remarks
836
+ * A file is saved back by one open workbook at a time, so opening a file that is already open
837
+ * gives a copy without asking. Set this to get one regardless. Writing over a file another open
838
+ * workbook saves back to is refused.
839
+ */
840
+ asCopy?: boolean;
779
841
  /**
780
842
  * Read the workbook for calculation only, trading visual formatting for a faster, lighter read.
781
843
  *
@@ -788,6 +850,29 @@ export declare namespace IWorkbookIO {
788
850
  * save time and memory.
789
851
  */
790
852
  calcOnly?: boolean;
853
+ /**
854
+ * What loading is allowed to calculate — {@link ICellContainerOptions.calcOnLoad},
855
+ * with the format handler translating what the FILE says into it.
856
+ *
857
+ * @defaultValue `'auto'`
858
+ *
859
+ * @remarks
860
+ * - `'auto'` — cached values are trusted; the load pass evaluates a formula cell with no
861
+ * cached value (a repair — Excel always stores one) and refreshes volatiles. Everything is
862
+ * recalculated only when Excel would recalculate on open: the file sets `fullCalcOnLoad`,
863
+ * or for xlsx its `calcId` is missing or older than the Excel build this library is
864
+ * verified against. (What this library writes carries one: the source file's, else that
865
+ * build's.) To take the file's values as they are whatever it says — as openpyxl does —
866
+ * pass `'none'`; to always recalculate, `'full'`.
867
+ * - `'full'` — everything is recalculated, whatever the file says.
868
+ * - `'none'` — the calculation engine is not started. Nothing is compiled or calculated, and
869
+ * a save writes values and formulas exactly as they were read — the pure IO pass. The
870
+ * first mutation, or an explicit {@link ICalculation.calculate} /
871
+ * {@link IWorkbook.whenCalculationReady}, starts the engine.
872
+ *
873
+ * An explicit `createWorkbookOptions.calcOnLoad` wins over the translation.
874
+ */
875
+ calcOnLoad?: ICellContainerOptions.CalcOnLoad;
791
876
  /**
792
877
  * Provide options to the workbook constructor.
793
878
  */
@@ -857,6 +942,10 @@ export declare namespace IWorkbookIO {
857
942
  *
858
943
  * Used for type detection when it cannot be inferred from the destination.
859
944
  * Examples: 'xlsx', 'csv', 'application/json', 'Excel'
945
+ *
946
+ * @remarks
947
+ * A destination whose extension already names a different format is an error, not an
948
+ * override: changing a file's type means writing to a new name (see {@link IWorkbookIO.writeAs}).
860
949
  */
861
950
  format?: string;
862
951
  /**
@@ -880,8 +969,72 @@ export declare namespace IWorkbookIO {
880
969
  password?: string | null;
881
970
  /**
882
971
  * Optional progress callback for long running writes.
972
+ *
973
+ * @remarks
974
+ * Its `onWarning` receives each write warning (a feature the format cannot hold) once the format
975
+ * handler has finished, already deduplicated. It is a log channel; the decision to proceed is
976
+ * {@link onWarnings}.
883
977
  */
884
978
  progress?: ITaskProgress<IWorkbookIO.Origin>;
979
+ /**
980
+ * Decides whether a write that would lose something goes ahead.
981
+ *
982
+ * @remarks
983
+ * Called at most **once** per write, after the format handler has produced the bytes and before
984
+ * the store persists them, and only when the handler raised a warning that an earlier write to
985
+ * the same file did not already let through this session — a repeat save of the same lossy
986
+ * workbook does not ask again. The event carries every warning, deduplicated, so a host shows
987
+ * one dialog listing them rather than one per finding.
988
+ *
989
+ * Returning `false` cancels the write — {@link IWorkbookIO.write} then resolves to `null`, like
990
+ * a dismissed save dialog — but only when {@link WriteWarningsEvent.canCancel} is `true`. A
991
+ * prompted write (a Save As, a first save, a download) always proceeds, because the destination
992
+ * the user just chose has nothing in it to protect and a browser save picker has already created
993
+ * the file: an empty file there is worse than a lossy one. The workbook still holds everything
994
+ * that was not written, so the recovery is to save a copy in a format that can hold it.
995
+ *
996
+ * Omitted, every write proceeds and the warnings are reported through `progress.onWarning` only.
997
+ */
998
+ onWarnings?: (event: IWorkbookIO.WriteWarningsEvent) => boolean | void | Promise<boolean | void>;
999
+ }
1000
+ /**
1001
+ * One thing a format handler could not write faithfully.
1002
+ */
1003
+ interface WriteWarning {
1004
+ /**
1005
+ * What was not written, or was written degraded.
1006
+ */
1007
+ message: string;
1008
+ /**
1009
+ * Locates the finding — for xlsx, the path of the package part (`/xl/worksheets/sheet2.xml`).
1010
+ */
1011
+ context?: any;
1012
+ }
1013
+ /**
1014
+ * What {@link WriteOptions.onWarnings} is asked to decide on.
1015
+ */
1016
+ interface WriteWarningsEvent extends IOEvent {
1017
+ /**
1018
+ * Every warning the write raised, deduplicated, in the order they were first raised.
1019
+ */
1020
+ warnings: WriteWarning[];
1021
+ /**
1022
+ * `true` for a save (the workbook will be marked clean), `false` for an export copy.
1023
+ *
1024
+ * @remarks
1025
+ * Not the same as `origin === workbook.getOrigin()`: a save that resolved a new destination (a
1026
+ * first save, a Save As) moves the workbook to `origin` only once the write succeeds.
1027
+ */
1028
+ save: boolean;
1029
+ /**
1030
+ * Whether returning `false` will cancel the write.
1031
+ *
1032
+ * @remarks
1033
+ * `true` only for a silent re-save to a bound, writable destination — the one case where the
1034
+ * bytes would replace a file that may hold what is about to be lost. See
1035
+ * {@link WriteOptions.onWarnings} for why a prompted write cannot be cancelled.
1036
+ */
1037
+ canCancel: boolean;
885
1038
  }
886
1039
  /**
887
1040
  * Options for {@link IWorkbookIO.writeAs} — everything a write takes, plus the one thing only a
@@ -925,8 +1078,8 @@ export declare namespace IWorkbookIO {
925
1078
  /**
926
1079
  * Persists the workbook described by the request.
927
1080
  *
928
- * @returns The written {@link IWorkbookIO.Origin} handle (normally `request.origin`, updated
929
- * in place), or `null` if cancelled.
1081
+ * @returns The {@link IWorkbookIO.Origin} actually written — `request.origin` when the store
1082
+ * persisted to it, a new origin when it resolved a destination — or `null` if cancelled.
930
1083
  *
931
1084
  * @remarks
932
1085
  * Optional. A read-only store omits it; {@link IWorkbookIO.canWrite} then reports `false` and
@@ -953,13 +1106,14 @@ export declare namespace IWorkbookIO {
953
1106
  * The store receives the destination as an {@link IWorkbookIO.Origin} handle — never a
954
1107
  * fileName-vs-provenance ambiguity. Its contract:
955
1108
  * - **bound + writable** origin → persist to it silently (no dialog), *unless* {@link prompt}.
1109
+ * Update its stat state (the written `size`) and return it.
956
1110
  * - **unbound or read-only** origin, or {@link prompt} → resolve a destination itself (a save
957
- * picker in the browser; an error in bare Node), using {@link suggestedName} for any
958
- * prompt/default, and **update the handle in place** to the resolved destination (the store
959
- * fills in a handle it resolved itself; it never overrides one that was already bound and
960
- * writable).
961
- *
962
- * The store returns this same handle (updated in place — including the written `size`).
1111
+ * picker in the browser; a suggested name in Node), using {@link suggestedName} for any
1112
+ * prompt/default, and **mint a new origin** for it — passing that origin to {@link encode} —
1113
+ * then return the new origin. The request's origin is never changed: it keeps naming its own
1114
+ * file. For a save, the IO layer then moves the workbook to the origin returned.
1115
+ * - Refuse (throw) a destination another open workbook saves back to — other than this
1116
+ * workbook's own.
963
1117
  */
964
1118
  interface WriteRequest {
965
1119
  /**
@@ -971,8 +1125,8 @@ export declare namespace IWorkbookIO {
971
1125
  */
972
1126
  format: FormatType;
973
1127
  /**
974
- * The destination handle: the workbook's own origin for a save, or a minted one for an
975
- * explicit-target export. May be unbound (`getPath()` `null`) — see the store contract above.
1128
+ * The destination handle: the workbook's own origin for a save, the target for a Save As or an
1129
+ * export. May be unbound (`getPath()` `null`) — see the store contract above.
976
1130
  */
977
1131
  origin: IWorkbookIO.Origin;
978
1132
  /**
@@ -987,13 +1141,22 @@ export declare namespace IWorkbookIO {
987
1141
  /**
988
1142
  * Encodes the workbook to bytes using the resolved format, or an alternate format key.
989
1143
  *
1144
+ * @param format An alternate format key — the one the user picked, for a resolved destination.
1145
+ * @param origin The origin being written, when the store minted one for a destination it
1146
+ * resolved. Omitted, it is {@link origin}. The caller's
1147
+ * {@link WriteOptions.onWarnings | onWarnings} sees this as the destination.
1148
+ *
990
1149
  * @remarks
991
1150
  * Call this **after** resolving the destination (e.g. once a Save picker / permission prompt has
992
1151
  * returned). The first invocation also fires the caller's {@link ITaskProgress.onStart}, so
993
1152
  * encoding before the prompt resolves would show progress UI on top of the dialog. A store that
994
1153
  * is cancelled should return without calling `encode`, so `onStart` never fires for it.
1154
+ *
1155
+ * @returns The bytes to persist, or `null` when the caller declined the write through
1156
+ * {@link WriteOptions.onWarnings}. A store that receives `null` persists nothing and returns
1157
+ * `null` — the same outcome as a dismissed save dialog.
995
1158
  */
996
- encode: (format?: string) => Promise<ArrayBufferLike>;
1159
+ encode: (format?: string, origin?: IWorkbookIO.Origin) => Promise<ArrayBufferLike | null>;
997
1160
  }
998
1161
  /**
999
1162
  * The request passed to {@link IWorkbookIO.IBackingStore.read}.
@@ -1049,6 +1212,10 @@ export declare namespace IWorkbookIO {
1049
1212
  * The source size in bytes, if known.
1050
1213
  */
1051
1214
  size?: number;
1215
+ /**
1216
+ * When the source was last modified, in milliseconds since the epoch, if known.
1217
+ */
1218
+ lastModified?: number;
1052
1219
  /**
1053
1220
  * The detected source type (e.g. `'file'`, `'fetch'`), used for a fallback display name.
1054
1221
  */
@@ -68,6 +68,13 @@ export declare class DefaultWorkbookIO implements IWorkbookIO {
68
68
  write<T extends IWorkbookIO.WriteOptions = IWorkbookIO.WriteOptions>(workbook: IWorkbook, target?: string | IWorkbookIO.Origin | T, optionsArg?: T): Promise<IWorkbookIO.Origin | null>;
69
69
  /** @inheritdoc IWorkbookIO.writeAs */
70
70
  writeAs<T extends IWorkbookIO.WriteAsOptions = IWorkbookIO.WriteAsOptions>(workbook: IWorkbook, target: string | IWorkbookIO.Origin, options?: T): Promise<IWorkbookIO.Origin | null>;
71
+ /**
72
+ * The one write path. `save` is whether the workbook moves to what is written and is marked
73
+ * clean (a save, a Save As), or stays where it is (an export).
74
+ *
75
+ * @internal
76
+ */
77
+ protected _write<T extends IWorkbookIO.WriteOptions = IWorkbookIO.WriteOptions>(workbook: IWorkbook, target: string | IWorkbookIO.Origin, save: boolean, options?: T): Promise<IWorkbookIO.Origin | null>;
71
78
  /**
72
79
  * Strips a known file extension from a file name, returning the base name.
73
80
  *
@@ -83,6 +90,8 @@ export declare class DefaultWorkbookIO implements IWorkbookIO {
83
90
  protected _baseName(pathOrUrl: string | null | undefined): string | null;
84
91
  protected _writeArrayBuffer<T extends IWorkbookIO.WriteOptions = IWorkbookIO.WriteOptions>(workbook: IWorkbook, writeType: IWorkbookIO.WriteFormatType, options?: T): Promise<ArrayBufferLike>;
85
92
  protected _readArrayBuffer<T extends IWorkbookIO.ReadOptions = IWorkbookIO.ReadOptions>(arrayBuffer: ArrayBufferLike, format: IWorkbookIO.ReadFormatType, options?: T): Promise<IWorkbook>;
93
+ /** {@inheritDoc IWorkbookIO.isIWorkbookIO} */
94
+ get isIWorkbookIO(): true;
86
95
  }
87
96
  /**
88
97
  * A singleton instance of the default {@link IWorkbookIO} implementation.
@@ -17,6 +17,10 @@ export interface WorkbookOriginOptions {
17
17
  * The last-known size of the source in bytes (stat-style), if known.
18
18
  */
19
19
  size?: number | null;
20
+ /**
21
+ * When the source was last modified, in milliseconds since the epoch (stat-style), if known.
22
+ */
23
+ lastModified?: number | null;
20
24
  /**
21
25
  * Whether the source can be written back to (a silent re-save).
22
26
  *
@@ -34,19 +38,20 @@ export interface WorkbookOriginOptions {
34
38
  * concrete "light virtual file handle" (see `IO-DESIGN.md`).
35
39
  *
36
40
  * @remarks
37
- * Mutable and observable: the IO/store layer holds the instance and calls {@link update} when the
38
- * source moves (a save that resolved a destination) or is renamed, firing `onChange` so holders —
39
- * including the workbook itself, whose `getName()`/`onNameChange` derive from this — propagate it.
41
+ * Names one file for its whole life. What is known about that file — its size, its encryption, its
42
+ * display label — can change in place ({@link update}, {@link setName}), firing `onChange` so
43
+ * holders — including the workbook, whose `getName()`/`onNameChange` derive from this — follow.
40
44
  * Source logic (paths, URLs, formats) lives here, in the IO layer, not in the workbook model.
41
45
  *
42
46
  * An **unbound** origin (`path: null`) belongs to an in-memory workbook with no destination yet; a
43
- * destination-resolving save fills it in place via {@link update}.
47
+ * save that resolves one moves the workbook to a new origin, leaving this one as it was.
44
48
  */
45
49
  export declare class WorkbookOrigin implements IWorkbookIO.Origin {
46
- private _path;
50
+ private readonly _path;
47
51
  private _name;
48
52
  private _format;
49
53
  private _size;
54
+ private _lastModified;
50
55
  private _canWrite;
51
56
  private _encryption;
52
57
  /**
@@ -85,24 +90,28 @@ export declare class WorkbookOrigin implements IWorkbookIO.Origin {
85
90
  getPassword(): string | null;
86
91
  /** {@inheritDoc IWorkbookIO.Origin.getSize} */
87
92
  getSize(): number | null;
93
+ /** {@inheritDoc IWorkbookIO.Origin.getLastModified} */
94
+ getLastModified(): number | null;
88
95
  /** {@inheritDoc IWorkbookIO.Origin.canWrite} */
89
96
  canWrite(): boolean;
90
97
  /** {@inheritDoc IWorkbookIO.Origin.setName} */
91
98
  setName(name: string | null): void;
92
99
  /**
93
- * Update one or more fields in place. Fires `onChange` if anything actually changed.
100
+ * Update what is known about the file in place. Fires `onChange` if anything actually changed.
94
101
  *
95
102
  * @remarks
96
- * This is the **privileged mutation channel** (see `IO-DESIGN.md`): permitted callers are the
97
- * backing store (rename/move, destination resolution), the IO layer (filling an unbound origin on
98
- * a first destination-resolving save), and the document layer (Save As / rename). Never format
99
- * handlers, never the model, never chrome.
103
+ * The **privileged mutation channel** (see `DESIGN-IO.md`) for the backing store and the IO layer:
104
+ * the written size, the encryption on disk, the format key a read resolved. Never format handlers,
105
+ * never the model, never chrome.
106
+ *
107
+ * There is no `path`: an origin names one file for its whole life. A save that resolves another
108
+ * destination mints a new origin for it (see `DESIGN-IO.md` §11).
100
109
  */
101
110
  update(next: {
102
- path?: string | null;
103
111
  name?: string | null;
104
112
  format?: string | null;
105
113
  size?: number | null;
114
+ lastModified?: number | null;
106
115
  canWrite?: boolean;
107
116
  encryption?: string | null;
108
117
  }): this;
@@ -0,0 +1,46 @@
1
+ import { IListener } from '../listener';
2
+ import { IWorkbookIO } from './IWorkbookIO';
3
+ /**
4
+ * The provider currently supplying `origin`, or `null` when no open workbook lives in it.
5
+ *
6
+ * @remarks
7
+ * How the IO layer finds the workbook a save was for: it holds the origin it wrote from.
8
+ */
9
+ export declare const getOriginProvider: (origin: IWorkbookIO.Origin) => WorkbookOriginProvider | null;
10
+ /** The origins of every open workbook. */
11
+ export declare const getOpenOrigins: () => IWorkbookIO.Origin[];
12
+ /**
13
+ * Default {@link IWorkbookIO.OriginProvider}: holds the workbook's current origin and moves when
14
+ * told to.
15
+ *
16
+ * @remarks
17
+ * {@link setOrigin} is on this class, not the interface — the workbook only reads its origin. The
18
+ * IO layer moves it after a save that resolved a new destination.
19
+ *
20
+ * An origin is supplied by one provider at a time, so the origin a save wrote from identifies
21
+ * exactly one workbook. Supplying an origin another open provider already supplies throws.
22
+ */
23
+ export declare class WorkbookOriginProvider implements IWorkbookIO.OriginProvider {
24
+ private _origin;
25
+ private _released;
26
+ private readonly _emitter;
27
+ constructor(origin: IWorkbookIO.Origin);
28
+ /** {@inheritDoc IWorkbookIO.OriginProvider.getOrigin} */
29
+ getOrigin(): IWorkbookIO.Origin;
30
+ /**
31
+ * Supplies `origin` from now on. Fires `onOriginChange` unless it is already the current one.
32
+ *
33
+ * @remarks
34
+ * Moves the workbook to another file; it writes nothing. The origin it replaces is left as it was
35
+ * — it still names its own file, and is free for another workbook.
36
+ */
37
+ setOrigin(origin: IWorkbookIO.Origin): void;
38
+ /**
39
+ * Stops supplying: the origin is free for another workbook. Called when the workbook closes.
40
+ */
41
+ release(): void;
42
+ /** {@inheritDoc IListener.ISource.addListeners} */
43
+ addListeners(listeners: IWorkbookIO.OriginProvider.IListeners, options?: IListener.Options): IListener.Remove;
44
+ private static _assertFree;
45
+ }
46
+ //# sourceMappingURL=WorkbookOriginProvider.d.ts.map
@@ -0,0 +1,49 @@
1
+ /**
2
+ * A reader over a captured markup fragment.
3
+ *
4
+ * @remarks
5
+ * Content the model does not hold structurally is kept as the source's markup and replayed on save
6
+ * (a shape, a chart part). This reads the few facts such markup can answer without a model behind
7
+ * it. It is a reader over a fragment, not an XML library: elements, attributes and character data,
8
+ * matched by LOCAL name — prefixes are the producer's choice (`xdr:sp`, `a:t` and `c:ser` are only
9
+ * Excel's). The markup was already parsed once, as part of a whole document, by the reader that
10
+ * captured it.
11
+ */
12
+ /** One element of a parsed fragment. `name` is the local name. */
13
+ export interface XmlElement {
14
+ name: string;
15
+ attrs: string;
16
+ children: (XmlElement | string)[];
17
+ /** Where the element's content starts in the source: just past its open tag. */
18
+ contentStart: number;
19
+ /** Where the element's content ends in the source: at its close tag. Equal to `contentStart` for an empty element. */
20
+ contentEnd: number;
21
+ }
22
+ export declare const decodeEntities: (text: string) => string;
23
+ /** Character data as it has to be spelled inside an element. */
24
+ export declare const encodeText: (text: string) => string;
25
+ /** The fragment's root element, or `null` when there is none to read. */
26
+ export declare const parseFragment: (xml: string) => XmlElement | null;
27
+ export declare const getAttribute: (element: XmlElement, name: string) => string | null;
28
+ export declare const childElements: (element: XmlElement) => XmlElement[];
29
+ export declare const findChild: (element: XmlElement, name: string) => XmlElement | null;
30
+ /** The element at the end of a path of local names, or `null` where the path breaks. */
31
+ export declare const findPath: (element: XmlElement, ...names: string[]) => XmlElement | null;
32
+ /** The element's own character data; what its child elements hold is not read. */
33
+ export declare const readCharacters: (element: XmlElement) => string;
34
+ /**
35
+ * The children to read in place of an `mc:AlternateContent`: ONE branch, never both.
36
+ *
37
+ * @remarks
38
+ * A producer states the same content once per consumer version, so a sweep over both branches
39
+ * reads every word twice. The fallback is the rendition for a reader that does not understand the
40
+ * choice's markup — which, for the markup that gets wrapped this way (an OMML equation), is this
41
+ * reader: the fallback carries the equation in its linear text form.
42
+ */
43
+ export declare const alternateBranch: (element: XmlElement) => XmlElement[];
44
+ /**
45
+ * The plain text of a DrawingML text body (`txBody`, `c:rich`): its paragraphs joined by a newline,
46
+ * blank ones trimmed from the ends.
47
+ */
48
+ export declare const readTextBody: (body: XmlElement) => string;
49
+ //# sourceMappingURL=_XmlFragment.d.ts.map
@@ -1,3 +1,4 @@
1
+ export * from './IEmbeddedPart';
1
2
  export * from './IWorkbookIO';
2
3
  export * from './WorkbookIO';
3
4
  export * from './WorkbookOrigin';