@sheetxl/sdk 0.8.0-beta.1 → 0.8.0-beta.10
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.
- package/THIRD-PARTY-NOTICES.md +1 -1
- package/browser/esm/{B0HS42a7lga1k1U_.mjs → BEAY9XgKNx-bakXW.mjs} +2 -2
- package/browser/esm/BbSmt62FpFIpoVzu.mjs +392 -0
- package/browser/esm/BcHmrKHwMMOlzc9_.mjs +357 -0
- package/browser/esm/BgcZ-CoTbMfmyDJL.mjs +412 -0
- package/browser/esm/Bk7xxbdDpa7-sIwd.mjs +7 -0
- package/browser/esm/BqskM7wA8oPfFQue.mjs +20 -0
- package/browser/esm/Btg43M1Bf-ENDreu.mjs +540 -0
- package/browser/esm/BzLfNyc6OOShIErH.mjs +598 -0
- package/browser/esm/C9B0djuUarfNdoj0.mjs +466 -0
- package/browser/esm/{uyWBMSIxMlt8n5Z3.mjs → CSx9ed1JOs7K5BXO.mjs} +2 -2
- package/browser/esm/CYyv6uGjo10ig5FP.mjs +142 -0
- package/browser/esm/CZ5oa92wZEAXebgk.mjs +622 -0
- package/browser/esm/CdLZWVcH8cncBUPJ.mjs +849 -0
- package/browser/esm/Cgd5BnM3hg9RyUel.mjs +171 -0
- package/browser/esm/CjsUGJEQSbGjnH6R.mjs +1001 -0
- package/browser/esm/ClB5ix51roQOpZEr.mjs +7402 -0
- package/browser/esm/{DlPMeIyxT9tG_WDk.mjs → Cqr3knDsBvoVZ6MN.mjs} +179 -202
- package/browser/esm/D4uVlrG0xEFctsSM.mjs +905 -0
- package/browser/esm/DOMHmhYzPcLVcpAW.mjs +7 -0
- package/browser/esm/DUvUK61b2_4pf4tG.mjs +484 -0
- package/browser/esm/De175LygU7ot4nQm.mjs +441 -0
- package/browser/esm/DhKkrCVASZ6Isvz6.mjs +527 -0
- package/browser/esm/Di58Ji1n--3Mgc_2.mjs +607 -0
- package/browser/esm/Dtoyt8q5RyGAlxCp.mjs +1141 -0
- package/browser/esm/Y79I7Sm8kjaYexhf.mjs +167 -0
- package/browser/esm/index.mjs +1472 -1023
- package/browser/esm/o8MFgcVXns987D6_.mjs +400 -0
- package/browser/esm/zqJOaweiXE9D8RY1.mjs +66681 -0
- package/licenses/dependencies.txt +209 -209
- package/node/esm/B6D7sSetrcOWLsKj.mjs +1135 -0
- package/node/esm/B9ljpEIZg6wOTzRE.mjs +142 -0
- package/node/esm/BH1v-E4Ro3bR7Znw.mjs +962 -0
- package/node/esm/BN9j8V9gCExMjVtJ.mjs +540 -0
- package/node/esm/{Cku7XiUvw1xrRasi.mjs → Bh4dv6tMjXX3X4nI.mjs} +1 -1
- package/node/esm/Bqd62L8KFgdS0Vou.mjs +7 -0
- package/node/esm/Bsx9uijd4X_SKV3L.mjs +360 -0
- package/node/esm/BtuY37FumvLE7EBo.mjs +629 -0
- package/node/esm/C6ZXsNyLXI6zA63X.mjs +402 -0
- package/node/esm/CCouEwT37f08qO3V.mjs +7 -0
- package/node/esm/CD9wbvufChVYYkrI.mjs +451 -0
- package/node/esm/CImNvdz1iP-lUlro.mjs +610 -0
- package/node/esm/CT0CN82y0_Qgoryk.mjs +7568 -0
- package/node/esm/CUQi5ZtMO02nhG0W.mjs +596 -0
- package/node/esm/CUUoseJmFsCf82bb.mjs +28 -0
- package/node/esm/CnSQ7MTXAUAyBOoS.mjs +911 -0
- package/node/esm/D7MfcID2Wf6l6VpC.mjs +171 -0
- package/node/esm/DCplLG93GfTs1vNw.mjs +1860 -0
- package/node/esm/DHUADiCmxNQS1ARz.mjs +417 -0
- package/node/esm/DMD12JUh7HJw2-jl.mjs +638 -0
- package/node/esm/DdFgXl-Ux2cMBTs_.mjs +15 -0
- package/node/esm/DefYISWfdZJFx57m.mjs +255 -0
- package/node/esm/Ds0d8zXzmgOu3MGx.mjs +403 -0
- package/node/esm/MiU4rDOiocmJ-9Ry.mjs +1783 -0
- package/node/esm/index.mjs +51616 -39665
- package/package.json +15 -16
- package/resources/contents.json +64 -0
- package/resources/fonts/arial-bold-italic.metrics.json +139 -0
- package/resources/fonts/arial-bold.metrics.json +139 -0
- package/resources/fonts/arial-italic.metrics.json +139 -0
- package/resources/fonts/arial-regular.metrics.json +139 -0
- package/resources/fonts/calibri-bold-italic.metrics.json +137 -0
- package/resources/fonts/calibri-bold.metrics.json +137 -0
- package/resources/fonts/calibri-italic.metrics.json +137 -0
- package/resources/fonts/calibri-regular.metrics.json +137 -0
- package/resources/fonts/cambria-bold-italic.metrics.json +66 -0
- package/resources/fonts/cambria-bold.metrics.json +66 -0
- package/resources/fonts/cambria-italic.metrics.json +66 -0
- package/resources/fonts/cambria-regular.metrics.json +66 -0
- package/resources/fonts/contents.json +126 -0
- package/resources/fonts/courier-new-bold-italic.metrics.json +143 -0
- package/resources/fonts/courier-new-bold.metrics.json +143 -0
- package/resources/fonts/courier-new-italic.metrics.json +143 -0
- package/resources/fonts/courier-new-regular.metrics.json +143 -0
- package/resources/fonts/times-new-roman-bold-italic.metrics.json +141 -0
- package/resources/fonts/times-new-roman-bold.metrics.json +141 -0
- package/resources/fonts/times-new-roman-italic.metrics.json +143 -0
- package/resources/fonts/times-new-roman-regular.metrics.json +141 -0
- package/resources/locales/de/model.msg.json +112 -12
- package/resources/locales/en/model.msg.json +119 -13
- package/types/scripting-api.json +8048 -0
- package/types/scripting-enums.json +277 -110
- package/types/scripting.d.ts +13077 -3224
- package/types/src/anchored/AbstractAnchored.d.ts +18 -8
- package/types/src/anchored/AnchoredMap.d.ts +2 -0
- package/types/src/anchored/IAnchoredMap.d.ts +52 -4
- package/types/src/autoFill/AutoFill.d.ts +316 -32
- package/types/src/autoFill/IAutoFill.d.ts +232 -15
- package/types/src/border/{IBorder.d.ts → IBorders.d.ts} +42 -41
- package/types/src/border/index.d.ts +1 -1
- package/types/src/calculation/Calculation.d.ts +754 -49
- package/types/src/calculation/ExternalBookBindings.d.ts +118 -0
- package/types/src/calculation/FormulaText.d.ts +82 -0
- package/types/src/calculation/ICalculation.d.ts +318 -81
- package/types/src/calculation/INamedFormulasCollection.d.ts +5 -8
- package/types/src/calculation/NamedFormulaCollection.d.ts +139 -107
- package/types/src/calculation/NamedLambdaFunction.d.ts +28 -0
- package/types/src/calculation/TokenType.d.ts +9 -0
- package/types/src/calculation/Types.d.ts +83 -2
- package/types/src/calculation/_CloneBoundary.d.ts +80 -0
- package/types/src/calculation/_TableRename.d.ts +13 -0
- package/types/src/calculation/compiler/ASTTypes.d.ts +71 -0
- package/types/src/calculation/compiler/CompilerUtils.d.ts +135 -44
- package/types/src/calculation/compiler/FormulaCompiler.d.ts +29 -4
- package/types/src/calculation/compiler/FormulaParser.d.ts +1 -2
- package/types/src/calculation/compiler/LiteTransform.d.ts +17 -0
- package/types/src/calculation/compiler/ParserUtils.d.ts +26 -1
- package/types/src/calculation/compiler/SRParser.d.ts +2 -1
- package/types/src/calculation/compiler/Types.d.ts +79 -9
- package/types/src/calculation/executor/CalcExecutor.d.ts +312 -33
- package/types/src/calculation/executor/CalcExecutorUtils.d.ts +43 -2
- package/types/src/calculation/executor/CircularReference.d.ts +2 -0
- package/types/src/calculation/formula/Formula.d.ts +58 -21
- package/types/src/calculation/formula/FormulaBlock.d.ts +125 -23
- package/types/src/calculation/formula/FormulaRecordView.d.ts +79 -0
- package/types/src/calculation/formula/FunctionValues.d.ts +10 -0
- package/types/src/calculation/formula/IFormulaBlock.d.ts +261 -67
- package/types/src/calculation/formula/LambdaValue.d.ts +46 -23
- package/types/src/calculation/formula/LazyValue.d.ts +96 -0
- package/types/src/calculation/formula/TokenUtils.d.ts +25 -1
- package/types/src/calculation/formula/index.d.ts +1 -0
- package/types/src/calculation/functions/FunctionDeclarations.d.ts +31 -0
- package/types/src/calculation/functions/Operators.d.ts +8 -0
- package/types/src/calculation/functions/initializeFunctions.d.ts +15 -2
- package/types/src/calculation/grid/CalcGrid.d.ts +407 -158
- package/types/src/calculation/grid/CalcGridBackend.d.ts +493 -0
- package/types/src/calculation/grid/CalcGridProxy.d.ts +133 -0
- package/types/src/calculation/grid/CalcGridUtils.d.ts +62 -12
- package/types/src/calculation/grid/FormulaEntry.d.ts +129 -0
- package/types/src/calculation/grid/FormulaHost.d.ts +239 -0
- package/types/src/calculation/grid/ICalcGrid.d.ts +499 -141
- package/types/src/calculation/grid/_CalcRequest.d.ts +289 -0
- package/types/src/calculation/grid/index.d.ts +4 -0
- package/types/src/calculation/index.d.ts +2 -0
- package/types/src/calculation/spatial/ContentfulSpatialValue.d.ts +6 -2
- package/types/src/calculation/spatial/FormulaSpatialValue.d.ts +339 -11
- package/types/src/calculation/spatial/SpillEntry.d.ts +20 -5
- package/types/src/calculation/spatial/TouchedWindows.d.ts +86 -0
- package/types/src/calculation/spatial/index.d.ts +1 -0
- package/types/src/calculation/state/CalcInputs.d.ts +41 -0
- package/types/src/calculation/state/CalcNode.d.ts +141 -30
- package/types/src/calculation/state/CalcScope.d.ts +37 -0
- package/types/src/calculation/state/CalcState.d.ts +22 -1
- package/types/src/calculation/state/CalculationContext.d.ts +50 -3
- package/types/src/calculation/state/IContextContainer.d.ts +129 -27
- package/types/src/calculation/state/_PendingOverlayGrid.d.ts +163 -0
- package/types/src/calculation/state/_ReadObservedGrid.d.ts +74 -8
- package/types/src/calculation/state/index.d.ts +1 -0
- package/types/src/calculation/symbol/ExternalSheetSymbols.d.ts +80 -0
- package/types/src/calculation/symbol/ISymbolRegistry.d.ts +23 -0
- package/types/src/calculation/symbol/IndirectSymbolProvider.d.ts +16 -2
- package/types/src/calculation/symbol/SheetSymbolProvider.d.ts +63 -3
- package/types/src/calculation/symbol/SymbolRegistry.d.ts +20 -0
- package/types/src/calculation/symbol/index.d.ts +3 -2
- package/types/src/cell/ICell.d.ts +104 -29
- package/types/src/cell/ICellHeader.d.ts +24 -2
- package/types/src/cell/ICellProtection.d.ts +50 -10
- package/types/src/cellRange/ICellRange.d.ts +419 -79
- package/types/src/cellRange/ICellRanges.d.ts +23 -21
- package/types/src/chart/Chart.d.ts +41 -13
- package/types/src/chart/ChartCollection.d.ts +26 -0
- package/types/src/chart/IChart.d.ts +166 -12
- package/types/src/chart/IChartCollection.d.ts +25 -0
- package/types/src/chart/_ChartXml.d.ts +70 -0
- package/types/src/chart/index.d.ts +1 -3
- package/types/src/collections/ArraysGrid.d.ts +1 -1
- package/types/src/collections/IGrid.d.ts +1 -1
- package/types/src/collections/ISparseGrid.d.ts +9 -0
- package/types/src/collections/ISpatialMap.d.ts +59 -21
- package/types/src/collections/ImmutableList.d.ts +28 -0
- package/types/src/collections/MixedTypedArrayList.d.ts +168 -108
- package/types/src/collections/OverlappingRangeIterator.d.ts +13 -17
- package/types/src/collections/RepeatingList.d.ts +7 -0
- package/types/src/collections/ScalarGrid.d.ts +50 -0
- package/types/src/collections/SparseGrid.d.ts +1 -1
- package/types/src/collections/SpatialMap.d.ts +13 -21
- package/types/src/collections/Tuple.d.ts +128 -16
- package/types/src/collections/_GridUtils.d.ts +19 -6
- package/types/src/collections/_RangeSweep.d.ts +97 -0
- package/types/src/collections/_SpatialUtils.d.ts +20 -2
- package/types/src/collections/index.d.ts +1 -0
- package/types/src/color/_BuiltInIndexDefs.d.ts +6 -0
- package/types/src/comment/Comment.d.ts +223 -0
- package/types/src/comment/CommentCollection.d.ts +40 -0
- package/types/src/comment/IComment.d.ts +340 -50
- package/types/src/comment/ICommentCollection.d.ts +90 -0
- package/types/src/comment/NoteMovable.d.ts +26 -0
- package/types/src/comment/_CommentUtils.d.ts +50 -0
- package/types/src/comment/_NoteBox.d.ts +50 -0
- package/types/src/comment/index.d.ts +1 -0
- package/types/src/condition/AnchoredConditional.d.ts +82 -17
- package/types/src/condition/BuiltInOperators/AbstractOperator.d.ts +42 -12
- package/types/src/condition/BuiltInOperators/AfterEqualToOperator.d.ts +2 -0
- package/types/src/condition/BuiltInOperators/AfterOperator.d.ts +2 -0
- package/types/src/condition/BuiltInOperators/AndOperator.d.ts +3 -1
- package/types/src/condition/BuiltInOperators/AverageOperator.d.ts +2 -0
- package/types/src/condition/BuiltInOperators/BeforeEqualToOperator.d.ts +2 -0
- package/types/src/condition/BuiltInOperators/BeforeOperator.d.ts +2 -0
- package/types/src/condition/BuiltInOperators/BetweenOperator.d.ts +2 -0
- package/types/src/condition/BuiltInOperators/ColorOperator.d.ts +4 -0
- package/types/src/condition/BuiltInOperators/ContainsOperator.d.ts +2 -0
- package/types/src/condition/BuiltInOperators/EndsWithOperator.d.ts +2 -0
- package/types/src/condition/BuiltInOperators/EqualToOperator.d.ts +4 -1
- package/types/src/condition/BuiltInOperators/ExpressionOperator.d.ts +5 -6
- package/types/src/condition/BuiltInOperators/GreaterThanEqualToOperator.d.ts +2 -0
- package/types/src/condition/BuiltInOperators/GreaterThanOperator.d.ts +2 -0
- package/types/src/condition/BuiltInOperators/IconOperator.d.ts +4 -0
- package/types/src/condition/BuiltInOperators/InSetOperator.d.ts +22 -5
- package/types/src/condition/BuiltInOperators/LessThanEqualToOperator.d.ts +2 -0
- package/types/src/condition/BuiltInOperators/LessThanOperator.d.ts +2 -0
- package/types/src/condition/BuiltInOperators/NotOperator.d.ts +2 -0
- package/types/src/condition/BuiltInOperators/OrOperator.d.ts +3 -1
- package/types/src/condition/BuiltInOperators/StartsWithOperator.d.ts +2 -0
- package/types/src/condition/BuiltInOperators/TimePeriodOperator.d.ts +2 -0
- package/types/src/condition/BuiltInOperators/TopNOperator.d.ts +6 -0
- package/types/src/condition/BuiltinSelectors/BaseSelector.d.ts +21 -6
- package/types/src/condition/BuiltinSelectors/DateSelector.d.ts +4 -5
- package/types/src/condition/BuiltinSelectors/DisplaySelector.d.ts +20 -0
- package/types/src/condition/BuiltinSelectors/TextLengthSelector.d.ts +7 -5
- package/types/src/condition/BuiltinSelectors/TimeSelector.d.ts +3 -5
- package/types/src/condition/BuiltinSelectors/WholeSelector.d.ts +3 -5
- package/types/src/condition/BuiltinSelectors/index.d.ts +12 -6
- package/types/src/condition/Condition.d.ts +19 -1
- package/types/src/condition/ICondition.d.ts +293 -73
- package/types/src/condition/_ConditionFormula.d.ts +152 -0
- package/types/src/condition/_ConditionUtils.d.ts +167 -13
- package/types/src/conditionalFormat/ConditionalEntry.d.ts +3 -3
- package/types/src/conditionalFormat/ConditionalFormat.d.ts +25 -14
- package/types/src/conditionalFormat/ConditionalFormatCollection.d.ts +19 -8
- package/types/src/conditionalFormat/IConditionalFormat.d.ts +12 -10
- package/types/src/conditionalFormat/IConditionalFormatCollection.d.ts +2 -0
- package/types/src/dataValidation/DataValidation.d.ts +69 -3
- package/types/src/dataValidation/DataValidationCollection.d.ts +20 -9
- package/types/src/dataValidation/IDataValidation.d.ts +149 -30
- package/types/src/dataValidation/IDataValidationCollection.d.ts +10 -2
- package/types/src/date/DateUtils.d.ts +20 -0
- package/types/src/date/_DateUtils.d.ts +91 -7
- package/types/src/externalBook/ExternalBookCollection.d.ts +145 -12
- package/types/src/externalBook/ExternalBookName.d.ts +96 -0
- package/types/src/externalBook/IExternalBook.d.ts +170 -18
- package/types/src/externalBook/IExternalBookCollection.d.ts +79 -7
- package/types/src/externalBook/index.d.ts +1 -0
- package/types/src/{lib/file → file}/file.browser.d.ts +22 -8
- package/types/src/{lib/file → file}/file.node.d.ts +7 -2
- package/types/src/fill/IEffect.d.ts +5 -5
- package/types/src/fill/IFill.d.ts +123 -78
- package/types/src/fill/IStroke.d.ts +190 -64
- package/types/src/fill/RectAlignment.d.ts +20 -0
- package/types/src/fill/_Fills.d.ts +187 -0
- package/types/src/fill/_Stroke.d.ts +89 -0
- package/types/src/fill/index.d.ts +1 -0
- package/types/src/filter/IFilter.d.ts +188 -5
- package/types/src/font/AdvanceBuilder.d.ts +25 -0
- package/types/src/font/AdvanceTable.d.ts +114 -0
- package/types/src/font/FontCollection.d.ts +57 -0
- package/types/src/font/IFont.d.ts +17 -0
- package/types/src/font/IFontCollection.d.ts +120 -22
- package/types/src/font/TableFileAdvanceBuilder.d.ts +27 -0
- package/types/src/font/_BuiltinFontTables.d.ts +10 -0
- package/types/src/font/index.d.ts +4 -1
- package/types/src/group/Group.d.ts +136 -0
- package/types/src/group/GroupMovableCollection.d.ts +37 -0
- package/types/src/group/IGroup.d.ts +129 -0
- package/types/src/group/index.d.ts +2 -0
- package/types/src/history/IHistory.d.ts +3 -2
- package/types/src/hyperlink/IHyperlink.d.ts +13 -0
- package/types/src/hyperlink/_Hyperlink.d.ts +5 -1
- package/types/src/i18n/LanguagePack.d.ts +12 -4
- package/types/src/index.d.ts +5 -0
- package/types/src/io/AbstractBackingStore.d.ts +24 -1
- package/types/src/io/ArrayBackingStore.d.ts +1 -1
- package/types/src/io/EmbeddedPart.d.ts +20 -0
- package/types/src/io/IEmbeddedPart.d.ts +63 -0
- package/types/src/io/IWorkbookIO.d.ts +185 -18
- package/types/src/io/WorkbookIO.d.ts +9 -0
- package/types/src/io/WorkbookOrigin.d.ts +20 -11
- package/types/src/io/WorkbookOriginProvider.d.ts +46 -0
- package/types/src/io/_XmlFragment.d.ts +49 -0
- package/types/src/io/index.d.ts +1 -0
- package/types/src/license/LicenseDetails.d.ts +1 -0
- package/types/src/license/LicenseManager.d.ts +4 -1
- package/types/src/license/Types.d.ts +38 -0
- package/types/src/license/_Utils.d.ts +22 -0
- package/types/src/license/details.d.ts +24 -0
- package/types/src/license/license-key.d.ts +49 -2
- package/types/src/license/runtime.browser.d.ts +41 -0
- package/types/src/{lib/utils/utils.node.d.ts → license/runtime.node.d.ts} +9 -12
- package/types/src/listener/IListener.d.ts +12 -7
- package/types/src/listener/ListenerEmitter.d.ts +46 -5
- package/types/src/model/AbstractModel.d.ts +14 -5
- package/types/src/movable/AbstractMovableContent.d.ts +182 -0
- package/types/src/movable/CustomElement.d.ts +4 -5
- package/types/src/movable/ErrorContent.d.ts +49 -0
- package/types/src/movable/FormControl.d.ts +285 -0
- package/types/src/movable/GroupMember.d.ts +87 -0
- package/types/src/movable/ICustomElement.d.ts +7 -2
- package/types/src/movable/IErrorContent.d.ts +23 -0
- package/types/src/movable/IFormControl.d.ts +455 -0
- package/types/src/movable/IMovable.d.ts +378 -46
- package/types/src/movable/IMovableCollection.d.ts +63 -3
- package/types/src/movable/Movable.d.ts +149 -49
- package/types/src/movable/MovableCollection.d.ts +15 -8
- package/types/src/movable/MovableContentRegistry.d.ts +113 -0
- package/types/src/movable/_BuiltInContents.d.ts +14 -0
- package/types/src/movable/_ContentFactory.d.ts +35 -0
- package/types/src/movable/_DrawnBounds.d.ts +37 -0
- package/types/src/movable/_InsertableCollection.d.ts +28 -0
- package/types/src/movable/_MovableUtils.d.ts +5 -0
- package/types/src/movable/_PendingContent.d.ts +25 -0
- package/types/src/movable/_PlacementUtils.d.ts +55 -0
- package/types/src/movable/_RotatedFrame.d.ts +20 -0
- package/types/src/movable/index.d.ts +7 -1
- package/types/src/named/AbstractNamed.d.ts +1 -1
- package/types/src/named/INamed.d.ts +4 -1
- package/types/src/named/INamedCollection.d.ts +26 -0
- package/types/src/named/NamedCollection.d.ts +16 -15
- package/types/src/numFmt/BuiltInFormats.d.ts +20 -7
- package/types/src/numFmt/IFormatEngine.d.ts +2 -0
- package/types/src/numFmt/NumfmtFormatEngine.d.ts +2 -0
- package/types/src/numFmt/_FormatCell.d.ts +11 -2
- package/types/src/numFmt/_NumFmtUtils.d.ts +0 -1
- package/types/src/numFmt/vendor/numfmt/_sheetxl.d.ts +6 -0
- package/types/src/outline/IOutline.d.ts +186 -0
- package/types/src/outline/Outline.d.ts +157 -0
- package/types/src/outline/index.d.ts +2 -0
- package/types/src/person/IPerson.d.ts +99 -0
- package/types/src/person/IPersonCollection.d.ts +51 -0
- package/types/src/person/Person.d.ts +32 -0
- package/types/src/person/PersonCollection.d.ts +49 -0
- package/types/src/person/index.d.ts +4 -0
- package/types/src/picture/IPicture.d.ts +33 -3
- package/types/src/picture/Picture.d.ts +33 -13
- package/types/src/pivot/IPivotTable.d.ts +72 -0
- package/types/src/pivot/IPivotTableCollection.d.ts +25 -0
- package/types/src/pivot/PivotCache.d.ts +34 -0
- package/types/src/pivot/PivotTable.d.ts +61 -0
- package/types/src/pivot/PivotTableCollection.d.ts +25 -0
- package/types/src/pivot/_PivotXml.d.ts +24 -0
- package/types/src/pivot/index.d.ts +6 -0
- package/types/src/primitives/CompositeRangeStats.d.ts +2 -0
- package/types/src/primitives/Criteria.d.ts +1 -1
- package/types/src/primitives/Grouping.d.ts +65 -0
- package/types/src/primitives/LambdaBrand.d.ts +26 -0
- package/types/src/primitives/PrimitiveUtils.d.ts +56 -19
- package/types/src/primitives/Range.d.ts +133 -25
- package/types/src/primitives/RangeStats.d.ts +30 -2
- package/types/src/primitives/ReferenceRange.d.ts +44 -0
- package/types/src/primitives/Runtime.d.ts +15 -2
- package/types/src/primitives/environment.browser.d.ts +9 -0
- package/types/src/primitives/environment.node.d.ts +10 -0
- package/types/src/primitives/stats/AggregateStats.d.ts +49 -15
- package/types/src/primitives/stats/Cancellation.d.ts +13 -0
- package/types/src/primitives/stats/FrequencyStats.d.ts +10 -1
- package/types/src/primitives/stats/LookupIndex.d.ts +46 -0
- package/types/src/primitives/stats/Ranked.d.ts +1 -1
- package/types/src/primitives/stats/SortedNumbers.d.ts +4 -2
- package/types/src/primitives/stats/index.d.ts +1 -0
- package/types/src/print/IPrint.d.ts +0 -22
- package/types/src/protectedRange/IProtectedRange.d.ts +4 -0
- package/types/src/protectedRange/IProtectedRangeCollection.d.ts +2 -0
- package/types/src/protectedRange/ProtectedRange.d.ts +1 -4
- package/types/src/protectedRange/ProtectedRangeCollection.d.ts +19 -8
- package/types/src/protection/DefaultProtection.d.ts +12 -1
- package/types/src/protection/IProtection.d.ts +36 -2
- package/types/src/reference/ReferenceUtils.d.ts +80 -0
- package/types/src/reference/index.d.ts +2 -0
- package/types/src/resource/IResource.d.ts +21 -1
- package/types/src/resource/IResourceCollection.d.ts +9 -1
- package/types/src/resource/ResourceCollection.d.ts +6 -6
- package/types/src/scripting/FunctionCollection.d.ts +49 -15
- package/types/src/scripting/IFunctionCollection.d.ts +62 -32
- package/types/src/scripting/IModule.d.ts +25 -0
- package/types/src/scripting/IModuleCollection.d.ts +17 -0
- package/types/src/scripting/IScript.d.ts +28 -26
- package/types/src/scripting/Module.d.ts +34 -6
- package/types/src/scripting/ModuleCollection.d.ts +17 -12
- package/types/src/scripting/Runtime.d.ts +15 -0
- package/types/src/scripting/Scripts.d.ts +3 -7
- package/types/src/scripting/TypedFunction.d.ts +154 -18
- package/types/src/scripting/_FunctionIndex.d.ts +8 -3
- package/types/src/scripting/_ModuleUtils.d.ts +11 -1
- package/types/src/scripting/_ScriptUtils.d.ts +3 -0
- package/types/src/scripting/declarations.browser.d.ts +10 -0
- package/types/src/scripting/declarations.d.ts +49 -0
- package/types/src/scripting/declarations.node.d.ts +9 -0
- package/types/src/scripting/index.d.ts +3 -0
- package/types/src/selection/IMovableSelection.d.ts +148 -0
- package/types/src/selection/IRangeSelection.d.ts +9 -4
- package/types/src/selection/MovableSelection.d.ts +48 -0
- package/types/src/selection/RangeSelection.d.ts +15 -0
- package/types/src/selection/index.d.ts +1 -0
- package/types/src/shape/GeometryPreset.d.ts +197 -0
- package/types/src/shape/IGeometry.d.ts +380 -0
- package/types/src/shape/IShape.d.ts +341 -194
- package/types/src/shape/IShapeStyle.d.ts +135 -0
- package/types/src/shape/Shape.d.ts +107 -21
- package/types/src/shape/ShapeStyleUtils.d.ts +54 -0
- package/types/src/shape/_ConnectorFrame.d.ts +32 -0
- package/types/src/shape/_ConnectorRoute.d.ts +33 -0
- package/types/src/shape/_Connectors.d.ts +108 -0
- package/types/src/shape/_Geometry.d.ts +14 -0
- package/types/src/shape/_GeometryLoader.d.ts +21 -0
- package/types/src/shape/_ShapeStyle.d.ts +70 -0
- package/types/src/shape/_builtIn/_BuiltInChunks.d.ts +10 -0
- package/types/src/shape/_builtIn/_BuiltInDef.d.ts +9 -0
- package/types/src/shape/_builtIn/arrows.d.ts +6 -0
- package/types/src/shape/_builtIn/basic.d.ts +6 -0
- package/types/src/shape/_builtIn/callouts.d.ts +6 -0
- package/types/src/shape/_builtIn/flowchart.d.ts +6 -0
- package/types/src/shape/_builtIn/lines.d.ts +6 -0
- package/types/src/shape/_builtIn/math.d.ts +6 -0
- package/types/src/shape/_builtIn/other.d.ts +6 -0
- package/types/src/shape/_builtIn/rectangles.d.ts +6 -0
- package/types/src/shape/_builtIn/starsBanners.d.ts +6 -0
- package/types/src/shape/geometry/_strokeEnds.d.ts +7 -0
- package/types/src/shape/geometry/format.d.ts +3 -0
- package/types/src/shape/geometry/geometry.d.ts +85 -0
- package/types/src/shape/geometry/guides.d.ts +54 -0
- package/types/src/shape/geometry/handles.d.ts +14 -0
- package/types/src/shape/geometry/index.d.ts +7 -0
- package/types/src/shape/geometry/lineEnds.d.ts +54 -0
- package/types/src/shape/geometry/paths.d.ts +35 -0
- package/types/src/shape/geometry/segments.d.ts +114 -0
- package/types/src/shape/index.d.ts +3 -0
- package/types/src/sheet/CellRegion.d.ts +6 -0
- package/types/src/sheet/ICellContainerOptions.d.ts +50 -0
- package/types/src/sheet/ISheet.d.ts +197 -50
- package/types/src/sheet/ISheetCollection.d.ts +2 -5
- package/types/src/sheet/NamedCellRange.d.ts +16 -7
- package/types/src/sheet/NamedRange.d.ts +8 -0
- package/types/src/sheet/Sheet.d.ts +915 -138
- package/types/src/sheet/SheetCell.d.ts +92 -32
- package/types/src/sheet/SheetCollection.d.ts +19 -8
- package/types/src/sheet/SheetRange.d.ts +90 -18
- package/types/src/sheet/SheetRanges.d.ts +22 -9
- package/types/src/sheet/_CellBuffer.d.ts +214 -0
- package/types/src/sheet/_HeldFormula.d.ts +69 -0
- package/types/src/sheet/_InvalidSheetRange.d.ts +7 -7
- package/types/src/sheet/_ListenerAnchor.d.ts +104 -0
- package/types/src/sheet/_RangeStateSweep.d.ts +16 -0
- package/types/src/sheet/_ScalarListFactory.d.ts +61 -0
- package/types/src/sheet/_SheetAutoFillUtils.d.ts +74 -0
- package/types/src/sheet/_SheetAutoFitUtils.d.ts +2 -2
- package/types/src/sheet/_SheetEvents.d.ts +43 -0
- package/types/src/sheet/_SheetFilterUtils.d.ts +49 -1
- package/types/src/sheet/_SheetIntents.d.ts +296 -0
- package/types/src/sheet/_SheetMutations.d.ts +182 -62
- package/types/src/sheet/_SheetStateReader.d.ts +19 -13
- package/types/src/sheet/_SheetStateTypes.d.ts +83 -78
- package/types/src/sheet/_SheetUtils.d.ts +39 -22
- package/types/src/sheet/_WatchAnchor.d.ts +93 -0
- package/types/src/sheet/spatial/HeldFormulaEntry.d.ts +36 -0
- package/types/src/sheet/spatial/index.d.ts +1 -0
- package/types/src/sheet/style/SheetCellStyle.d.ts +209 -304
- package/types/src/sheet/style/SheetDirectStyle.d.ts +30 -19
- package/types/src/sheet/style/SheetNamedStyle.d.ts +17 -17
- package/types/src/sheet/style/SheetTableStyle.d.ts +5 -5
- package/types/src/sheet/style/_Resolvers.d.ts +14 -8
- package/types/src/sheet/style/_StyleUtils.d.ts +38 -8
- package/types/src/sheetHeader/ISheetHeader.d.ts +94 -53
- package/types/src/sheetHeader/SheetCellHeader.d.ts +4 -0
- package/types/src/sheetHeader/SheetHeader.d.ts +42 -22
- package/types/src/sheetHeader/_HeaderMetrics.d.ts +37 -0
- package/types/src/sheetHeader/_HeaderUtils.d.ts +5 -3
- package/types/src/sheetProtection/ISheetProtection.d.ts +41 -7
- package/types/src/sheetProtection/SheetProtection.d.ts +12 -0
- package/types/src/sheetView/ISheetView.d.ts +69 -15
- package/types/src/sheetView/SheetView.d.ts +20 -11
- package/types/src/slicer/ISlicer.d.ts +304 -17
- package/types/src/slicer/ISlicerStyle.d.ts +109 -0
- package/types/src/slicer/Slicer.d.ts +128 -13
- package/types/src/slicer/SlicerStyle.d.ts +25 -0
- package/types/src/slicer/_BuiltInSlicerStyles.d.ts +13 -0
- package/types/src/slicer/_SlicerUtils.d.ts +30 -0
- package/types/src/slicer/index.d.ts +1 -0
- package/types/src/sort/ISort.d.ts +4 -2
- package/types/src/string/IStringCollection.d.ts +5 -0
- package/types/src/string/StringCollection.d.ts +6 -6
- package/types/src/style/{IStyle.d.ts → ICellStyle.d.ts} +72 -52
- package/types/src/style/INamedStyleCollection.d.ts +72 -0
- package/types/src/style/ISlicerStyleCollection.d.ts +77 -0
- package/types/src/style/IStyleCollection.d.ts +91 -60
- package/types/src/style/ITableStyleCollection.d.ts +89 -0
- package/types/src/style/NamedStyleCollection.d.ts +39 -0
- package/types/src/style/SlicerStyleCollection.d.ts +46 -0
- package/types/src/style/StyleCollection.d.ts +81 -26
- package/types/src/style/TableStyleCollection.d.ts +49 -0
- package/types/src/style/_BuiltInStyleDefs.d.ts +6 -6
- package/types/src/style/_BuiltInStyleNames.d.ts +2 -2
- package/types/src/style/index.d.ts +7 -1
- package/types/src/table/AnchoredTable.d.ts +701 -72
- package/types/src/table/AutoTable.d.ts +7 -5
- package/types/src/table/ITable.d.ts +261 -34
- package/types/src/table/ITableCollection.d.ts +12 -0
- package/types/src/table/ITableStyle.d.ts +37 -37
- package/types/src/table/TableCollection.d.ts +19 -8
- package/types/src/table/_FilterField.d.ts +19 -6
- package/types/src/table/_NamedTable.d.ts +17 -1
- package/types/src/table/_NamedTableSource.d.ts +1 -0
- package/types/src/table/_SortField.d.ts +2 -0
- package/types/src/table/_TableColumn.d.ts +13 -2
- package/types/src/table/_TableMessages.d.ts +1 -0
- package/types/src/table/_TableUtils.d.ts +40 -0
- package/types/src/text/Bullet.d.ts +4 -0
- package/types/src/text/IText.d.ts +182 -0
- package/types/src/text/ITextFrame.d.ts +110 -1
- package/types/src/text/TextBoxAlignment.d.ts +25 -16
- package/types/src/text/TextFrame.d.ts +4 -0
- package/types/src/text/TextLine.d.ts +4 -0
- package/types/src/text/TextParagraph.d.ts +4 -0
- package/types/src/text/TextRotation.d.ts +3 -3
- package/types/src/text/TextRun.d.ts +9 -0
- package/types/src/text/TextStacked.d.ts +83 -0
- package/types/src/text/index.d.ts +1 -0
- package/types/src/text/richtext/IRichText.d.ts +36 -0
- package/types/src/text/richtext/IStyledFont.d.ts +18 -18
- package/types/src/text/richtext/index.d.ts +1 -0
- package/types/src/theme/ITheme.d.ts +45 -4
- package/types/src/theme/IThemeCollection.d.ts +2 -0
- package/types/src/theme/ThemeCollection.d.ts +11 -7
- package/types/src/theme/_OfficeFormatScheme.d.ts +3 -0
- package/types/src/transaction/ITransaction.d.ts +258 -45
- package/types/src/transaction/Transaction.d.ts +101 -11
- package/types/src/transaction/TransactionUndoManager.d.ts +4 -1
- package/types/src/type/AbstractCollection.d.ts +101 -0
- package/types/src/type/ICollection.d.ts +117 -0
- package/types/src/type/ITypes.d.ts +9 -7
- package/types/src/type/index.d.ts +1 -0
- package/types/src/utils/_CSSUtils.d.ts +3 -3
- package/types/src/wasm/_sdkWasm.d.ts +7 -0
- package/types/src/wasm/index.d.ts +2 -0
- package/types/src/wasm/sdkWasm.d.ts +29 -0
- package/types/src/workbook/IWorkbook.d.ts +180 -40
- package/types/src/workbook/Workbook.d.ts +123 -10
- package/types/src/workbook/_WorkbookIntents.d.ts +36 -0
- package/types/src/workbookProtection/IWorkbookProtection.d.ts +7 -0
- package/types/src/workbookProtection/WorkbookProtection.d.ts +3 -0
- package/types/src/workbookView/IWorkbookView.d.ts +12 -0
- package/types/src/workbookView/WorkbookView.d.ts +5 -0
- package/browser/cjs/B7_pDFYCVzt-3hUs.cjs +0 -1
- package/browser/cjs/BatsV2UUraVDCRXm.cjs +0 -57
- package/browser/cjs/CUz53T65cRGQRgvv.cjs +0 -33
- package/browser/cjs/DU0kYUtdFa3jK-im.cjs +0 -1
- package/browser/cjs/Dv3x6zut1ZRUt3IF.cjs +0 -10
- package/browser/cjs/Dv4yIPLV98M5zLHa.cjs +0 -1
- package/browser/cjs/a0Z-SXs_N71CtqYb.cjs +0 -1
- package/browser/cjs/index.cjs +0 -3
- package/browser/esm/6JKSOvc5czaQB2Bj.mjs +0 -109
- package/browser/esm/BtuJ9AGzeURtAsGo.mjs +0 -51241
- package/browser/esm/DGU6sM25u0EWCKl1.mjs +0 -824
- package/browser/esm/f2G3QRgEbvFJcoa2.mjs +0 -4436
- package/node/esm/-pxdn3M3tc6PLHs7.mjs +0 -114
- package/node/esm/0n5bslM9jhO1JnI2.mjs +0 -843
- package/types/src/cellRange/_GraphNode.d.ts +0 -38
- package/types/src/condition/BuiltinSelectors/ListSelector.d.ts +0 -12
- package/types/src/dataValidation/_Utils.d.ts +0 -10
- package/types/src/lib/utils/_Utils.d.ts +0 -27
- package/types/src/lib/utils/utils.browser.d.ts +0 -33
- package/types/src/movable/IGroup.d.ts +0 -30
- package/types/src/movable/IMovableSelection.d.ts +0 -49
- package/types/src/sheet/listener/RangesListener.d.ts +0 -32
- package/types/src/sheet/listener/RangesListenerEntry.d.ts +0 -19
- package/types/src/sheet/listener/index.d.ts +0 -3
- /package/types/src/{lib/utils → license}/banner.d.ts +0 -0
|
@@ -1,25 +1,59 @@
|
|
|
1
1
|
import { IRange, IFormulaContext, IRuntime, Scalar } from '@sheetxl/primitives';
|
|
2
|
+
import { IListener } from '../listener';
|
|
2
3
|
import { FunctionProvider } from '@sheetxl/scripting';
|
|
3
4
|
import { AbstractModel, IModel } from '../model';
|
|
5
|
+
import { ITransaction } from '../transaction';
|
|
4
6
|
import { IStringCollection } from '../string';
|
|
5
7
|
import { IFunctionCollection } from '../scripting';
|
|
6
8
|
import { ISpatialMap, ISpatialMap3D } from '../collections';
|
|
7
9
|
import { INamed, INamedCollection } from '../named';
|
|
8
10
|
import { ICellRange, ICellRanges } from '../cellRange';
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
+
import { NamedNodeInfo } from './Types';
|
|
12
|
+
import { ITable } from '../table';
|
|
13
|
+
import { IExternalBook, IExternalBookCollection } from '../externalBook';
|
|
14
|
+
import { ExternalBookCollection } from '../externalBook/ExternalBookCollection';
|
|
15
|
+
import { ExternalBookBindings } from './ExternalBookBindings';
|
|
16
|
+
import { FormulaBlockResolvers, FormulaImager } from './formula';
|
|
11
17
|
import { IFormulaCompiler } from './compiler';
|
|
12
18
|
import { CalculationContext, IContextContainer, CalcNode } from './state';
|
|
13
19
|
import { FormulaSpatialValue, PrecedentSpatialValue } from './spatial';
|
|
14
|
-
import { CalcGrid, ICalcGrid } from './grid';
|
|
20
|
+
import { CalcGridBackend, CalcGrid, FormulaHost, ICalcGrid } from './grid';
|
|
21
|
+
import { CalcRequest, CalcResponse, CalcGridSpec, TableSymbols, NameSymbols } from './grid/_CalcRequest';
|
|
15
22
|
import { CalcExecutor } from './executor';
|
|
23
|
+
import { IndirectSymbolProvider, ISymbolRegistry } from './symbol';
|
|
16
24
|
import { ICalculation } from './ICalculation';
|
|
17
25
|
import { NamedFormulaCollection } from './NamedFormulaCollection';
|
|
18
26
|
import { INamedFormulasCollection } from './INamedFormulasCollection';
|
|
27
|
+
/**
|
|
28
|
+
* What a structured reference resolves against: a live table, or a snapshot of one taken before it
|
|
29
|
+
* was removed ({@link snapshotTableExtent}).
|
|
30
|
+
*/
|
|
31
|
+
interface TableExtent {
|
|
32
|
+
getRange(): {
|
|
33
|
+
getCoords(): IRange.Coords;
|
|
34
|
+
};
|
|
35
|
+
getDataRange(): {
|
|
36
|
+
getCoords(): IRange.Coords;
|
|
37
|
+
};
|
|
38
|
+
getHeaderRowRange(): {
|
|
39
|
+
getCoords(): IRange.Coords;
|
|
40
|
+
};
|
|
41
|
+
getTotalRowRange(): {
|
|
42
|
+
getCoords(): IRange.Coords;
|
|
43
|
+
};
|
|
44
|
+
isShowHeaders(): boolean;
|
|
45
|
+
isShowTotals(): boolean;
|
|
46
|
+
getColumnById(id: string): {
|
|
47
|
+
getIndex(): number;
|
|
48
|
+
} | null;
|
|
49
|
+
getSheet(): {
|
|
50
|
+
getId(): string;
|
|
51
|
+
} | null | undefined;
|
|
52
|
+
}
|
|
19
53
|
/**
|
|
20
54
|
* Implementation for {@link ICalculation}.
|
|
21
55
|
*/
|
|
22
|
-
export declare class Calculation extends AbstractModel<State, ICalculation.JSON,
|
|
56
|
+
export declare class Calculation extends AbstractModel<State, ICalculation.JSON, ICalculation.IListeners> implements ICalculation {
|
|
23
57
|
protected _container: IContextContainer;
|
|
24
58
|
protected _context: CalculationContext & IFormulaContext;
|
|
25
59
|
protected _status: ICalculation.Status;
|
|
@@ -27,11 +61,15 @@ export declare class Calculation extends AbstractModel<State, ICalculation.JSON,
|
|
|
27
61
|
protected _runtime: IRuntime;
|
|
28
62
|
protected _functions: IFunctionCollection;
|
|
29
63
|
protected _namedFormulas: NamedFormulaCollection;
|
|
64
|
+
protected _externalBooks: ExternalBookCollection;
|
|
65
|
+
/** The cache as grids and the cached names as virtual grids — see {@link ExternalBookBindings}. */
|
|
66
|
+
protected _externalBindings: ExternalBookBindings | null;
|
|
30
67
|
/** `json.names` held from construction until {@link hydrateNames} — see it for why. */
|
|
31
68
|
protected _pendingNames: INamed.JSON[] | null;
|
|
32
69
|
protected _compiler: IFormulaCompiler;
|
|
33
70
|
protected _compilerEditing: IFormulaCompiler;
|
|
34
71
|
protected _compilerEditingSig: string;
|
|
72
|
+
protected _compilerEditingStorage: IFormulaCompiler | null;
|
|
35
73
|
protected _compilerModule: typeof import('./compiler/FormulaCompiler');
|
|
36
74
|
protected _getActiveCell: () => IRange.CellCoords | null;
|
|
37
75
|
protected _getRange: (address: ICellRange.Address, options?: ICellRange.GetRangeOptions) => ICellRange;
|
|
@@ -44,17 +82,58 @@ export declare class Calculation extends AbstractModel<State, ICalculation.JSON,
|
|
|
44
82
|
protected _epochSeenPrecedents: ISpatialMap3D<PrecedentSpatialValue> | null;
|
|
45
83
|
protected _epochSeenDynamics: Map<FormulaSpatialValue, ISpatialMap.Entry<PrecedentSpatialValue>[]> | null;
|
|
46
84
|
protected _volatiles: Set<CalcNode>;
|
|
85
|
+
/** The current handle of every formula host's grid, by grid id. */
|
|
86
|
+
protected _formulaHosts: Map<string, FormulaHost>;
|
|
47
87
|
protected _calculatedCommitId: string | null;
|
|
88
|
+
protected _calculatedEngineId: string | null;
|
|
89
|
+
protected _modelStore: ITransaction.IStore | null;
|
|
90
|
+
/** The model-side grids, by grid id (DESIGN-CALC-SERVICE §13.23): what a copy lands on, what a start seeds from. */
|
|
91
|
+
protected readonly _fronts: Map<string, CalcGrid>;
|
|
92
|
+
/** What each model grid is, for the `create` a start sends for it (its size is read then). */
|
|
93
|
+
protected readonly _gridSpecs: Map<string, CalcGridSpec>;
|
|
94
|
+
/** The engine holds grids: from a start's boot until a stop. */
|
|
95
|
+
protected _engineUp: boolean;
|
|
96
|
+
protected _modelStoreRemoveListener: IListener.Remove | null;
|
|
97
|
+
protected _mirrorRemoveListener: IListener.Remove | null;
|
|
98
|
+
_modelMirrorId: string | null;
|
|
99
|
+
/** Where the owner's sheet list is held ({@link _setSheets}): the model's store, or a transient one with no model. */
|
|
100
|
+
protected _ownerStore: ITransaction.IStore;
|
|
101
|
+
/** The record holding the owner's sheet list, in {@link _ownerStore}. */
|
|
102
|
+
protected _sheetListId: string;
|
|
103
|
+
protected _engineIds: Map<string, string>;
|
|
104
|
+
protected _landingOf: Map<string, string>;
|
|
105
|
+
protected _mirroredId: string | null;
|
|
106
|
+
protected _lastRevert: {
|
|
107
|
+
commitId: string;
|
|
108
|
+
regions: Map<string, IRange.Coords[]>;
|
|
109
|
+
} | null;
|
|
110
|
+
protected _outstanding: Set<Promise<ICalcGrid.Results>> | null;
|
|
48
111
|
protected _pendingActions: (() => Promise<unknown>)[] | null;
|
|
49
112
|
protected _pendingPriority: (() => Promise<unknown>)[] | null;
|
|
50
113
|
protected _draining: boolean;
|
|
114
|
+
protected _drainDepth: number;
|
|
51
115
|
protected _drainScheduled: boolean;
|
|
52
116
|
protected _calcOwed: boolean;
|
|
117
|
+
protected _calcOwedBy: string | null;
|
|
118
|
+
protected _channel: HeldRequest[] | null;
|
|
119
|
+
protected _bootPending: Promise<void> | null;
|
|
120
|
+
/** Passes running now: see {@link _calculateNow}. */
|
|
121
|
+
protected _passesInFlight: number;
|
|
122
|
+
/** The calculation state last announced (`onCalculationStateChange`). */
|
|
123
|
+
protected _calculationState: ICalculation.CalculationState;
|
|
124
|
+
/** A check of the calculation state is posted: see {@link _noteCalculationState}. */
|
|
125
|
+
protected _calculationStatePosted: boolean;
|
|
126
|
+
/** `ready()` calls waiting for work in flight to end: woken on every check. */
|
|
127
|
+
protected _calculationStateWaiters: (() => void)[] | null;
|
|
128
|
+
protected _bootFull: boolean;
|
|
129
|
+
protected _bootExplicit: boolean;
|
|
130
|
+
protected _compilerWaiters: (() => void)[] | null;
|
|
131
|
+
protected _wroteWhileOff: boolean;
|
|
53
132
|
/** {@link ICalculation.getCalculationMode} — gates the reactive pass in {@link _calculate}. */
|
|
54
133
|
protected _calcMode: ICalculation.CalculationMode;
|
|
55
134
|
/** {@link ICalculation.getIterativeCalculation} — handed to the executor per pass. */
|
|
56
135
|
protected _iterate: boolean;
|
|
57
|
-
protected
|
|
136
|
+
protected _maxIteration: number;
|
|
58
137
|
protected _maxIterateChange: number;
|
|
59
138
|
/** The `calcPr` the file carried, kept whole so settings this engine ignores still round-trip. */
|
|
60
139
|
protected _calcJSON: ICalculation.JSON | null;
|
|
@@ -66,6 +145,9 @@ export declare class Calculation extends AbstractModel<State, ICalculation.JSON,
|
|
|
66
145
|
* Populated from {@link Calculation.ConstructorOptions} during `_initialize`.
|
|
67
146
|
*/
|
|
68
147
|
protected _resolvers: FormulaBlockResolvers | null;
|
|
148
|
+
/** Tables as symbols: a table's stable id, which is what a structured reference stores. */
|
|
149
|
+
protected _tableSymbols: IndirectSymbolProvider<INamed<ITable>> | null;
|
|
150
|
+
protected _nameSymbols: IndirectSymbolProvider<ICalculation.INamedFormula> | null;
|
|
69
151
|
constructor(options?: Calculation.ConstructorOptions);
|
|
70
152
|
protected _initialize(options?: Calculation.ConstructorOptions): void;
|
|
71
153
|
/**
|
|
@@ -89,19 +171,137 @@ export declare class Calculation extends AbstractModel<State, ICalculation.JSON,
|
|
|
89
171
|
* @returns `true` if any formula was marked dirty.
|
|
90
172
|
*/
|
|
91
173
|
protected _markDirtyReferencing(changedIds: Set<string>): boolean;
|
|
174
|
+
/**
|
|
175
|
+
* Recompiles every formula that references any of `changedIds` — a name or a table, directly or
|
|
176
|
+
* through a name — from its own text, so it re-derives its precedents.
|
|
177
|
+
*
|
|
178
|
+
* @remarks
|
|
179
|
+
* The re-wire half of {@link _markDirtyReferencing}. A node stores the coords its references
|
|
180
|
+
* resolved to when it was wired, and `precedentSpatial` indexes those, so a symbol that now
|
|
181
|
+
* designates different cells (a name redefined, a table resized) leaves its readers evaluating
|
|
182
|
+
* against the old edges; a dirty mark does not reach them. Same `all3D` scan and the same
|
|
183
|
+
* {@link _namedTargets} expansion: a name whose body cites the symbol reaches its own readers.
|
|
184
|
+
*
|
|
185
|
+
* Run at a safe point only — it writes inputs.
|
|
186
|
+
*/
|
|
187
|
+
protected _recompileReferencing(changedIds: Set<string>): void;
|
|
188
|
+
/**
|
|
189
|
+
* @internal
|
|
190
|
+
* Rewrites the formulas that reference `table`, which is about to be removed: `'error'` puts
|
|
191
|
+
* `#REF!` in place of each reference (a delete), `'address'` the absolute range it designated
|
|
192
|
+
* (a convert to range).
|
|
193
|
+
*
|
|
194
|
+
* @remarks
|
|
195
|
+
* Called while the table still exists: its id and its extent are read now, and the rewrite runs at
|
|
196
|
+
* the next safe point. A defined name whose body cites the table is not rewritten; it evaluates
|
|
197
|
+
* `#REF!` once the table is gone.
|
|
198
|
+
*/
|
|
199
|
+
_releaseTableReferences(table: ITable, release: 'error' | 'address'): void;
|
|
200
|
+
/**
|
|
201
|
+
* @internal
|
|
202
|
+
* A table's body has changed rows: re-fit the A1 references that spanned it.
|
|
203
|
+
*
|
|
204
|
+
* @remarks
|
|
205
|
+
* Excel treats a reference whose ROWS are exactly a table's body - or run from its header to the
|
|
206
|
+
* body's end - as naming the body, whatever columns of the table it covers, and keeps it on the
|
|
207
|
+
* body however the body's rows change (probed, `probe-table-refit.ps1`): `SUM(B2:B5)` over body
|
|
208
|
+
* rows 2-5 reads `SUM(B2:B6)` after a row is appended, and `SUM(B2:B3)` after a resize gives two
|
|
209
|
+
* up. Relative, absolute or mixed alike, from any sheet, and in anything that holds a reference -
|
|
210
|
+
* a defined name, a table's held totals formula and a condition's formula are blocks too. A
|
|
211
|
+
* reference that only starts or only ends with the body is an ordinary one, and a change of
|
|
212
|
+
* COLUMNS re-fits nothing. A name's relative rows are read from its body's origin, A1, as Excel
|
|
213
|
+
* reads them (`probe-table-refit-relative.ps1`); a shift never moves them, so a row at the top
|
|
214
|
+
* leaves such a name alone.
|
|
215
|
+
*
|
|
216
|
+
* An insert or delete inside the body already leaves such a reference right, so this is asked
|
|
217
|
+
* only for what a shift gets wrong: rows taken or given up at the body's end, and a row inserted
|
|
218
|
+
* at its first row (which pushes the whole reference down).
|
|
219
|
+
*
|
|
220
|
+
* One search of the precedent index over the rows that match - an entry per (block, reference)
|
|
221
|
+
* that reads them - so the cost is the readers of the body, on a change of a table's rows. The
|
|
222
|
+
* text a cell shows catches up with the engine the way it does after any shift.
|
|
223
|
+
*
|
|
224
|
+
* A block is re-fitted cell by cell: only the cells whose reference spans the body are rewritten,
|
|
225
|
+
* which splits them out of the block. An array-entered block is one formula, read at its top-left,
|
|
226
|
+
* and is never split.
|
|
227
|
+
*
|
|
228
|
+
* **A DELIBERATE DIVERGENCE lives here** (Michael, 2026-09-22). Excel asks how the cell was
|
|
229
|
+
* authored, not what it reads: a fully relative reference is left where it is when the cell
|
|
230
|
+
* belongs to a shared-formula group, and re-fitted when it stands alone - so `SUM(B2:B5)` follows
|
|
231
|
+
* the body when it was typed and does not when the same three formulas were filled, and the file
|
|
232
|
+
* carries the difference as `<f t="shared">` (`probe-table-refit-fillhandle.ps1`,
|
|
233
|
+
* `probe-table-refit-roundtrip.ps1`). Here a run is a data-model fact, not an authoring one -
|
|
234
|
+
* cells holding the same formula are conflated whatever made them - so honoring that rule would
|
|
235
|
+
* make a formula follow the body or not depending on what a NEIGHBOR happens to hold, which a
|
|
236
|
+
* user cannot see. Every reference that spans the body is re-fitted, however it was written.
|
|
237
|
+
*
|
|
238
|
+
* @param sheet The sheet the table is on, by id or name.
|
|
239
|
+
* @param columns The table's columns. A reference reaching outside them is an ordinary one.
|
|
240
|
+
* @param match The rows a reference has to span to be one of the body's, as they read NOW.
|
|
241
|
+
* @param headerRow The header's row when a reference from it to `match.rowEnd` also counts.
|
|
242
|
+
* @param to The body's rows now.
|
|
243
|
+
* @param afterShift The rows to match are where a shift THIS edit makes will have put them - a
|
|
244
|
+
* row inserted at the body's first row. The table hears of a shift before the engine has made it,
|
|
245
|
+
* so this waits for the next safe point.
|
|
246
|
+
* @param isCurrent Whether the table is still as this change left it.
|
|
247
|
+
*/
|
|
248
|
+
_refitTableRows(sheet: string, columns: {
|
|
249
|
+
colStart: number;
|
|
250
|
+
colEnd: number;
|
|
251
|
+
}, match: {
|
|
252
|
+
rowStart: number;
|
|
253
|
+
rowEnd: number;
|
|
254
|
+
}, headerRow: number | null, to: {
|
|
255
|
+
rowStart: number;
|
|
256
|
+
rowEnd: number;
|
|
257
|
+
}, afterShift: boolean, isCurrent: () => boolean): void;
|
|
258
|
+
/**
|
|
259
|
+
* Replaces every structured reference to `tableId` on a sheet: by its address in `extent`, or by
|
|
260
|
+
* `#REF!` when there is none.
|
|
261
|
+
*/
|
|
262
|
+
protected _rewriteTableReferences(tableId: string, extent: TableExtent | null): void;
|
|
263
|
+
/**
|
|
264
|
+
* Writes `text` over `fsv`'s cells - or over `coords`, a part of them - as the engine's own input.
|
|
265
|
+
* Safe point only.
|
|
266
|
+
*/
|
|
267
|
+
protected _writeBlockText(fsv: FormulaSpatialValue, text: string, coords?: IRange.Coords): void;
|
|
268
|
+
/**
|
|
269
|
+
* @internal
|
|
270
|
+
* Rewrites the 3-D spans that a tab-order change from `before` to `after` broke — an endpoint that
|
|
271
|
+
* `movedId` carried across the other — to their inward neighbor. Called inside the move's commit,
|
|
272
|
+
* so an undo of the move restores the text.
|
|
273
|
+
*/
|
|
274
|
+
_replaceSheetSpans(before: readonly string[], after: readonly string[], movedId?: string): void;
|
|
92
275
|
/**
|
|
93
276
|
* {@inheritDoc IContextContainer.getNamedDependents}
|
|
94
277
|
*
|
|
95
278
|
* @remarks
|
|
279
|
+
* The bucket for a NAME out of {@link _getSymbolDependents}. Kept as the name-flavored spelling
|
|
280
|
+
* the callers read; the index underneath is one index for every symbol kind.
|
|
281
|
+
*/
|
|
282
|
+
protected _getNamedDependents(nameId: string): readonly IRange.Coords[];
|
|
283
|
+
/**
|
|
284
|
+
* Every formula block that references a symbol — a defined name, a table, or an external BOOK —
|
|
285
|
+
* by its stable id, as `{ ...ref, scope: gridId }` coords.
|
|
286
|
+
*
|
|
287
|
+
* @remarks
|
|
96
288
|
* The memo is keyed on the formula spatial's IDENTITY, which is the whole invalidation story:
|
|
97
289
|
* the map is copy-on-write (`getFormulas().clone()` before any mutation, `setFormulas` to
|
|
98
290
|
* publish), so a formula added, removed, shifted or recompiled necessarily replaces it — and an
|
|
99
291
|
* undo, which restores an earlier map, replaces it too. Nothing has to remember to clear this.
|
|
100
292
|
*
|
|
101
293
|
* The sweep is the same `all3D` walk `recompileNamed` and {@link _markDirtyReferencing} already
|
|
102
|
-
* do, done once for every
|
|
294
|
+
* do, done once for every symbol instead of once per symbol. Bucketed off
|
|
295
|
+
* `getReferencedSymbolIds()` — names, tables and books alike — so a book's dependents
|
|
296
|
+
* (`IExternalBook.getDependents`) come out of the same walk as a name's, and a name's body that
|
|
297
|
+
* cites a book lands in the book's bucket with the name's id as its scope.
|
|
103
298
|
*/
|
|
104
|
-
protected
|
|
299
|
+
protected _getSymbolDependents(symbolId: string): readonly IRange.Coords[];
|
|
300
|
+
/**
|
|
301
|
+
* Every symbol id a formula cites, to the blocks citing it — the index
|
|
302
|
+
* {@link _getSymbolDependents} answers from, memoized the same way.
|
|
303
|
+
*/
|
|
304
|
+
protected _getSymbolIndex(): ReadonlyMap<string, readonly IRange.Coords[]>;
|
|
105
305
|
/**
|
|
106
306
|
* {@inheritDoc IContextContainer.getNamedDependentNames}
|
|
107
307
|
*
|
|
@@ -126,6 +326,20 @@ export declare class Calculation extends AbstractModel<State, ICalculation.JSON,
|
|
|
126
326
|
* one naming the changed name directly. Ids that are not names (a table's) expand to themselves.
|
|
127
327
|
*/
|
|
128
328
|
protected _namedTargets(changedIds: Set<string>): ReadonlySet<string>;
|
|
329
|
+
/**
|
|
330
|
+
* @internal
|
|
331
|
+
* Demand/plan counters and timings since construction (or the last {@link _resetStats}) — the
|
|
332
|
+
* plan-cache soak rig. From a console: `SheetXL.getSelectedWorkbook().getCalculation()._stats()`.
|
|
333
|
+
*/
|
|
334
|
+
_stats(): ReturnType<CalcExecutor['getDemandStats']>;
|
|
335
|
+
/** @internal Zeroes every counter/timing so a measurement window starts clean. */
|
|
336
|
+
_resetStats(): void;
|
|
337
|
+
/**
|
|
338
|
+
* @internal
|
|
339
|
+
* Read (no argument) or set the plan-cache mode: `'on'` | `'assert'` | `'off'`. `'assert'` is the
|
|
340
|
+
* diagnostic to flip to if values ever look stale — see `CalcExecutor.planCacheMode`.
|
|
341
|
+
*/
|
|
342
|
+
_planCacheMode(mode?: 'off' | 'assert' | 'on'): 'off' | 'assert' | 'on';
|
|
129
343
|
/** @inheritdoc ICalculation.start */
|
|
130
344
|
start(): Promise<void>;
|
|
131
345
|
/**
|
|
@@ -137,7 +351,7 @@ export declare class Calculation extends AbstractModel<State, ICalculation.JSON,
|
|
|
137
351
|
*
|
|
138
352
|
* - `Starting` — held for `start()`'s drain, which always follows and loops until empty.
|
|
139
353
|
* - Inside a drain — picked up by the loop already running.
|
|
140
|
-
* - `
|
|
354
|
+
* - `Running` and settled — a microtask drain is posted (see {@link _scheduleDrain}).
|
|
141
355
|
*
|
|
142
356
|
* That last case is why this is no longer called `whenStarting`. It only ever handled work that
|
|
143
357
|
* arrived while starting: queuing scheduled nothing, and the array was pumped as a side effect of
|
|
@@ -151,13 +365,65 @@ export declare class Calculation extends AbstractModel<State, ICalculation.JSON,
|
|
|
151
365
|
* only inside a calculation. The drain is a safe point, not a synchronization point.
|
|
152
366
|
*/
|
|
153
367
|
_whenSafe(action: () => Promise<unknown>, priority?: boolean): void;
|
|
368
|
+
/**
|
|
369
|
+
* Sends a grid request through the channel (DESIGN-CALC-SERVICE §4): applied now on a `Running`
|
|
370
|
+
* engine, held in send order while `Starting`, and neither recorded nor sent on an `Off` one -
|
|
371
|
+
* the caller's own view is the truth there, and a start is seeded from it.
|
|
372
|
+
*/
|
|
373
|
+
protected _sendRequest(gridId: string, landingId: string | undefined, request: CalcRequest): Promise<ICalcGrid.Results>;
|
|
374
|
+
protected _sendRequestNow(gridId: string, landingId: string | undefined, request: CalcRequest): Promise<CalcResponse>;
|
|
375
|
+
/** Re-judges every held request: `dead` is what `isDead` answers for it now. */
|
|
376
|
+
protected _markHeld(isDead: (held: HeldRequest) => boolean): void;
|
|
377
|
+
/**
|
|
378
|
+
* A start that did not complete: what the channel held is resolved with nothing (the model
|
|
379
|
+
* keeps every write, and the next start is seeded from it), and whoever waited for the
|
|
380
|
+
* compiler is released.
|
|
381
|
+
*/
|
|
382
|
+
protected _abandonStart(): void;
|
|
383
|
+
protected _releaseCompilerWaiters(): void;
|
|
384
|
+
/**
|
|
385
|
+
* @internal
|
|
386
|
+
* Resolves once the engine can compile: at once when `Running`; when the batch has applied the
|
|
387
|
+
* seeds, ahead of the boot pass, while `Starting`; after the start it makes when `Off`.
|
|
388
|
+
*
|
|
389
|
+
* @remarks
|
|
390
|
+
* What an owner that registers a formula asynchronously waits on (a condition formula's
|
|
391
|
+
* evaluation). Waiting on {@link ready} instead resolves after the boot pass, and the
|
|
392
|
+
* registration then costs a pass of its own (design §6.5: a boot owes one).
|
|
393
|
+
*/
|
|
394
|
+
_whenCanCompile(): Promise<void>;
|
|
395
|
+
/**
|
|
396
|
+
* The start batch (DESIGN-CALC-SERVICE §6.3), in the order the service owns: service-level
|
|
397
|
+
* content first (the names, wired from the priority queue), then the channel in send order
|
|
398
|
+
* (every seed and every request made while the engine was coming up), then the owners that
|
|
399
|
+
* hold a formula of their own (a host whose grid lost its body writes it again; a watch held for
|
|
400
|
+
* the engine registers inside `onReady`), then the one pass the boot owes.
|
|
401
|
+
*
|
|
402
|
+
* @remarks
|
|
403
|
+
* `isLoading()` holds for the whole batch, so a grid seeded here owes its pass rather than
|
|
404
|
+
* running one against siblings not yet seeded. The pass itself runs on a task of its own
|
|
405
|
+
* ({@link _runBoot}): a consumer whose registration chains through promises resolved here (a
|
|
406
|
+
* data validation's, a conditional format's) lands ahead of it, and N of them cost one pass.
|
|
407
|
+
*
|
|
408
|
+
* A held request lands under the engine's current commit: the snapshot it named has been
|
|
409
|
+
* mirrored already, so its writes belong to the tip, and the maps are versioned under that key.
|
|
410
|
+
* One whose snapshot the model has undone since is skipped.
|
|
411
|
+
*/
|
|
412
|
+
protected _boot(): Promise<void>;
|
|
413
|
+
/**
|
|
414
|
+
* Posts the boot pass on a task of its own, and answers the promise `start()`, `ready()` and a
|
|
415
|
+
* `calculate()` made meanwhile wait on. One at a time.
|
|
416
|
+
*/
|
|
417
|
+
protected _scheduleBoot(): Promise<void>;
|
|
418
|
+
/** The boot pass: what the batch, and the consumers that registered since, owe - once. */
|
|
419
|
+
protected _runBoot(): Promise<void>;
|
|
154
420
|
/**
|
|
155
421
|
* Posts a microtask drain, if one is not already coming.
|
|
156
422
|
*
|
|
157
423
|
* @remarks
|
|
158
424
|
* A no-op in the two cases where a drain is already guaranteed to reach this action:
|
|
159
425
|
*
|
|
160
|
-
* - not `
|
|
426
|
+
* - not `Running` — `start()` drains at the tail of its transition, and does so inline so
|
|
161
427
|
* `await start()` covers the queued work. Posting here would race that.
|
|
162
428
|
* - already draining — `_drainPending` loops until the queue is empty, so an action appended
|
|
163
429
|
* during a drain is picked up by the pass in flight.
|
|
@@ -186,8 +452,23 @@ export declare class Calculation extends AbstractModel<State, ICalculation.JSON,
|
|
|
186
452
|
* This is deliberately not folded into {@link _drainPending}. The other three sites would then
|
|
187
453
|
* calculate twice, and `start()` would calculate mid-load — which is the thing `isLoading()`
|
|
188
454
|
* exists to prevent.
|
|
455
|
+
*
|
|
456
|
+
* The pass is reactive whether or not a grid owed it, so manual mode holds it for `calculate()`.
|
|
457
|
+
* That includes the load: a manual-mode file opens with no pass, as Excel's does — its `ca`
|
|
458
|
+
* cells and value-less formulas stay dirty (`isCalculationRequired()`) until asked. A file whose
|
|
459
|
+
* `calcId` says it needs recalculating still gets one; that is the explicit full pass of
|
|
460
|
+
* `calcOnLoad: 'full'`.
|
|
189
461
|
*/
|
|
190
462
|
protected _drainStandalone(): Promise<void>;
|
|
463
|
+
/**
|
|
464
|
+
* Owe a reactive pass for `gridId`, to run once the current flush is over.
|
|
465
|
+
*
|
|
466
|
+
* @remarks
|
|
467
|
+
* The posted form of `calculateGrid`: the drain scheduler already coalesces everything owed at
|
|
468
|
+
* the end of a flush into one pass, and this is how a consumer asks for that pass without
|
|
469
|
+
* running one itself. See {@link IContextContainer.requestCalculateGrid}.
|
|
470
|
+
*/
|
|
471
|
+
protected _owePass(gridId: string): void;
|
|
191
472
|
/**
|
|
192
473
|
* Runs queued actions until the queue is empty. The one drain, used by every site that drains.
|
|
193
474
|
*
|
|
@@ -204,8 +485,8 @@ export declare class Calculation extends AbstractModel<State, ICalculation.JSON,
|
|
|
204
485
|
* shape, and got away with it only because it goes on to call `grid.calculate()` per dirty grid —
|
|
205
486
|
* which loop-drains. It held if something was dirty and did not if nothing was.
|
|
206
487
|
*
|
|
207
|
-
* `_draining`
|
|
208
|
-
* leaves the
|
|
488
|
+
* `_draining` stays set until the last run in flight finishes ({@link _drainDepth}), so a nested
|
|
489
|
+
* drain (an action that calculates) or an overlapping one leaves the other's window intact.
|
|
209
490
|
*
|
|
210
491
|
* **Call this under `if (this._pendingActions?.length)`, not unconditionally.** `await` on an
|
|
211
492
|
* async call yields to the microtask queue even when the callee does nothing, and a calculation
|
|
@@ -214,24 +495,352 @@ export declare class Calculation extends AbstractModel<State, ICalculation.JSON,
|
|
|
214
495
|
* between. An unconditional drain here pushes the whole pass past a microtask boundary and that
|
|
215
496
|
* read returns the raw text instead (`use-signs.test.ts`).
|
|
216
497
|
*/
|
|
217
|
-
protected _drainPending(): Promise<void>;
|
|
498
|
+
protected _drainPending(priorityOnly?: boolean): Promise<void>;
|
|
218
499
|
/** @inheritdoc ICalculation.calculate */
|
|
219
500
|
calculate(options?: ICalculation.CalculateOptions | boolean): Promise<ICalculation.Status>;
|
|
220
501
|
/**
|
|
221
502
|
* @returns The status the engine is in once the pass has run — `Starting` if the request was
|
|
222
|
-
* deferred to the start-up drain, and whatever non-`
|
|
503
|
+
* deferred to the start-up drain, and whatever non-`Running` status turned it away
|
|
223
504
|
* otherwise. Never `undefined`: it used to resolve that on every path including the
|
|
224
505
|
* successful one (the tail simply fell off the end), and two call sites cast the result
|
|
225
506
|
* to `Status` to satisfy {@link ICalculation.calculate}.
|
|
226
507
|
*/
|
|
227
508
|
protected _calculate(options?: ICalculation.CalculateOptions, gridId?: string): Promise<ICalculation.Status>;
|
|
228
|
-
|
|
229
|
-
protected
|
|
509
|
+
/** A pass, counted while it runs: what the calculation state reads as a pass in flight. */
|
|
510
|
+
protected _calculateNow(options?: ICalculation.CalculateOptions, gridId?: string): Promise<ICalculation.Status>;
|
|
511
|
+
protected _runCalculation(options?: ICalculation.CalculateOptions, gridId?: string): Promise<ICalculation.Status>;
|
|
512
|
+
/**
|
|
513
|
+
* A restore moves every grid to another snapshot and reports nothing, so each formula host is
|
|
514
|
+
* told here what its grid now holds.
|
|
515
|
+
* @internal
|
|
516
|
+
*/
|
|
517
|
+
protected _processRestoreOrRevert(state: State, commit: ITransaction.ICommit): void;
|
|
518
|
+
/**
|
|
519
|
+
* Formula text as a cell at `coords` would STORE it, without writing it anywhere.
|
|
520
|
+
*
|
|
521
|
+
* @remarks
|
|
522
|
+
* {@link createFormula} compiles for editing, which keeps what was typed. A committed cell is
|
|
523
|
+
* compiled for storage: `[#This Row]` becomes `@`, and an unqualified structured reference is
|
|
524
|
+
* given the name of the table it binds to - the one at `coords`. An owner that holds formula text
|
|
525
|
+
* apart from any cell (a table column's totals formula while its row is hidden) stores it
|
|
526
|
+
* through this, so it holds what a cell would.
|
|
527
|
+
*
|
|
528
|
+
* @param coords The cell the text is authored at, on the sheet `scope` names (by id or name).
|
|
529
|
+
* @throws When the engine is not Ready, or `scope` names no sheet.
|
|
530
|
+
* @internal
|
|
531
|
+
*/
|
|
532
|
+
_toStoredText(expression: string, coords: IRange.CellCoords & {
|
|
533
|
+
scope: string;
|
|
534
|
+
}): string;
|
|
535
|
+
/**
|
|
536
|
+
* Whether a grid under `id` is in the model as the store is now: a held formula's grid that came
|
|
537
|
+
* back with an undone delete is attached to rather than written again.
|
|
538
|
+
* @internal
|
|
539
|
+
*/
|
|
540
|
+
/**
|
|
541
|
+
* A grid that holds exactly one formula block, as a handle - see {@link FormulaHost}.
|
|
542
|
+
*
|
|
543
|
+
* @remarks
|
|
544
|
+
* Creates the grid unless the container already has one under `id` (a name's grid outlives a
|
|
545
|
+
* redefine and a delete), then answers a handle over it. The handle resolves the grid by id on
|
|
546
|
+
* every use, so it is safe to hold across snapshots.
|
|
547
|
+
*
|
|
548
|
+
* @internal
|
|
549
|
+
*/
|
|
550
|
+
_hasLiveGrid(id: string): boolean;
|
|
551
|
+
_createFormulaHost(options: Calculation.FormulaHostOptions): FormulaHost;
|
|
552
|
+
/**
|
|
553
|
+
* Evaluate an expression once over a block, through the engine.
|
|
554
|
+
*
|
|
555
|
+
* @remarks
|
|
556
|
+
* The implementation of {@link ICalculation.EvaluateOptions.block}: a watch with no lifetime.
|
|
557
|
+
* The body is written over `coords` in a grid that shadows the sheet, exactly as a watch's is
|
|
558
|
+
* (see `WatchAnchor`), one pass evaluates it, and the grid is dropped. What comes back reads over
|
|
559
|
+
* a copy-on-write clone of the dropped grid's values, taken before the drop, so it outlives the
|
|
560
|
+
* grid as a plain object.
|
|
561
|
+
*
|
|
562
|
+
* The grid and its body amend the current commit, as a watch's do: never an undo step. The
|
|
563
|
+
* pass is explicit and seeded from the one grid, so it runs under manual calculation without
|
|
564
|
+
* recalculating what the user has deferred.
|
|
565
|
+
* @internal
|
|
566
|
+
*/
|
|
567
|
+
protected _evaluateOver(options: Calculation.EvaluateOverOptions): Promise<IRange>;
|
|
568
|
+
/**
|
|
569
|
+
* A grid for a model to hold (DESIGN-CALC-SERVICE §13.23): the synchronous half, versioned in
|
|
570
|
+
* the model's store, forwarding every verb as a request. The engine's grid is made by the
|
|
571
|
+
* grid's first request, `create`, which an `Off` engine drops: a start makes it then, from this
|
|
572
|
+
* one. What the engine pushes reaches the owner through the grid's events. It opens empty: the
|
|
573
|
+
* owner attaches its listeners, then seeds it.
|
|
574
|
+
* @internal
|
|
575
|
+
*/
|
|
576
|
+
_createCalcGrid(options: Calculation.CalcGridOptions): CalcGrid;
|
|
577
|
+
/** What a `create` for a model grid carries: its description. */
|
|
578
|
+
protected _specOf(front: CalcGrid): CalcGridSpec;
|
|
579
|
+
/**
|
|
580
|
+
* The engine's grid for a model grid, as a `create` describes it. What it pushes reaches the
|
|
581
|
+
* model grid under the same id.
|
|
582
|
+
*/
|
|
583
|
+
protected _createEngineGrid(spec: CalcGridSpec): CalcGridBackend;
|
|
584
|
+
/**
|
|
585
|
+
* Make the engine's grids from the model's (design §6.3): each live model grid's `create`, the
|
|
586
|
+
* hosts' first (a name's grid before any sheet's); each host's body sent again; then every grid
|
|
587
|
+
* a sheet owns seeded from what it holds now. Requests like any other: held while `Starting`,
|
|
588
|
+
* applied at once on a `Running` engine that is rebuilt.
|
|
589
|
+
*
|
|
590
|
+
* @param full The seeds ask for a full pass - a start's, which the boot keeps only when
|
|
591
|
+
* something was written while `Off`.
|
|
592
|
+
*/
|
|
593
|
+
protected _openEngineGrids(full: boolean): void;
|
|
594
|
+
/**
|
|
595
|
+
* The engine's graph and every grid in it, gone: what `stop()` leaves, and what a rebuild starts
|
|
596
|
+
* from. The model's grids are untouched.
|
|
597
|
+
*/
|
|
598
|
+
protected _dropEngine(): void;
|
|
599
|
+
/**
|
|
600
|
+
* The engine's history starts at the boot: the commits mirrored before it hold none of the
|
|
601
|
+
* grids the boot made, so a restore to one is not followed but rebuilt ({@link _followRestore}).
|
|
602
|
+
* The model's commit now is the boot's.
|
|
603
|
+
*/
|
|
604
|
+
protected _forgetEarlierLandings(modelCommitId?: string | null): void;
|
|
605
|
+
/**
|
|
606
|
+
* The model restored itself to `commitId`: the engine restores its own history there, or - on a
|
|
607
|
+
* `Running` engine whose history does not reach it (a commit from before its start, or one
|
|
608
|
+
* trimmed since) - is rebuilt from the model's grids as they are there, at the next safe point.
|
|
609
|
+
*/
|
|
610
|
+
protected _followRestore(commitId: string): void;
|
|
611
|
+
/**
|
|
612
|
+
* Make the engine again from the model, as a start does: its replicas, its grids and their
|
|
613
|
+
* seeds, with the values the model holds trusted.
|
|
614
|
+
*/
|
|
615
|
+
protected _rebuildEngine(): void;
|
|
616
|
+
/**
|
|
617
|
+
* Report a failure of a request no caller awaits - a grid's seed - as this calculation's error.
|
|
618
|
+
* @internal
|
|
619
|
+
*/
|
|
620
|
+
_reportError(error: unknown): void;
|
|
621
|
+
protected _createBackendGrid(options?: CalcGridBackend.ConstructorOptions): CalcGridBackend;
|
|
622
|
+
protected _registerGrid(grid: CalcGridBackend): void;
|
|
230
623
|
protected _unregisterGrid(gridId: string): void;
|
|
624
|
+
/** The owner's sheet list as it last said ({@link _setSheets}): what a start seeds the replica from. */
|
|
625
|
+
protected _heldSheets(): Calculation.SheetList['sheets'];
|
|
626
|
+
/** One sheet of {@link _heldSheets} by its grid id, or `undefined` for a grid that is no sheet. */
|
|
627
|
+
protected _heldSheetAt(id: string): Calculation.SheetList['sheets'][number] | undefined;
|
|
628
|
+
/**
|
|
629
|
+
* The owner's sheet list as it is now: every sheet's grid id and name, in tab order, hidden ones
|
|
630
|
+
* included (DESIGN-CALC-SERVICE §8). The owner calls this whenever its list changes - a sheet
|
|
631
|
+
* added, deleted, moved, copied or renamed - and before any grid that names a sheet in it
|
|
632
|
+
* seeds. Not on a restore: this record is restored with the owner's own, and the engine's
|
|
633
|
+
* replica with the engine's store.
|
|
634
|
+
*
|
|
635
|
+
* @remarks
|
|
636
|
+
* Held in the caller's operation (folded into the current commit when none is open) and sent
|
|
637
|
+
* to the engine as one `sheets` message: applied at once on a `Running` engine, held in order
|
|
638
|
+
* while `Starting`. An `Off` engine is told nothing; its next start seeds the replica from this
|
|
639
|
+
* record, and owes a full pass only when a sheet already listed was renamed, moved or removed.
|
|
640
|
+
* @internal
|
|
641
|
+
*/
|
|
642
|
+
_setSheets(sheets: readonly (readonly [id: string, name: string | null])[]): void;
|
|
643
|
+
/**
|
|
644
|
+
* Replaces the replica with the list a `sheets` message carries.
|
|
645
|
+
*
|
|
646
|
+
* @remarks
|
|
647
|
+
* A sheet that survived with a different name or at a different position changes what the
|
|
648
|
+
* functions reading names and positions answer (`INDIRECT`, `FORMULATEXT`, `CELL`, `SHEET`, a
|
|
649
|
+
* 3-D span's members), and none of that is a precedent: a full pass follows, which is what the
|
|
650
|
+
* model asked for on a rename or a move before the engine was told of either. A sheet
|
|
651
|
+
* appended moves nothing; one inserted or deleted ahead of a survivor moves it, and counts.
|
|
652
|
+
*/
|
|
653
|
+
protected _applySheets(sheets: readonly (readonly [id: string, name: string | null])[]): void;
|
|
654
|
+
/**
|
|
655
|
+
* Before a start applies what it held: every sheet a held \`sheets\` message adds enters the
|
|
656
|
+
* replica at the end, under the name it was first listed by. A defined name's body is applied
|
|
657
|
+
* ahead of the seeds and may name a sheet listed while starting; the messages themselves still
|
|
658
|
+
* apply in send order, so a seed sent before a rename binds the name it was sent under.
|
|
659
|
+
*/
|
|
660
|
+
protected _enterHeldSheets(held: readonly HeldRequest[]): void;
|
|
661
|
+
/** The model's tables as the replica holds them: by id, each table's name and columns. */
|
|
662
|
+
protected _liveTables(): Map<string, TableSymbols>;
|
|
663
|
+
/** The defined names as the replica holds them: by id, each name's spelling and scope sheet. */
|
|
664
|
+
protected _liveNames(): Map<string, NameSymbols>;
|
|
665
|
+
/**
|
|
666
|
+
* Tell the engine one table's name and columns as they are now, or that it is gone - from the
|
|
667
|
+
* model, at the moment it changes, inside the operation (the sheet's table callbacks). So the
|
|
668
|
+
* message is in the channel where the change happened, between the requests made before it and
|
|
669
|
+
* those made after, and a request held while `Starting` binds the names it was sent under. A
|
|
670
|
+
* restore changes nothing here: it reaches the engine as the revert of its own store. An `Off`
|
|
671
|
+
* engine is told nothing; a start seeds the replica from the model.
|
|
672
|
+
*
|
|
673
|
+
* @remarks
|
|
674
|
+
* Reads the table's own record only: a read of the sheet inside an open operation would make the
|
|
675
|
+
* writes a cell buffer holds.
|
|
676
|
+
* @internal
|
|
677
|
+
*/
|
|
678
|
+
_tableChanged(table: ITable, removed: boolean): void;
|
|
679
|
+
/** A name written, as {@link _tableChanged} tells a table. */
|
|
680
|
+
protected _nameWritten(written: NamedFormulaCollection.NamesWritten): void;
|
|
681
|
+
/**
|
|
682
|
+
* One change to a replica, as a message: sent to a `Starting` engine as it is (the channel holds
|
|
683
|
+
* it in order), and to a `Running` one only when the replica does not already say so.
|
|
684
|
+
*/
|
|
685
|
+
protected _sendSymbolChange<T>(kind: 'tables' | 'names', id: string, entry: T | null, same: (a: T | null | undefined, b: T | null) => boolean): void;
|
|
686
|
+
/**
|
|
687
|
+
* Applies what a `tables` message carries to the replica. A reference bound by a name the
|
|
688
|
+
* replica did not have yet heals to it now, as one to a table added does.
|
|
689
|
+
*/
|
|
690
|
+
protected _applyTables(changes: readonly (readonly [id: string, table: TableSymbols | null])[]): void;
|
|
691
|
+
/** Applies what a `names` message carries, as {@link _applyTables} does. */
|
|
692
|
+
protected _applyNames(changes: readonly (readonly [id: string, name: NameSymbols | null])[]): void;
|
|
693
|
+
/** What a replica's change re-resolved - healed, renamed, gone - is marked for the next pass. */
|
|
694
|
+
protected _markDirtyReconciled(provider: {
|
|
695
|
+
reconcile(): string[];
|
|
696
|
+
} | null): void;
|
|
697
|
+
private _tablesDerived;
|
|
698
|
+
private _namesDerived;
|
|
699
|
+
/**
|
|
700
|
+
* The table replica and its name index, or `null` while `Off`: an engine that has been told
|
|
701
|
+
* nothing reads the model.
|
|
702
|
+
*/
|
|
703
|
+
protected _replicaTables(): {
|
|
704
|
+
of: ReadonlyMap<string, TableSymbols>;
|
|
705
|
+
idByName: Map<string, string>;
|
|
706
|
+
} | null;
|
|
707
|
+
/** The name replica and its spelling index, as {@link _replicaTables}. @internal */
|
|
708
|
+
_replicaNames(): {
|
|
709
|
+
of: ReadonlyMap<string, NameSymbols>;
|
|
710
|
+
idsByName: Map<string, string[]>;
|
|
711
|
+
} | null;
|
|
712
|
+
/**
|
|
713
|
+
* The name a spelling resolves to from `scope`, by the replica: that sheet's own name first, then
|
|
714
|
+
* the global; asked from no sheet, the global, else any scoped one - the collection's rule
|
|
715
|
+
* (`NamedFormulaCollection.getByName`). `undefined` when the replica cannot answer, and the
|
|
716
|
+
* collection is asked instead.
|
|
717
|
+
* @internal
|
|
718
|
+
*/
|
|
719
|
+
_replicaNameId(name: string, scope: string | null | undefined): string | undefined;
|
|
720
|
+
/** See {@link _modelSymbols}. */
|
|
721
|
+
protected _modelSymbolRegistry: ISymbolRegistry;
|
|
722
|
+
/**
|
|
723
|
+
* The model's symbol map (DESIGN-CALC-SERVICE §8): what the facade images the engine's records
|
|
724
|
+
* against. Sheets answer from the model's live list; the rest from the engine's providers.
|
|
725
|
+
* @internal
|
|
726
|
+
*/
|
|
727
|
+
_modelSymbols(): ISymbolRegistry;
|
|
728
|
+
/**
|
|
729
|
+
* What images a grid's records for the model (DESIGN-CALC-SERVICE §8): the model's symbol map,
|
|
730
|
+
* the grid as home scope, its bounds and the reader's locale, both read live so a rename or a
|
|
731
|
+
* locale switch shows without a recompile.
|
|
732
|
+
* @internal
|
|
733
|
+
*/
|
|
734
|
+
_imagerFor(gridId: string): FormulaImager;
|
|
735
|
+
private _sheetsDerived;
|
|
736
|
+
private _sheetsCache;
|
|
737
|
+
/** Every sheet's grid id in tab order, from the replica. */
|
|
738
|
+
protected _sheetIds(): readonly string[];
|
|
739
|
+
/** A sheet's grid id by its name, as Excel reads sheet names: case-insensitively. `null` when none. */
|
|
740
|
+
protected _sheetIdByName(name: string): string | null;
|
|
741
|
+
/** A sheet's name by its grid id, or `null` for a grid that is no sheet. */
|
|
742
|
+
protected _sheetName(gridId: string): string | null;
|
|
231
743
|
/** @inheritdoc ICalculation.stop */
|
|
232
744
|
stop(): Promise<void>;
|
|
745
|
+
/**
|
|
746
|
+
* {@inheritDoc ITransaction.ITransactional.close}
|
|
747
|
+
*
|
|
748
|
+
* @remarks
|
|
749
|
+
* Brings the ENGINE down before the model goes away. The inherited close is a model close — it
|
|
750
|
+
* flips the closed flag and detaches the transaction listener — which left a closed calculation
|
|
751
|
+
* still reporting {@link ICalculation.Status.Running}, with `onStopping`/`onStop` never sent to
|
|
752
|
+
* listeners that were about to be discarded.
|
|
753
|
+
*
|
|
754
|
+
* {@link stop} resolves synchronously (it awaits nothing), so the `void` here loses no ordering;
|
|
755
|
+
* it is `async` only because the interface says so. It is also a no-op unless the status is
|
|
756
|
+
* `Running`, which is what makes closing a still-STARTING engine safe — `start()` observes the close
|
|
757
|
+
* at its own await points instead.
|
|
758
|
+
*/
|
|
759
|
+
close(): void;
|
|
760
|
+
/** A model holding writes for the engine makes them on this read (`ITransaction.Hooks.writes`). */
|
|
761
|
+
protected _flushModel(): void;
|
|
762
|
+
/**
|
|
763
|
+
* Runs `action` with its engine writes landing under `landingId`, or as they are when none.
|
|
764
|
+
*
|
|
765
|
+
* @remarks
|
|
766
|
+
* A root-level request after a nested savepoint of the same root has landed: the root's own
|
|
767
|
+
* commit is behind the tip, and the savepoint is part of the root for good, so the write joins
|
|
768
|
+
* the tip. The engine's live maps are always the tip's.
|
|
769
|
+
* @internal
|
|
770
|
+
*/
|
|
771
|
+
_landUnder<R>(landingId: string | undefined, action: () => R): R;
|
|
772
|
+
/** Whether the engine still holds a commit: its own record is in every commit made since it was built. */
|
|
773
|
+
protected _holdsEngineCommit(engineId: string): boolean;
|
|
774
|
+
/**
|
|
775
|
+
* Records the model commit that just landed: its mirror, a commit of the engine's own that names
|
|
776
|
+
* it in the engine's record.
|
|
777
|
+
*
|
|
778
|
+
* @remarks
|
|
779
|
+
* A commit even when nothing landed under the model's: an engine write made after the close,
|
|
780
|
+
* outside any model operation (a deferred recompile), amends the engine's tip, and that tip has
|
|
781
|
+
* to be this model commit's, not the one before it, or a restore to the one before carries the
|
|
782
|
+
* write. The engine's record changes with every mirror, so the commit is never elided.
|
|
783
|
+
*/
|
|
784
|
+
protected _mirror(commitId: string): void;
|
|
785
|
+
/** Forgets a landing, and the engine commit it made if it made one. */
|
|
786
|
+
protected _dropLanding(landingId: string): void;
|
|
787
|
+
/** Drops the landings whose engine commit the store has trimmed or pruned. Rare: sized by the store's cap. */
|
|
788
|
+
protected _sweepLandings(): void;
|
|
789
|
+
/** The model commits on the live history: the current one and its ancestors. */
|
|
790
|
+
protected _modelHistory(): Set<string>;
|
|
791
|
+
/**
|
|
792
|
+
* A model root closed without landing (an amend, or nothing written): the engine commits made
|
|
793
|
+
* under its id (`<id>:0`, `<id>:n`) fold into the mirror of the model's current commit.
|
|
794
|
+
*/
|
|
795
|
+
protected _foldPhantom(rootId: string): void;
|
|
796
|
+
/**
|
|
797
|
+
* The engine commit an engine write made during a model operation lands in: the operation's
|
|
798
|
+
* root (`<id>:0`) or the nested savepoint open now. `null` outside an operation, or while a
|
|
799
|
+
* landing is already open (the write joins it).
|
|
800
|
+
*/
|
|
801
|
+
protected _modelLanding(): string | null;
|
|
802
|
+
/**
|
|
803
|
+
* Engine state is never a step of history on its own: a write is attributed to the model
|
|
804
|
+
* operation it is made in, or folded into the current snapshot (a pass's bookkeeping).
|
|
805
|
+
* @internal
|
|
806
|
+
*/
|
|
807
|
+
protected _updateState(updateState?: Partial<State>, options?: ITransaction.StoreOperationOptions, events?: (keyof ICalculation.IListeners)[]): this;
|
|
808
|
+
/** @internal */
|
|
809
|
+
protected _amendState(updateState?: Partial<State>, options?: ITransaction.StoreOperationOptions, events?: (keyof ICalculation.IListeners)[]): this;
|
|
810
|
+
/**
|
|
811
|
+
* Restore the engine's history to the model's `commitId`, once; answers what changed per grid.
|
|
812
|
+
*
|
|
813
|
+
* @remarks
|
|
814
|
+
* The changed regions are the union of what every engine commit between the two snapshots
|
|
815
|
+
* recorded as touched (`IntentTouched`), whichever direction the restore goes; they are marked
|
|
816
|
+
* dirty so the pass that follows recomputes them, and handed back so each grid can re-vend the
|
|
817
|
+
* blocks over them. An id the engine no longer holds is answered with `null`: the engine's
|
|
818
|
+
* history is shorter than the model's there, and a seed is what brings it back (step 3).
|
|
819
|
+
* @internal
|
|
820
|
+
*/
|
|
821
|
+
_revertTo(commitId: string): Map<string, IRange.Coords[]> | null;
|
|
822
|
+
/**
|
|
823
|
+
* Hook the rollback of the savepoint a request goes out under, the first time one does: a
|
|
824
|
+
* `rollback` message follows, through the channel, if it rolls back. By a step that shares the
|
|
825
|
+
* savepoint and writes nothing - its outcome hooks pass to the savepoint when it closes. A
|
|
826
|
+
* request landing on the operation's own commit (`<id>:0`) needs none: a root rollback is seen by
|
|
827
|
+
* the engine's listener on the store.
|
|
828
|
+
*/
|
|
829
|
+
protected _hookRollback(landingId: string): void;
|
|
830
|
+
private _rollbackHooked;
|
|
831
|
+
/**
|
|
832
|
+
* A nested savepoint of the model rolled back: what the engine landed under it goes with it.
|
|
833
|
+
* What a `rollback` message does.
|
|
834
|
+
*/
|
|
835
|
+
protected _savepointRolledBack(savepointId: string): void;
|
|
233
836
|
/** @inheritdoc ICalculation.getStatus */
|
|
234
837
|
getStatus(): ICalculation.Status;
|
|
838
|
+
/**
|
|
839
|
+
* Resolves once every request sent to a grid has settled and its sender has handled the
|
|
840
|
+
* response. What a save waits for after `ready()`.
|
|
841
|
+
* @internal
|
|
842
|
+
*/
|
|
843
|
+
_whenRequestsSettled(): Promise<void>;
|
|
235
844
|
/** @inheritdoc ICalculation.getCalculationMode */
|
|
236
845
|
getCalculationMode(): ICalculation.CalculationMode;
|
|
237
846
|
/** @inheritdoc ICalculation.setCalculationMode */
|
|
@@ -246,19 +855,36 @@ export declare class Calculation extends AbstractModel<State, ICalculation.JSON,
|
|
|
246
855
|
toJSON(): ICalculation.JSON;
|
|
247
856
|
/** @inheritdoc ICalculation.ready */
|
|
248
857
|
ready(options?: ICalculation.CalculateOptions): Promise<ICalculation.Status>;
|
|
858
|
+
/** One round of `ready()`: up, drained, and the passes the dirty set owes (none in manual mode). */
|
|
859
|
+
protected _readyPass(full: boolean): Promise<void>;
|
|
860
|
+
/** @inheritdoc ICalculation.getCalculationState */
|
|
861
|
+
getCalculationState(): ICalculation.CalculationState;
|
|
862
|
+
/**
|
|
863
|
+
* Work in flight: answers owed to the model, a drain posted or running, deferred actions, a pass
|
|
864
|
+
* owed or running, the boot. What `ready()` waits out.
|
|
865
|
+
*/
|
|
866
|
+
protected _isWorking(): boolean;
|
|
867
|
+
/**
|
|
868
|
+
* Checks the calculation state once the current flush is over: announces a change, and wakes
|
|
869
|
+
* every `ready()` waiting for work in flight to end. Called wherever that work starts or ends.
|
|
870
|
+
*/
|
|
871
|
+
protected _noteCalculationState(): void;
|
|
249
872
|
/**
|
|
250
873
|
* The locale-aware editing compiler, (re)built when the workbook locale (separators, Plane 1) or
|
|
251
874
|
* active spreadsheet-language pack (boolean literals, Plane 3) has changed since it was last built.
|
|
252
875
|
* Only the editing path uses locale-specific separators; the calc path (`_compiler`) is always
|
|
253
876
|
* canonical because it only ever parses stored/API text.
|
|
254
877
|
*/
|
|
255
|
-
protected _getEditingCompiler(): IFormulaCompiler;
|
|
878
|
+
protected _getEditingCompiler(target?: ICalculation.FormulaTarget): IFormulaCompiler;
|
|
256
879
|
/** @inheritdoc ICalculation.createFormula */
|
|
257
|
-
createFormula(expression: string, coords?: Partial<IRange.CellCoords
|
|
880
|
+
createFormula(expression: string, coords?: Partial<IRange.CellCoords>, options?: ICalculation.CreateFormulaOptions): ICalculation.IFormula;
|
|
881
|
+
protected _createFormula(expression: string, coords: Partial<IRange.CellCoords> | undefined, target: ICalculation.FormulaTarget): ICalculation.IFormula;
|
|
258
882
|
/** {@inheritDoc ICalculation.evaluate} */
|
|
259
|
-
evaluate(expression: string, options?: number | ICalculation.EvaluateOptions & Partial<IRange.CellCoords>): Promise<Scalar | IRange>;
|
|
883
|
+
evaluate(expression: string, options?: number | ICalculation.EvaluateOptions & Partial<IRange.CellCoords> & ICalculation.CreateFormulaOptions): Promise<Scalar | IRange>;
|
|
260
884
|
/** @inheritdoc ICalculation.getFunctions */
|
|
261
885
|
getFunctions(): IFunctionCollection;
|
|
886
|
+
/** @inheritdoc ICalculation.getExternalBooks */
|
|
887
|
+
getExternalBooks(): IExternalBookCollection;
|
|
262
888
|
/** @inheritdoc ICalculation.getNamedFormulas */
|
|
263
889
|
getNamedFormulas(): INamedFormulasCollection;
|
|
264
890
|
/**
|
|
@@ -288,6 +914,8 @@ export declare class Calculation extends AbstractModel<State, ICalculation.JSON,
|
|
|
288
914
|
protected _statusMessage(): string;
|
|
289
915
|
get [Symbol.toStringTag](): string;
|
|
290
916
|
toString(): string;
|
|
917
|
+
/** {@inheritDoc ICalculation.isICalculation} */
|
|
918
|
+
get isICalculation(): true;
|
|
291
919
|
}
|
|
292
920
|
/**
|
|
293
921
|
* Interfaces for creating `Calculation` items.
|
|
@@ -298,6 +926,58 @@ export declare class Calculation extends AbstractModel<State, ICalculation.JSON,
|
|
|
298
926
|
* {@link Calculation}
|
|
299
927
|
*/
|
|
300
928
|
export declare namespace Calculation {
|
|
929
|
+
/** See {@link Calculation._evaluateOver}. */
|
|
930
|
+
interface EvaluateOverOptions {
|
|
931
|
+
/** The sheet whose coordinate space the block is in. */
|
|
932
|
+
sheetGridId: string;
|
|
933
|
+
/** The block: the body is filled over it. */
|
|
934
|
+
coords: IRange.Coords;
|
|
935
|
+
/** The expression as authored, without a leading `=`. */
|
|
936
|
+
expression: string;
|
|
937
|
+
/** Where the expression is authored; `coords`' top-left for a plain fill. */
|
|
938
|
+
authoredAt: IRange.CellCoords;
|
|
939
|
+
/** Each cell of the block is its own 1x1 array-entered formula. See {@link ICalculation.EvaluateOptions.arrayFirstCell}. */
|
|
940
|
+
arrayFirstCell?: boolean;
|
|
941
|
+
}
|
|
942
|
+
/** See {@link Calculation._createFormulaHost}. */
|
|
943
|
+
interface FormulaHostOptions {
|
|
944
|
+
/** The grid's id; an existing grid under it is reused. */
|
|
945
|
+
id: string;
|
|
946
|
+
/** The sheet grid whose coordinate space the body lives in - a watch. See {@link ICalcGrid.getShadowOf}. */
|
|
947
|
+
shadowOf?: string;
|
|
948
|
+
/** `true` for a grid whose (0,0) is a synthetic anchor - a name. See {@link CalcGridBackend.ConstructorOptions.unanchored}. */
|
|
949
|
+
unanchored?: boolean;
|
|
950
|
+
/** `true` for a body whose every cell is its own 1x1 array-entered formula. See {@link ICalcGrid.isArrayFirstCell}. */
|
|
951
|
+
arrayFirstCell?: boolean;
|
|
952
|
+
/** The grid's size: fixed, a name's. */
|
|
953
|
+
entireCoords?: IRange.Coords;
|
|
954
|
+
/** The grid whose size the body has, whatever it is then: a sheet's, for a body on it. */
|
|
955
|
+
sizeOf?: string;
|
|
956
|
+
/** Told after every pass that wrote the grid. */
|
|
957
|
+
onCalculated?: (results: ICalcGrid.Results) => void;
|
|
958
|
+
/** Told after a restore or revert has replaced the body under the host. */
|
|
959
|
+
onResync?: () => void;
|
|
960
|
+
}
|
|
961
|
+
/** The owner's sheet list as {@link Calculation._setSheets} holds it. */
|
|
962
|
+
interface SheetList {
|
|
963
|
+
/** Every sheet's grid id and name, in tab order. */
|
|
964
|
+
readonly sheets: readonly (readonly [id: string, name: string | null])[];
|
|
965
|
+
}
|
|
966
|
+
/** See {@link Calculation._createCalcGrid}. */
|
|
967
|
+
interface CalcGridOptions extends CalcGrid.HostOptions, Pick<CalcGrid.ConstructorOptions, 'valuesAxis'> {
|
|
968
|
+
/** The grid's id; a new one is made when absent. */
|
|
969
|
+
uuid?: string;
|
|
970
|
+
/** See {@link CalcGridSpec.shadowOf}. */
|
|
971
|
+
shadowOf?: string;
|
|
972
|
+
/** See {@link CalcGridSpec.unanchored}. */
|
|
973
|
+
unanchored?: boolean;
|
|
974
|
+
/** See {@link CalcGridSpec.arrayFirstCell}. */
|
|
975
|
+
arrayFirstCell?: boolean;
|
|
976
|
+
/** See {@link CalcGridSpec.entireCoords}. */
|
|
977
|
+
entireCoords?: IRange.Coords;
|
|
978
|
+
/** See {@link CalcGridSpec.sizeOf}. */
|
|
979
|
+
sizeOf?: string;
|
|
980
|
+
}
|
|
301
981
|
/**
|
|
302
982
|
* Options available when creating a Calculation Service.
|
|
303
983
|
*/
|
|
@@ -321,29 +1001,21 @@ export declare namespace Calculation {
|
|
|
321
1001
|
*/
|
|
322
1002
|
getActiveCell?: () => IRange.CellCoords | null;
|
|
323
1003
|
/**
|
|
324
|
-
*
|
|
1004
|
+
* Whether defined names refuse edits, on top of the calculation's own read-only state. A
|
|
1005
|
+
* workbook answers with its structure protection.
|
|
325
1006
|
*/
|
|
1007
|
+
isNamesReadOnly?: () => boolean;
|
|
326
1008
|
/**
|
|
327
|
-
*
|
|
328
|
-
*
|
|
329
|
-
*
|
|
330
|
-
*
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
getId(): string;
|
|
334
|
-
getName(): string;
|
|
335
|
-
getEntireCoords: () => IRange.Coords | null;
|
|
336
|
-
getRange?: (address: ICellRange.Address, options?: ICellRange.GetRangeOptions) => ICellRange;
|
|
337
|
-
getRanges?: (address: ICellRanges.Address, options?: ICellRange.GetRangeOptions) => ICellRanges;
|
|
338
|
-
} | null;
|
|
339
|
-
/**
|
|
340
|
-
* Returns a sheet handle given a name.
|
|
1009
|
+
* External books to hydrate at construction, in `IWorkbook.JSON.externalBooks` form — `[n]`
|
|
1010
|
+
* order, `null` for a DDE/OLE gap.
|
|
1011
|
+
*
|
|
1012
|
+
* @remarks
|
|
1013
|
+
* The engine owns the collection ({@link ICalculation.getExternalBooks}) for the reason it owns
|
|
1014
|
+
* defined names: a book is a symbol formulas bind into, and its dependents are the engine's index.
|
|
341
1015
|
*/
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
getEntireCoords: () => IRange.Coords | null;
|
|
346
|
-
} | null;
|
|
1016
|
+
externalBooks?: (IExternalBook.JSON | null)[];
|
|
1017
|
+
/** See {@link ICellContainerOptions.externalBookResolver}; held by the collection for the engine's life. */
|
|
1018
|
+
externalBookResolver?: IExternalBook.IResolver;
|
|
347
1019
|
/**
|
|
348
1020
|
* Named item collection shared with the workbook.
|
|
349
1021
|
*
|
|
@@ -362,12 +1034,6 @@ export declare namespace Calculation {
|
|
|
362
1034
|
* engine has no pre-load lifecycle state.
|
|
363
1035
|
*/
|
|
364
1036
|
names?: INamed.JSON[];
|
|
365
|
-
/**
|
|
366
|
-
* A structural transform applied to each hydrated name's expression as it compiles — the READ
|
|
367
|
-
* half of the format-dialect hook (see `IWorkbook.ConstructorOptions.formulaTransform`).
|
|
368
|
-
* Applies only to {@link names}; formulas added later compile without it.
|
|
369
|
-
*/
|
|
370
|
-
formulaTransform?: ICalculation.FormulaTransform;
|
|
371
1037
|
getRanges?: (address: ICellRanges.Address, options?: ICellRange.GetRangeOptions) => ICellRanges;
|
|
372
1038
|
getRange?: (address: ICellRange.Address, options?: ICellRange.GetRangeOptions) => ICellRange;
|
|
373
1039
|
/**
|
|
@@ -381,7 +1047,7 @@ export declare namespace Calculation {
|
|
|
381
1047
|
* `INamedRange` — see DESIGN-NAMED-FORMULAS.md §4). Structural like `getRange`/`getRanges`,
|
|
382
1048
|
* and like them supplied by the workbook. Without it, graph answers fall back to cells only.
|
|
383
1049
|
*/
|
|
384
|
-
createGraphRanges?: (cells: readonly IRange.Coords[], names: readonly
|
|
1050
|
+
createGraphRanges?: (cells: readonly IRange.Coords[], names: readonly NamedNodeInfo[]) => ICellRanges | null;
|
|
385
1051
|
getSheetIndex?: (sheetName?: string) => number;
|
|
386
1052
|
getSheetCount?: () => number;
|
|
387
1053
|
strings?: IStringCollection;
|
|
@@ -396,7 +1062,7 @@ export declare namespace Calculation {
|
|
|
396
1062
|
*
|
|
397
1063
|
* @defaultValue 100
|
|
398
1064
|
*/
|
|
399
|
-
|
|
1065
|
+
maxIteration?: number;
|
|
400
1066
|
/**
|
|
401
1067
|
* The maximum change allowed between iterations when performing iterative calculations.
|
|
402
1068
|
*
|
|
@@ -408,7 +1074,25 @@ export declare namespace Calculation {
|
|
|
408
1074
|
/**
|
|
409
1075
|
* Transaction State for Calculation
|
|
410
1076
|
*/
|
|
1077
|
+
/**
|
|
1078
|
+
* A grid request the channel holds while the engine is `Starting` (DESIGN-CALC-SERVICE §4): the
|
|
1079
|
+
* request as data, the snapshot it names, and the caller's continuation.
|
|
1080
|
+
*/
|
|
1081
|
+
interface HeldRequest {
|
|
1082
|
+
gridId: string;
|
|
1083
|
+
request: CalcRequest;
|
|
1084
|
+
/** The engine commit it would have landed in; what a nested rollback names. */
|
|
1085
|
+
landingId: string | undefined;
|
|
1086
|
+
/** The model snapshot it was made at (`RequestOptions.commitId`); what a restore names. */
|
|
1087
|
+
commitId: string | undefined;
|
|
1088
|
+
/** The model has undone the snapshot it was made at: skipped when applied, unless a redo revives it. */
|
|
1089
|
+
dead: boolean;
|
|
1090
|
+
resolve: (response: CalcResponse | PromiseLike<CalcResponse>) => void;
|
|
1091
|
+
reject: (error: unknown) => void;
|
|
1092
|
+
}
|
|
411
1093
|
interface State extends AbstractModel.State {
|
|
1094
|
+
/** The model commit this engine commit mirrors; written by every mirror so the commit lands. */
|
|
1095
|
+
mirrorOf?: string;
|
|
412
1096
|
/**
|
|
413
1097
|
* Top down evaluation and marking dirty.
|
|
414
1098
|
* This is the only spatial map that is completely updated via api.
|
|
@@ -442,13 +1126,34 @@ interface State extends AbstractModel.State {
|
|
|
442
1126
|
/**
|
|
443
1127
|
* All registered grids.
|
|
444
1128
|
*/
|
|
445
|
-
gridsAll: Map<string,
|
|
1129
|
+
gridsAll: Map<string, CalcGridBackend>;
|
|
1130
|
+
/**
|
|
1131
|
+
* The engine's replica of the model's sheet list (DESIGN-CALC-SERVICE §8): grid id to name, in
|
|
1132
|
+
* tab order. What every symbol lookup, span and sheet-position function reads. Fed by the
|
|
1133
|
+
* `sheets` message and by grid registration; versioned here so a revert restores it with the
|
|
1134
|
+
* formulas that bound through it.
|
|
1135
|
+
*/
|
|
1136
|
+
sheets: ReadonlyMap<string, string | null>;
|
|
1137
|
+
/**
|
|
1138
|
+
* The engine's replica of the model's tables (DESIGN-CALC-SERVICE §8): table id to its name and
|
|
1139
|
+
* its columns' ids and names. What a structured reference binds and images through. Fed by the
|
|
1140
|
+
* `tables` message, seeded at a start, versioned here as {@link sheets} is.
|
|
1141
|
+
*/
|
|
1142
|
+
tables: ReadonlyMap<string, TableSymbols>;
|
|
1143
|
+
/**
|
|
1144
|
+
* The engine's replica of the defined names: name id to its spelling and the sheet it is scoped
|
|
1145
|
+
* to. What a name binds and images through. Fed by the `names` message, as {@link tables} is.
|
|
1146
|
+
*/
|
|
1147
|
+
names: ReadonlyMap<string, NameSymbols>;
|
|
1148
|
+
/**
|
|
1149
|
+
* Each grid's per-grid maps as of this snapshot (`CalcGridMaps`): values, contentful, spills,
|
|
1150
|
+
* errors, pending, circular. Copy-on-write per request; handed back to the grid on a restore.
|
|
1151
|
+
*/
|
|
1152
|
+
gridMaps: Map<string, object>;
|
|
446
1153
|
/**
|
|
447
1154
|
* Listeners to individual named items
|
|
448
1155
|
*/
|
|
449
1156
|
itemRemoveListeners: (() => void)[];
|
|
450
1157
|
}
|
|
451
|
-
interface CommitView extends AbstractModel.CommitView {
|
|
452
|
-
}
|
|
453
1158
|
export {};
|
|
454
1159
|
//# sourceMappingURL=Calculation.d.ts.map
|