@sheetxl/sdk 0.8.0-beta.1 → 0.8.0-beta.3
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/cjs/B0AS8k-hrSCBUlUY.cjs +1 -0
- package/browser/cjs/B308aXzcAYr1GN1c.cjs +1 -0
- package/browser/cjs/B44p8LIyxG3GtaGC.cjs +93 -0
- package/browser/cjs/{a0Z-SXs_N71CtqYb.cjs → D6YaqporVrSewZpm.cjs} +1 -1
- package/browser/cjs/DjWcveVCs0NFiKep.cjs +1 -0
- package/browser/cjs/index.cjs +2 -2
- package/browser/esm/-OKDZ9cUBtkgD4Zr.mjs +20 -0
- package/browser/esm/8Nw0lKc4ISs7hEJT.mjs +70223 -0
- package/browser/esm/{DlPMeIyxT9tG_WDk.mjs → BmEEyMxNzlbXG98H.mjs} +2 -2
- package/browser/esm/BtdDRkWn-zCV3oic.mjs +394 -0
- package/browser/esm/DaCTT4vda0m8Fnxo.mjs +8 -0
- package/browser/esm/{B0HS42a7lga1k1U_.mjs → DvFKKE72ZA02l8iF.mjs} +1 -1
- package/browser/esm/{uyWBMSIxMlt8n5Z3.mjs → Z-dzbKvqaxll9l_t.mjs} +2 -2
- package/browser/esm/index.mjs +871 -696
- package/licenses/dependencies.txt +204 -204
- package/node/esm/{Cku7XiUvw1xrRasi.mjs → BpMTlTrJLWh_wJ5H.mjs} +1 -1
- package/node/esm/D5quDVovf1zjYBgJ.mjs +28 -0
- package/node/esm/DP0M3_S_dwLwRMiA.mjs +403 -0
- package/node/esm/DTHN_EkuOscW3f3B.mjs +8 -0
- package/node/esm/index.mjs +54375 -39377
- package/package.json +6 -7
- package/resources/locales/de/model.msg.json +45 -9
- package/resources/locales/en/model.msg.json +42 -9
- package/types/scripting-api.json +7094 -0
- package/types/scripting-enums.json +54 -8
- package/types/scripting.d.ts +6985 -1171
- 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} +41 -40
- package/types/src/border/index.d.ts +1 -1
- package/types/src/calculation/Calculation.d.ts +740 -35
- package/types/src/calculation/ExternalBookBindings.d.ts +118 -0
- package/types/src/calculation/FormulaText.d.ts +74 -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/compiler/ASTTypes.d.ts +58 -0
- package/types/src/calculation/compiler/CompilerUtils.d.ts +134 -12
- 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 +124 -21
- package/types/src/calculation/formula/FormulaRecordView.d.ts +79 -0
- package/types/src/calculation/formula/IFormulaBlock.d.ts +261 -67
- package/types/src/calculation/formula/LambdaValue.d.ts +15 -16
- 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/initializeFunctions.d.ts +15 -2
- package/types/src/calculation/grid/CalcGrid.d.ts +384 -158
- package/types/src/calculation/grid/CalcGridBackend.d.ts +450 -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 +236 -0
- package/types/src/calculation/grid/ICalcGrid.d.ts +456 -143
- package/types/src/calculation/grid/_CalcRequest.d.ts +272 -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 +36 -2
- 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 +78 -23
- package/types/src/cell/ICellProtection.d.ts +50 -10
- package/types/src/cellRange/ICellRange.d.ts +329 -72
- package/types/src/cellRange/ICellRanges.d.ts +9 -7
- package/types/src/chart/Chart.d.ts +72 -2
- package/types/src/chart/ChartCollection.d.ts +26 -0
- package/types/src/chart/IChart.d.ts +162 -9
- 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/comment/Comment.d.ts +159 -0
- package/types/src/comment/CommentCollection.d.ts +40 -0
- package/types/src/comment/IComment.d.ts +319 -48
- package/types/src/comment/ICommentCollection.d.ts +90 -0
- package/types/src/comment/_CommentUtils.d.ts +28 -0
- package/types/src/comment/index.d.ts +1 -0
- package/types/src/condition/AnchoredConditional.d.ts +76 -17
- package/types/src/condition/BuiltInOperators/AbstractOperator.d.ts +8 -7
- package/types/src/condition/BuiltInOperators/EqualToOperator.d.ts +2 -1
- package/types/src/condition/BuiltInOperators/ExpressionOperator.d.ts +3 -6
- package/types/src/condition/BuiltInOperators/InSetOperator.d.ts +1 -1
- package/types/src/condition/BuiltinSelectors/BaseSelector.d.ts +7 -0
- package/types/src/condition/BuiltinSelectors/ListSelector.d.ts +9 -0
- package/types/src/condition/Condition.d.ts +16 -0
- package/types/src/condition/ICondition.d.ts +86 -33
- package/types/src/condition/_ConditionFormula.d.ts +152 -0
- package/types/src/condition/_ConditionUtils.d.ts +73 -10
- package/types/src/conditionalFormat/ConditionalFormat.d.ts +21 -10
- package/types/src/conditionalFormat/ConditionalFormatCollection.d.ts +19 -8
- package/types/src/conditionalFormat/IConditionalFormat.d.ts +5 -3
- package/types/src/conditionalFormat/IConditionalFormatCollection.d.ts +2 -0
- package/types/src/dataValidation/DataValidation.d.ts +50 -3
- package/types/src/dataValidation/DataValidationCollection.d.ts +20 -9
- package/types/src/dataValidation/IDataValidation.d.ts +119 -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/fill/IStroke.d.ts +1 -1
- package/types/src/filter/IFilter.d.ts +29 -4
- package/types/src/font/IFont.d.ts +17 -0
- package/types/src/history/IHistory.d.ts +3 -2
- package/types/src/i18n/LanguagePack.d.ts +12 -4
- package/types/src/index.d.ts +3 -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/lib/file/file.browser.d.ts +19 -5
- package/types/src/lib/file/file.node.d.ts +5 -0
- package/types/src/lib/utils/_Utils.d.ts +11 -0
- package/types/src/lib/utils/utils.browser.d.ts +9 -3
- package/types/src/license/license-key.d.ts +27 -0
- 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/Control.d.ts +57 -0
- package/types/src/movable/IControl.d.ts +84 -0
- package/types/src/movable/IMovable.d.ts +23 -1
- package/types/src/movable/IMovableCollection.d.ts +2 -0
- package/types/src/movable/Movable.d.ts +4 -6
- package/types/src/movable/MovableCollection.d.ts +7 -7
- package/types/src/movable/index.d.ts +4 -0
- 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 +15 -7
- package/types/src/numFmt/IFormatEngine.d.ts +2 -0
- package/types/src/numFmt/NumfmtFormatEngine.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 +3 -0
- package/types/src/picture/IPicture.d.ts +2 -0
- package/types/src/picture/Picture.d.ts +2 -0
- package/types/src/pivot/IPivotTable.d.ts +107 -0
- package/types/src/pivot/IPivotTableCollection.d.ts +25 -0
- package/types/src/pivot/PivotTable.d.ts +57 -0
- package/types/src/pivot/PivotTableCollection.d.ts +25 -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/LambdaBrand.d.ts +21 -0
- package/types/src/primitives/PrimitiveUtils.d.ts +56 -19
- package/types/src/primitives/Range.d.ts +102 -24
- package/types/src/primitives/RangeStats.d.ts +24 -1
- package/types/src/primitives/ReferenceRange.d.ts +42 -0
- package/types/src/primitives/Runtime.d.ts +15 -2
- package/types/src/primitives/stats/FrequencyStats.d.ts +9 -0
- package/types/src/primitives/stats/LookupIndex.d.ts +46 -0
- package/types/src/primitives/stats/SortedNumbers.d.ts +2 -0
- 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 +41 -11
- package/types/src/scripting/IFunctionCollection.d.ts +41 -0
- 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 +18 -0
- 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 +2 -0
- package/types/src/scripting/TypedFunction.d.ts +151 -18
- package/types/src/scripting/_FunctionIndex.d.ts +5 -0
- 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/IRangeSelection.d.ts +9 -4
- package/types/src/selection/RangeSelection.d.ts +2 -0
- package/types/src/shape/IShape.d.ts +41 -3
- package/types/src/shape/Shape.d.ts +10 -0
- package/types/src/shape/_ShapeXml.d.ts +28 -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 +224 -41
- package/types/src/sheet/ISheetCollection.d.ts +2 -5
- package/types/src/sheet/NamedCellRange.d.ts +16 -7
- package/types/src/sheet/Sheet.d.ts +749 -114
- package/types/src/sheet/SheetCell.d.ts +81 -21
- package/types/src/sheet/SheetCollection.d.ts +19 -8
- package/types/src/sheet/SheetRange.d.ts +62 -14
- package/types/src/sheet/SheetRanges.d.ts +4 -6
- package/types/src/sheet/_CellBuffer.d.ts +214 -0
- package/types/src/sheet/_InvalidSheetRange.d.ts +5 -5
- 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 +32 -1
- package/types/src/sheet/_SheetIntents.d.ts +250 -0
- package/types/src/sheet/_SheetMutations.d.ts +179 -59
- package/types/src/sheet/_SheetStateReader.d.ts +16 -10
- package/types/src/sheet/_SheetStateTypes.d.ts +57 -73
- package/types/src/sheet/_SheetUtils.d.ts +2 -18
- 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 +91 -64
- package/types/src/sheet/style/SheetDirectStyle.d.ts +16 -5
- package/types/src/sheet/style/_Resolvers.d.ts +5 -3
- package/types/src/sheet/style/_StyleUtils.d.ts +37 -7
- package/types/src/sheetHeader/ISheetHeader.d.ts +2 -0
- package/types/src/sheetHeader/SheetHeader.d.ts +14 -0
- 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 +45 -1
- package/types/src/sheetView/SheetView.d.ts +11 -0
- package/types/src/slicer/ISlicer.d.ts +2 -0
- package/types/src/slicer/Slicer.d.ts +2 -0
- package/types/src/sort/ISort.d.ts +2 -0
- package/types/src/string/IStringCollection.d.ts +5 -0
- package/types/src/string/StringCollection.d.ts +6 -6
- package/types/src/style/INamedStyleCollection.d.ts +72 -0
- package/types/src/style/IStyle.d.ts +30 -10
- package/types/src/style/IStyleCollection.d.ts +63 -42
- package/types/src/style/ITableStyleCollection.d.ts +89 -0
- package/types/src/style/NamedStyleCollection.d.ts +39 -0
- package/types/src/style/StyleCollection.d.ts +41 -5
- package/types/src/style/TableStyleCollection.d.ts +49 -0
- package/types/src/style/_BuiltInStyleDefs.d.ts +3 -3
- package/types/src/style/index.d.ts +4 -0
- package/types/src/table/AnchoredTable.d.ts +644 -68
- package/types/src/table/AutoTable.d.ts +5 -5
- package/types/src/table/ITable.d.ts +228 -30
- package/types/src/table/ITableCollection.d.ts +2 -0
- package/types/src/table/TableCollection.d.ts +19 -8
- package/types/src/table/_FilterField.d.ts +7 -5
- 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/ITextFrame.d.ts +25 -1
- package/types/src/text/TextBoxAlignment.d.ts +15 -6
- 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/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/theme/ITheme.d.ts +2 -0
- package/types/src/theme/IThemeCollection.d.ts +2 -0
- package/types/src/theme/ThemeCollection.d.ts +8 -7
- package/types/src/transaction/ITransaction.d.ts +238 -36
- package/types/src/transaction/Transaction.d.ts +99 -11
- 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/workbook/IWorkbook.d.ts +171 -40
- package/types/src/workbook/Workbook.d.ts +103 -7
- 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/BatsV2UUraVDCRXm.cjs +0 -57
- package/browser/cjs/CUz53T65cRGQRgvv.cjs +0 -33
- package/browser/cjs/DU0kYUtdFa3jK-im.cjs +0 -1
- package/browser/cjs/Dv4yIPLV98M5zLHa.cjs +0 -1
- 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/dataValidation/_Utils.d.ts +0 -10
- 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
|
@@ -0,0 +1,450 @@
|
|
|
1
|
+
import { IRange, FormulaError, Scalar, IFormulaContext } from '@sheetxl/primitives';
|
|
2
|
+
import { Tuple, ISpatialQuery, ISparseGrid, ISpatialMap, ISpatialMap3D } from '../../collections';
|
|
3
|
+
import { IContextContainer, CalcNode } from '../state';
|
|
4
|
+
import { SpillEntry, FormulaSpatialValue, ContentfulSpatialValue, PrecedentSpatialValue, CircularEntry } from '../spatial';
|
|
5
|
+
import { IFormulaBlock, FormulaRecord } from '../formula';
|
|
6
|
+
import { ReferenceCoords, NamedReference } from '../Types';
|
|
7
|
+
import { ICalculation } from '../ICalculation';
|
|
8
|
+
import { ICalcGrid } from './ICalcGrid';
|
|
9
|
+
import { GridRequest, CalcResponse } from './_CalcRequest';
|
|
10
|
+
import { CalcGridProxy } from './CalcGridProxy';
|
|
11
|
+
/**
|
|
12
|
+
* ICalcGrid implementation
|
|
13
|
+
*/
|
|
14
|
+
export declare class CalcGridBackend extends CalcGridProxy implements ICalcGrid.Backend {
|
|
15
|
+
/**
|
|
16
|
+
* This is MOSTLY set by the user but spills also contribute.
|
|
17
|
+
* * Trying to keep lookups to a bare minimum.
|
|
18
|
+
*/
|
|
19
|
+
_values: ISparseGrid<Scalar>;
|
|
20
|
+
_spillSpatial: ISpatialMap<SpillEntry>;
|
|
21
|
+
_errorSpatial: ISpatialMap<string>;
|
|
22
|
+
_pendingSpatial: ISpatialMap<boolean>;
|
|
23
|
+
_circularSpatial: ISpatialMap<CircularEntry>;
|
|
24
|
+
_contentfulSpatial: ISpatialMap<ContentfulSpatialValue>;
|
|
25
|
+
_notifyValues: ISpatialMap;
|
|
26
|
+
/** Accumulated bounds of the regions answered blank on a block; `null` until the first. */
|
|
27
|
+
_notifyBlank: IRange.Coords | null;
|
|
28
|
+
_notifySpillsInsert: ISpatialMap.Entry<SpillEntry>[];
|
|
29
|
+
_notifySpillsRemove: IRange.Coords[];
|
|
30
|
+
_notifyFormats: ISpatialMap;
|
|
31
|
+
_notifyPending: ISpatialMap<boolean>;
|
|
32
|
+
_notifyCircular: ISpatialMap<CircularEntry | false>;
|
|
33
|
+
/**
|
|
34
|
+
* Regions of this grid whose formula blocks were minted, re-imaged or removed since the last
|
|
35
|
+
* vend: the formula half of {@link ICalcGrid.Results}. Every site that rewrites a block appends
|
|
36
|
+
* here - on THIS grid, or on another grid's when a shift or a delete rewrote a cross-sheet
|
|
37
|
+
* reference there - and each mutator drains what it finds into its resolution, a calculation
|
|
38
|
+
* pass drains the rest into `onCalculated`. What is vended is the map's current blocks over these
|
|
39
|
+
* regions, so a region touched several times in one batch reports its final state once.
|
|
40
|
+
*/
|
|
41
|
+
_touchedFormulas: IRange.Coords[];
|
|
42
|
+
/** Other grids a request applied here rewrote formulas in: told as the request lands. See {@link _apply}. */
|
|
43
|
+
protected _touchedOthers: Set<CalcGridBackend> | null;
|
|
44
|
+
_iterationId: number;
|
|
45
|
+
_options: CalcGridBackend.ConstructorOptions;
|
|
46
|
+
_getEntireCoords: () => IRange.Coords;
|
|
47
|
+
/** The size a `resize` gave, in place of {@link _getEntireCoords}; versioned with the maps. */
|
|
48
|
+
protected _resized: IRange.Coords | null;
|
|
49
|
+
/**
|
|
50
|
+
* @see CalcGridBackend.ConstructorOptions.unanchored
|
|
51
|
+
*/
|
|
52
|
+
readonly _unanchored: boolean;
|
|
53
|
+
/** @see CalcGridBackend.ConstructorOptions.shadowOf */
|
|
54
|
+
readonly _shadowOf: string | null;
|
|
55
|
+
/** @see CalcGridBackend.ConstructorOptions.arrayFirstCell */
|
|
56
|
+
readonly _arrayFirstCell: boolean;
|
|
57
|
+
_container: IContextContainer;
|
|
58
|
+
_context: IFormulaContext;
|
|
59
|
+
protected _isProcessingJSON: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Captures taken for {@link getSnapshot} by id: what a `copyTo` request reads. A capture is
|
|
62
|
+
* taken in channel order (a request of its own while the engine is `Starting`), so a cut's clear
|
|
63
|
+
* sent after the snapshot never reaches it first. Bounded: a clipboard holds one snapshot at a
|
|
64
|
+
* time, so the oldest are dropped past a few.
|
|
65
|
+
*/
|
|
66
|
+
protected _snapshots: Map<string, CalcGridSnapshot> | null;
|
|
67
|
+
/**
|
|
68
|
+
* The owner's callback for a record the engine pushed - a pass's results, a seed's. The one
|
|
69
|
+
* place the response half of the boundary is crossed on the way out (plan step 6); every site
|
|
70
|
+
* that pushes calls this rather than `_options.onCalculated`.
|
|
71
|
+
*/
|
|
72
|
+
protected _onCalculated: (response: CalcResponse) => void;
|
|
73
|
+
constructor(options?: CalcGridBackend.ConstructorOptions);
|
|
74
|
+
/**
|
|
75
|
+
* Runs a request against this grid under the engine commit it lands in: the per-grid maps are
|
|
76
|
+
* copied on write under that key first, so the snapshot before the request keeps what it had.
|
|
77
|
+
*/
|
|
78
|
+
protected _land<R>(landingId: string | undefined, action: () => R): R;
|
|
79
|
+
/** Copy the per-grid maps on write under `key` (the same key hands back the same copies). */
|
|
80
|
+
protected _versionMaps(key: string): void;
|
|
81
|
+
/** Record the maps this grid holds now in the engine's history. */
|
|
82
|
+
protected _publishMaps(): void;
|
|
83
|
+
/** @internal A restore of the engine's history: hold what the snapshot holds for this grid. */
|
|
84
|
+
_adoptMaps(maps: CalcGridMaps): void;
|
|
85
|
+
/**
|
|
86
|
+
* Record that the formula blocks over these entries changed. An entry scoped to another grid is
|
|
87
|
+
* recorded on THAT grid: a shift or a delete here rewrites references in formulas over there,
|
|
88
|
+
* and that grid's sheet learns of it through its own results.
|
|
89
|
+
*/
|
|
90
|
+
protected _touchFormulas(entries: readonly IRange.Coords[] | null | undefined): void;
|
|
91
|
+
/**
|
|
92
|
+
* The formula blocks over this grid's touched regions, as the read views the sheet holds, and
|
|
93
|
+
* the regions themselves as removes. Drains the touched list.
|
|
94
|
+
*/
|
|
95
|
+
protected _takeFormulaResults(results: CalcResponse, all?: boolean): CalcResponse;
|
|
96
|
+
/** The vend shape of engine entries: scope-free coords and the block as data. */
|
|
97
|
+
protected _formulaRecords(entries: readonly ISpatialMap.Entry<FormulaSpatialValue>[]): ISpatialMap.Entry<FormulaRecord>[];
|
|
98
|
+
/**
|
|
99
|
+
* A mutator's resolution: what it minted and removed, over the regions it touched, answering
|
|
100
|
+
* for the snapshot the request named.
|
|
101
|
+
*/
|
|
102
|
+
protected _mutationResults(commitId: string | undefined): CalcResponse;
|
|
103
|
+
/**
|
|
104
|
+
* @internal
|
|
105
|
+
* Applies a request to this grid, landing under `landingId`: what the channel calls, at once or
|
|
106
|
+
* once the engine is up.
|
|
107
|
+
*
|
|
108
|
+
* @param held `true` for a request the channel held: the savepoint it was made under has
|
|
109
|
+
* closed since, so its key would let the write update maps committed after it.
|
|
110
|
+
*/
|
|
111
|
+
_apply(request: GridRequest, landingId: string | undefined, held?: boolean): CalcResponse | Promise<CalcResponse>;
|
|
112
|
+
/** A grid holding one body - a watch's, a name's, a held expression's - rather than a sheet's cells. @internal */
|
|
113
|
+
_holdsBody(): boolean;
|
|
114
|
+
/** This grid's touched formulas, pushed to its owner now: see {@link _apply}. @internal */
|
|
115
|
+
_pushTouched(commitId: string | undefined): void;
|
|
116
|
+
protected _applyNow(request: GridRequest, landingId: string | undefined, held: boolean): CalcResponse | Promise<CalcResponse>;
|
|
117
|
+
/** Takes a capture of this grid as it is now and files it under `snapshotId` for a later copy. */
|
|
118
|
+
protected _captureSnapshot(snapshotId: string): void;
|
|
119
|
+
/** @inheritdoc ICalcGrid.beginUpdates */
|
|
120
|
+
beginUpdates(): ICalcGrid.IncrementalUpdates;
|
|
121
|
+
/** {@inheritDoc ICalcGrid.IncrementalUpdates.notifyBlank} */
|
|
122
|
+
protected _addNotifyBlank(coords: IRange.Coords): void;
|
|
123
|
+
/** The engine's own ask for a pass from this grid. @internal */
|
|
124
|
+
_calculateNow(full?: boolean): Promise<ICalculation.Status>;
|
|
125
|
+
protected _shiftNow(options: ICalcGrid.ShiftOptions): CalcResponse;
|
|
126
|
+
/** The synchronous form of {@link remove}, for the engine's own use on a `Running` engine. */
|
|
127
|
+
protected _removeNow(range: IRange.Coords): IRange.Coords[];
|
|
128
|
+
protected _autoFillNow(template: IRange.Coords, destination: IRange.Coords, commitId: string | undefined): CalcResponse;
|
|
129
|
+
/**
|
|
130
|
+
* @internal
|
|
131
|
+
* Rewrites every formula citing a 3-D span whose endpoint the tab-order change from `before` to
|
|
132
|
+
* `after` removed, or `movedId` carried across the other endpoint, so the endpoint is its inward
|
|
133
|
+
* neighbor (PLAN-3D-REFS §1.3). The maps are published through the container, so the rewrite
|
|
134
|
+
* lands in whatever commit the sheet operation holds open and an undo restores it.
|
|
135
|
+
*/
|
|
136
|
+
_replaceSheetSpans(before: readonly string[], after: readonly string[], movedId?: string): void;
|
|
137
|
+
protected _deleteNow(): void;
|
|
138
|
+
/**
|
|
139
|
+
* Takes the grid out of the graph and leaves every formula that read it exactly as written.
|
|
140
|
+
*
|
|
141
|
+
* @remarks
|
|
142
|
+
* The other half of {@link delete}: that one is the sheet-deletion contract and rewrites each
|
|
143
|
+
* dependent's reference to `#REF!`, which is right when the cells are gone for good. An external
|
|
144
|
+
* book's sheet is not — its removal keeps the citation on the slot's id so that an undo heals it
|
|
145
|
+
* — so here the precedent entries under this grid are dropped (a plan built through them would
|
|
146
|
+
* reach a grid that no longer exists) and the formulas that held them are dirtied by their own
|
|
147
|
+
* region, which is the only handle left once the entries are gone. Re-evaluated, each finds no
|
|
148
|
+
* grid to bind its scope to and computes `#REF!` on its own.
|
|
149
|
+
* @internal
|
|
150
|
+
*/
|
|
151
|
+
_detach(): void;
|
|
152
|
+
/** The engine's own dirty marking over this grid's cells. @internal */
|
|
153
|
+
_markDirtyRegionsNow(coords: readonly IRange.Coords[]): void;
|
|
154
|
+
/** @inheritdoc ICalcGrid.getId */
|
|
155
|
+
getShadowOf(): string | null;
|
|
156
|
+
/** @inheritdoc ICalcGrid.isArrayFirstCell */
|
|
157
|
+
isArrayFirstCell(): boolean;
|
|
158
|
+
/** {@inheritDoc ICalcGrid.getEntireCoords} */
|
|
159
|
+
getEntireCoords(): IRange.Coords;
|
|
160
|
+
/**
|
|
161
|
+
* `true` when any cell within `coords` holds an error value.
|
|
162
|
+
*
|
|
163
|
+
* @remarks
|
|
164
|
+
* Answered from the error index the grid maintains at every write - inputs and calc commits
|
|
165
|
+
* alike (`applyContentful`) - so it never scans. It describes the COMMITTED values, exactly
|
|
166
|
+
* what {@link getValues} holds. Engine-side: not on {@link ICalcGrid}.
|
|
167
|
+
*/
|
|
168
|
+
hasErrorIn(coords: IRange.Coords): boolean;
|
|
169
|
+
/** The bounding range of the content, values and formulas, or `null` when the grid has none. Engine-side. */
|
|
170
|
+
getBoundingRange(): IRange.Coords | null;
|
|
171
|
+
/** @inheritdoc ICalcGrid.getValues */
|
|
172
|
+
getValues(): ISparseGrid<Scalar>;
|
|
173
|
+
/** The regions marked dirty since the last pass. Engine-side. */
|
|
174
|
+
getDirtyRegions(): ISpatialQuery;
|
|
175
|
+
/**
|
|
176
|
+
* A queryable spatial index of the compiled blocks on this grid: the engine's live map.
|
|
177
|
+
*
|
|
178
|
+
* @remarks
|
|
179
|
+
* Engine-side, not on {@link ICalcGrid}: the model holds its own entries and reads the blocks
|
|
180
|
+
* the engine vends on {@link ICalcGrid.Results.formulaInserts}.
|
|
181
|
+
*/
|
|
182
|
+
getFormulas(): ISpatialQuery<IFormulaBlock>;
|
|
183
|
+
/**
|
|
184
|
+
* A queryable spatial index of the ARRAY EXTENTS on this grid: one entry per array formula,
|
|
185
|
+
* keyed by the cells it occupies (a dynamic array's spill, a legacy CSE block, or the single
|
|
186
|
+
* cell a blocked spill collapses to).
|
|
187
|
+
*
|
|
188
|
+
* @remarks
|
|
189
|
+
* The same index a pass writes through {@link ICalcGrid.IncrementalUpdates.spillSpatial}
|
|
190
|
+
* (`beginUpdates` hands out this very map), so a read answers identically inside and outside a
|
|
191
|
+
* pass, which is what lets a formula evaluated OUTSIDE one resolve a spill anchor. Engine-side.
|
|
192
|
+
*/
|
|
193
|
+
getSpills(): ISpatialQuery<SpillEntry>;
|
|
194
|
+
protected _revertNow(options: ICalcGrid.RevertOptions): CalcResponse;
|
|
195
|
+
/**
|
|
196
|
+
* The direct dependents of a range: one hop downstream. A range a formula resolved at run
|
|
197
|
+
* time (`INDIRECT`, `OFFSET`) is reported like any other, with the caveat under
|
|
198
|
+
* {@link getDirectPrecedentsAt}. Engine primitive; {@link ICalcGrid.getGraphNeighborsAt} is
|
|
199
|
+
* the model's question.
|
|
200
|
+
*/
|
|
201
|
+
getDirectDependentsAt(coords: IRange.Coords): IRange.Coords[];
|
|
202
|
+
/**
|
|
203
|
+
* The direct precedents of a range: one hop upstream, as of the last calculation.
|
|
204
|
+
*
|
|
205
|
+
* @remarks
|
|
206
|
+
* A range a formula resolved at run time (`INDIRECT`, `OFFSET`) is reported like any other,
|
|
207
|
+
* but it is not the same KIND of fact: a written reference is a property of the text, true
|
|
208
|
+
* before anything calculates; a resolved one is a record of the last pass, moves when the
|
|
209
|
+
* formula's inputs move, and is absent for a block not yet calculated. The bounds are the
|
|
210
|
+
* union of everything the block read, wider than the cells touched for a scattered read:
|
|
211
|
+
* over-reporting costs a caller a clean check, under-reporting hands it an incomplete answer
|
|
212
|
+
* that looks complete. Engine primitive; {@link ICalcGrid.getGraphNeighborsAt} is the
|
|
213
|
+
* model's question.
|
|
214
|
+
*/
|
|
215
|
+
getDirectPrecedentsAt(coords: IRange.Coords): IRange.Coords[];
|
|
216
|
+
/**
|
|
217
|
+
* One hop of a transitive walk, taken on whichever GRID the coord names.
|
|
218
|
+
*
|
|
219
|
+
* @remarks
|
|
220
|
+
* `getDirect*At` are grid-local by construction — they search their own grid and answer with
|
|
221
|
+
* `scope` set only where a neighbor is elsewhere. A walk therefore cannot keep asking `this`:
|
|
222
|
+
* once it steps onto `Sheet2!C3` the next hop belongs to Sheet2, and asking Sheet1 for `C3`
|
|
223
|
+
* reads a different cell entirely. Results come back bare-relative to the grid that produced
|
|
224
|
+
* them, so they are re-expressed against the walk's own anchor before being handed back.
|
|
225
|
+
* @internal
|
|
226
|
+
*/
|
|
227
|
+
private _directAcrossGrids;
|
|
228
|
+
/** Every range downstream of `coords`, recursively: the total impact of a change there. Engine primitive. */
|
|
229
|
+
getDependentsAt(coords: IRange.Coords): IRange.Coords[];
|
|
230
|
+
/** Every range upstream of `coords`, recursively: all of its root data sources. Engine primitive. */
|
|
231
|
+
getPrecedentsAt(coords: IRange.Coords): IRange.Coords[];
|
|
232
|
+
/** What a `graph` request answers for cells: see {@link ICalcGrid.getGraphNeighborsAt}. */
|
|
233
|
+
protected _graphNeighborsNow(coords: IRange.Coords, kind: 'precedents' | 'dependents', direct: boolean): ICalcGrid.GraphNeighbors;
|
|
234
|
+
/**
|
|
235
|
+
* The distinct stable nameIds of the named formulas mentioned by the formulas over `coords`.
|
|
236
|
+
*
|
|
237
|
+
* @remarks
|
|
238
|
+
* The NAME half of {@link getReferencesAt}: both report what the TEXT mentions, so
|
|
239
|
+
* neither walks the graph. It is nonetheless what answers the name half of PRECEDENTS: a name
|
|
240
|
+
* is applied at eval, so the cell graph carries no edge for it (`=Doubled` has NO cell
|
|
241
|
+
* precedents) and the written mention is the whole answer. Only the queried blocks are
|
|
242
|
+
* inspected; a name mentioned upstream is that cell's precedent. Engine primitive.
|
|
243
|
+
*/
|
|
244
|
+
getNamedReferencesAt(coords: IRange.Coords): string[];
|
|
245
|
+
/**
|
|
246
|
+
* What a `graph` request asking about this grid's defined name answers: the name's precedents
|
|
247
|
+
* or dependents, cells scoped by grid and names as nodes - ONE answer, as a cell's is.
|
|
248
|
+
*
|
|
249
|
+
* @remarks
|
|
250
|
+
* The PRECEDENTS: the cell half is the ordinary precedent graph - a body is a real formula here,
|
|
251
|
+
* and its references registered precedent ranges like any cell's. The name half is the body's
|
|
252
|
+
* `getNamedIds`: apply-at-eval means a name the body reads has no precedent edge, so the symbol
|
|
253
|
+
* list is the only carrier - one hop for `direct`, the downward closure (cycle-guarded) for the
|
|
254
|
+
* deep form, each member contributing its own grid's cell walk. The deep form does not take the
|
|
255
|
+
* symbol hop from UPSTREAM CELLS (`X = A1*2`, `A1 = SomeName`: `A1` is listed and `SomeName`'s
|
|
256
|
+
* inputs are not) - that hop is `A1`'s, one step of a tree walk.
|
|
257
|
+
*
|
|
258
|
+
* The DEPENDENTS: two graphs meet, and the walk changes vehicles between them. The symbol edge -
|
|
259
|
+
* which formulas mention this name - is not in the precedent spatial at all; it is the nameId
|
|
260
|
+
* list each compiled block carries (`container.getNamedDependents`). The cell edge is the
|
|
261
|
+
* precedent graph, which carries everything downstream of those blocks: `direct` is one hop of
|
|
262
|
+
* the first; the deep form takes it, then hands each landing block to its grid. A block on a
|
|
263
|
+
* grid that is no sheet is another NAME reading this one: a node, and the deep walk passes
|
|
264
|
+
* THROUGH it on the symbol closure (`getNamedDependentNames`), or `Base`'s dependents would stop
|
|
265
|
+
* at `Plus1`. This name is listed only when a true cycle leads back to it.
|
|
266
|
+
*/
|
|
267
|
+
protected _nameGraphNow(kind: 'precedents' | 'dependents', direct: boolean): ICalcGrid.GraphNeighbors;
|
|
268
|
+
/** The blank region of the body this grid holds, as data: see {@link ICalcGrid.Results.blankRegion}. */
|
|
269
|
+
protected _blankRegion(): ICalcGrid.BlankRegion | null;
|
|
270
|
+
/** The compiled block at a cell, or `null`. Engine-side: the model reads the vended view. */
|
|
271
|
+
getFormulaBlockAt(row: number, column: number): IFormulaBlock | null;
|
|
272
|
+
/** The written references of the formula at a cell, absolute (`IFormulaBlockView.getReferencesAt`). Engine primitive. */
|
|
273
|
+
getReferencesAt(row: number, column: number): ReferenceCoords[];
|
|
274
|
+
/** What an `evaluate` request answers: the formula at the cell, evaluated now; `null` where there is none. */
|
|
275
|
+
protected _evaluateNow(row: number, column: number, evalIndex?: number, coerce?: 'scalar'): Scalar | IRange | Promise<Scalar | IRange> | null;
|
|
276
|
+
/** What a `setReference` request does: the rewrite, and the write of the formula it makes. */
|
|
277
|
+
protected _setReferenceNow(row: number, column: number, index: number, precedent: IRange.FixableCoords | IRange.FixableCellCoords | NamedReference | FormulaError.Ref): CalcResponse;
|
|
278
|
+
/** What a `setReferenceMode` request does: refused for a reference that is not to cells. */
|
|
279
|
+
protected _setReferenceModeNow(row: number, column: number, index: number, side: ICalculation.ReferenceSide, mode?: number): CalcResponse;
|
|
280
|
+
/** What an `isVolatile` request answers. */
|
|
281
|
+
protected _isVolatileNow(row: number, column: number): boolean;
|
|
282
|
+
protected _formulaAt(row: number, column: number): ISpatialMap.Entry<FormulaSpatialValue> | null;
|
|
283
|
+
/**
|
|
284
|
+
* Create non error spill entries for move/copy.
|
|
285
|
+
*/
|
|
286
|
+
protected _createCopySpillEntries(spillSpatial: ISpatialMap<SpillEntry>, from: IRange.Coords, to: IRange.Coords, reuseInserts?: ISpatialMap.Entry<SpillEntry>[] | null, reuseRemoves?: ISpatialMap.Entry<SpillEntry>[] | null): ISpatialMap.Updates;
|
|
287
|
+
/**
|
|
288
|
+
* Because the formula we are copying from maybe have been compiled using
|
|
289
|
+
* a different calculation context we have to serialize back to the formula string.
|
|
290
|
+
*
|
|
291
|
+
* @param gridExplicitId The grid context to compile in AND the scope prefix added to unqualified refs.
|
|
292
|
+
* For formula-move: the source grid (refs get source-grid prefix). For precedent-move: the
|
|
293
|
+
* destination grid (refs get destination-grid prefix).
|
|
294
|
+
* @param targetScope If provided, the formula entry scope after re-anchoring. Defaults to this._gridId.
|
|
295
|
+
* Use from.scope when re-anchoring formulas that stay in the source sheet.
|
|
296
|
+
*
|
|
297
|
+
* @remarks
|
|
298
|
+
* This modifies the insert in place.
|
|
299
|
+
*/
|
|
300
|
+
protected _reanchorFormulas(inserts: ISpatialMap.Entry<FormulaSpatialValue>[], gridExplicitId?: string | null, targetScope?: string | null, force?: boolean): void;
|
|
301
|
+
/**
|
|
302
|
+
* Will copy tiles and invalidate relative precedents that are out
|
|
303
|
+
* of bounds.
|
|
304
|
+
*/
|
|
305
|
+
protected _copyTo(snapshot: CalcGridSnapshot, from: IRange.Coords, to: IRange.Coords): void;
|
|
306
|
+
/**
|
|
307
|
+
* Will update absolute precedents from precedentEntries relative precedents get shifted
|
|
308
|
+
*/
|
|
309
|
+
protected _moveTo(snapshot: CalcGridSnapshot, from: IRange.Coords, to: IRange.Coords): void;
|
|
310
|
+
protected _notifyCalculated(cycleId: number, options: ICalculation.CalculateOptions | boolean): Promise<CalcResponse>;
|
|
311
|
+
/**
|
|
312
|
+
* The write itself, on a `Running` engine. Records what it minted and removed for the vend rather
|
|
313
|
+
* than taking it, so the engine's own callers (a reference edit, `recompileNamed`) leave the
|
|
314
|
+
* vend for the pass that follows.
|
|
315
|
+
*/
|
|
316
|
+
_setInputsNow(values: Tuple.Region<Scalar> | null, formulas: readonly ISpatialMap.Entry<string>[] | null, deleteRange?: IRange.Coords, options?: ICalcGrid.SetInputsOptions): IRange.Coords[];
|
|
317
|
+
/**
|
|
318
|
+
* Joins each block just written with an equal block beside it, so a formula written under a run
|
|
319
|
+
* of it, or between two runs, extends the run rather than starting a block of its own.
|
|
320
|
+
*
|
|
321
|
+
* @param reevaluate Called with a joined block that has to be evaluated whole: see remarks.
|
|
322
|
+
* @returns The joined blocks, or `null` when none joined.
|
|
323
|
+
*
|
|
324
|
+
* @remarks
|
|
325
|
+
* Two blocks are the same formula when their relative forms match; only an array-entered
|
|
326
|
+
* (fixed) extent is never joined. The sheet joins its entries on the same rule when they are
|
|
327
|
+
* written, so the two agree without waiting for the vend.
|
|
328
|
+
*
|
|
329
|
+
* The joined block clones its sources' nodes, so the cells already there keep what they
|
|
330
|
+
* calculated; only the cells written are marked dirty, by the caller, from the blocks as written.
|
|
331
|
+
* Two things a source holds do not survive that: its dynamic precedents (kept per block, and
|
|
332
|
+
* replaced wholesale by whatever the block's evaluated cells read next) and a result still
|
|
333
|
+
* pending (the promise resolves onto the source's node). A join that drops either evicts the
|
|
334
|
+
* source's dynamic precedents and hands the joined block to `reevaluate`, so every cell of it
|
|
335
|
+
* reads again.
|
|
336
|
+
*/
|
|
337
|
+
protected _joinInserted(formulaSpatial: ISpatialMap3D<FormulaSpatialValue>, precedentSpatial: ISpatialMap3D<PrecedentSpatialValue>, inserts: readonly ISpatialMap.Entry<FormulaSpatialValue>[], reevaluate: (joined: IRange.Coords) => void): ISpatialMap.Entry<FormulaSpatialValue>[] | null;
|
|
338
|
+
/**
|
|
339
|
+
* Used before loading a new state
|
|
340
|
+
*/
|
|
341
|
+
protected _clearAll(): void;
|
|
342
|
+
/**
|
|
343
|
+
* Removes every formula this grid holds and what hangs off them: their precedents wherever those
|
|
344
|
+
* live (a cross-sheet precedent is indexed under the grid it reads), their dynamic precedents,
|
|
345
|
+
* and their volatile nodes.
|
|
346
|
+
*
|
|
347
|
+
* @remarks
|
|
348
|
+
* The other half of {@link _clearAll}, which owns only what is the grid's alone. Formulas and
|
|
349
|
+
* precedents belong to the container, so a load over a grid that already has content would
|
|
350
|
+
* otherwise register a second block on the same cells.
|
|
351
|
+
*/
|
|
352
|
+
protected _clearFormulas(): void;
|
|
353
|
+
/**
|
|
354
|
+
* @internal
|
|
355
|
+
* Opens the grid from `json` now, whatever the engine's status: the engine's own content (an
|
|
356
|
+
* external book's cached values) is loaded this way; a model's goes through {@link seed}.
|
|
357
|
+
*/
|
|
358
|
+
_seedNow(json: ICalcGrid.JSON, options?: ICalcGrid.SeedOptions): CalcResponse;
|
|
359
|
+
/** What a `toJSON` request answers: the grid's content as the engine holds it now. */
|
|
360
|
+
protected _toJSONNow(options?: ICalcGrid.ToJSONOptions): ICalcGrid.JSON | null;
|
|
361
|
+
}
|
|
362
|
+
export declare namespace CalcGridBackend {
|
|
363
|
+
/**
|
|
364
|
+
* Options available when creating a CalcGridBackend.
|
|
365
|
+
*/
|
|
366
|
+
interface ConstructorOptions {
|
|
367
|
+
/**
|
|
368
|
+
* The calculation instance that will be used to calculate the grid.
|
|
369
|
+
*
|
|
370
|
+
* @remarks
|
|
371
|
+
* Required as this will contain the context
|
|
372
|
+
*/
|
|
373
|
+
context: IFormulaContext;
|
|
374
|
+
/**
|
|
375
|
+
* handler for calculation callbacks.
|
|
376
|
+
*
|
|
377
|
+
* @remarks
|
|
378
|
+
* The container contains information shared across all grids
|
|
379
|
+
*/
|
|
380
|
+
container: IContextContainer;
|
|
381
|
+
/**
|
|
382
|
+
* For status listening
|
|
383
|
+
*/
|
|
384
|
+
calculation: ICalculation | null;
|
|
385
|
+
/**
|
|
386
|
+
* A callback that is called when the calculation is completed.
|
|
387
|
+
*
|
|
388
|
+
* @remarks
|
|
389
|
+
* This will persist through clones.
|
|
390
|
+
*/
|
|
391
|
+
onCalculated?: (results: ICalcGrid.Results) => void;
|
|
392
|
+
/**
|
|
393
|
+
* A unique id that never changes for the grid.
|
|
394
|
+
*/
|
|
395
|
+
uuid?: string;
|
|
396
|
+
/**
|
|
397
|
+
* The sheet's name, for a grid that is a sheet: its entry in the engine's replica of the
|
|
398
|
+
* sheet list (DESIGN-CALC-SERVICE §8). `null` for a sheet that has no name yet, which a
|
|
399
|
+
* formula names by its id. Absent for a compilation host, which no formula can name.
|
|
400
|
+
*/
|
|
401
|
+
name?: string | null;
|
|
402
|
+
/**
|
|
403
|
+
* Returns the entire coordinate bounds for this grid.
|
|
404
|
+
* If not provided, defaults to the maximum sheet dimensions.
|
|
405
|
+
*/
|
|
406
|
+
getEntireCoords?: () => IRange.Coords;
|
|
407
|
+
/**
|
|
408
|
+
* `true` for a grid whose coordinates are a synthetic anchor rather than positions in a real
|
|
409
|
+
* sheet — a named formula's compilation host, or the editor's temporary formula.
|
|
410
|
+
*
|
|
411
|
+
* @remarks
|
|
412
|
+
* Stamped onto every {@link FormulaSpatialValue} this grid creates; see
|
|
413
|
+
* `FormulaSpatialValue.unanchored` for what it buys. Defaults to `false` (a sheet).
|
|
414
|
+
*/
|
|
415
|
+
unanchored?: boolean;
|
|
416
|
+
/**
|
|
417
|
+
* The sheet grid this grid is the coordinate space of. See {@link ICalcGrid.getShadowOf}.
|
|
418
|
+
*/
|
|
419
|
+
shadowOf?: string;
|
|
420
|
+
/**
|
|
421
|
+
* `true` when every cell of every block in this grid is its own 1x1 array-entered extent — a
|
|
422
|
+
* conditional-format body. See {@link ICalcGrid.isArrayFirstCell}.
|
|
423
|
+
*/
|
|
424
|
+
arrayFirstCell?: boolean;
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
/** A grid's per-grid maps, as one snapshot of the engine's history holds them. */
|
|
428
|
+
export interface CalcGridMaps {
|
|
429
|
+
values: ISparseGrid<Scalar>;
|
|
430
|
+
contentful: ISpatialMap<ContentfulSpatialValue>;
|
|
431
|
+
spills: ISpatialMap<SpillEntry>;
|
|
432
|
+
errors: ISpatialMap<string>;
|
|
433
|
+
pending: ISpatialMap<boolean>;
|
|
434
|
+
circular: ISpatialMap<CircularEntry>;
|
|
435
|
+
/** The size a `resize` gave, or `null` for the one the grid was made with. */
|
|
436
|
+
entireCoords?: IRange.Coords | null;
|
|
437
|
+
}
|
|
438
|
+
interface CalcGridSnapshot {
|
|
439
|
+
calcGrid: CalcGridBackend;
|
|
440
|
+
/** The source's values as marked; a cut clears the live ones before the move reads. */
|
|
441
|
+
values: ISparseGrid<Scalar>;
|
|
442
|
+
/** The source's spills as marked. */
|
|
443
|
+
spillSpatial: ISpatialMap<SpillEntry>;
|
|
444
|
+
formulaSpatial: ISpatialMap3D<FormulaSpatialValue>;
|
|
445
|
+
precedentSpatial: ISpatialMap3D<PrecedentSpatialValue>;
|
|
446
|
+
volatile: Set<CalcNode> | null;
|
|
447
|
+
}
|
|
448
|
+
export declare function valueCompareValues<T>(a: ISpatialMap.Entry<T>, removing: ISpatialMap.Entry<T>): boolean;
|
|
449
|
+
export {};
|
|
450
|
+
//# sourceMappingURL=CalcGridBackend.d.ts.map
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { IRange, FormulaError, Scalar } from '@sheetxl/primitives';
|
|
2
|
+
import { IListener } from '../../listener';
|
|
3
|
+
import { ListenerEmitter } from '../../listener/ListenerEmitter';
|
|
4
|
+
import { ISpatialMap, Tuple } from '../../collections';
|
|
5
|
+
import { IFormulaBlockView } from '../formula';
|
|
6
|
+
import { NamedReference } from '../Types';
|
|
7
|
+
import { ICalculation } from '../ICalculation';
|
|
8
|
+
import { ICalcGrid } from './ICalcGrid';
|
|
9
|
+
import { CalcRequest } from './_CalcRequest';
|
|
10
|
+
/**
|
|
11
|
+
* A grid's verbs as requests (DESIGN-CALC-SERVICE §4, §13.23): each one a message through the
|
|
12
|
+
* service's channel, addressed by the grid's id. What the model's grid forwards to - it never
|
|
13
|
+
* holds the engine's grid, which an `Off` engine does not have.
|
|
14
|
+
*
|
|
15
|
+
* @remarks
|
|
16
|
+
* The engine's own grid answers the same verbs through the same channel, so its engine-side
|
|
17
|
+
* tests can drive it directly; it adds what only the engine holds.
|
|
18
|
+
*/
|
|
19
|
+
export declare class CalcGridProxy implements ICalcGrid.Backend {
|
|
20
|
+
protected readonly _gridId: string;
|
|
21
|
+
protected readonly _sendRequest: CalcGridProxy.ConstructorOptions['send'];
|
|
22
|
+
_calculation: ICalculation | null;
|
|
23
|
+
protected readonly _getEntireCoordsOf: (() => IRange.Coords) | null;
|
|
24
|
+
protected _emitter: ListenerEmitter<ICalcGrid, ICalcGrid.IListeners> | null;
|
|
25
|
+
constructor(options: CalcGridProxy.ConstructorOptions);
|
|
26
|
+
/**
|
|
27
|
+
* The engine commit a request lands in: the nested savepoint it was made under, or the
|
|
28
|
+
* root's own commit (`<id>:0`, so the model's commit id itself is free for the mirror the
|
|
29
|
+
* engine lands at the root's close). `undefined` for a request naming no snapshot.
|
|
30
|
+
*/
|
|
31
|
+
protected _landingId(options: ICalcGrid.RequestOptions | undefined): string | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* Sends a request through the service's channel (DESIGN-CALC-SERVICE §4): applied now on a
|
|
34
|
+
* `Running` engine, held in order while it is `Starting`, not recorded on an `Off` one.
|
|
35
|
+
*/
|
|
36
|
+
protected _send(landingId: string | undefined, request: CalcRequest): Promise<ICalcGrid.Results>;
|
|
37
|
+
/** @inheritdoc ICalcGrid.getId */
|
|
38
|
+
getId(): string;
|
|
39
|
+
/** {@inheritDoc ICalcGrid.getEntireCoords} */
|
|
40
|
+
getEntireCoords(): IRange.Coords;
|
|
41
|
+
/** {@inheritDoc ICalcGrid.resize} */
|
|
42
|
+
resize(options?: ICalcGrid.RequestOptions): void;
|
|
43
|
+
/** {@inheritDoc ICalcGrid.addListeners} */
|
|
44
|
+
addListeners(listeners: ICalcGrid.IListeners, options?: IListener.Options): IListener.Remove;
|
|
45
|
+
/** @inheritdoc ICalcGrid.setInputs */
|
|
46
|
+
setInputs(values: Tuple.Region<Scalar> | null, formulas: readonly ISpatialMap.Entry<string>[] | null, options?: ICalcGrid.SetInputsOptions): Promise<ICalcGrid.Results>;
|
|
47
|
+
/** {@inheritDoc ICalcGrid.remove} */
|
|
48
|
+
remove(range: IRange.Coords, options?: ICalcGrid.RequestOptions): Promise<ICalcGrid.Results>;
|
|
49
|
+
/**
|
|
50
|
+
* The write, held when the engine is not `Running` - a `Starting` engine still draining its
|
|
51
|
+
* load, a cold one whose start nobody has asked for yet - and applied at once otherwise. Either
|
|
52
|
+
* way it resolves with what it minted; the model holds the text meanwhile.
|
|
53
|
+
*/
|
|
54
|
+
protected _setInputs(values: Tuple.Region<Scalar> | null, formulas: readonly ISpatialMap.Entry<string>[] | null, deleteRange?: IRange.Coords, options?: ICalcGrid.SetInputsOptions): Promise<ICalcGrid.Results>;
|
|
55
|
+
/** @inheritdoc ICalcGrid.shift */
|
|
56
|
+
shift(options: ICalcGrid.ShiftOptions): Promise<ICalcGrid.Results>;
|
|
57
|
+
/** {@inheritDoc ICalcGrid.autoFill} */
|
|
58
|
+
autoFill(template: IRange.Coords | string, destination: IRange.Coords | string, options?: ICalcGrid.RequestOptions): Promise<ICalcGrid.Results>;
|
|
59
|
+
/**
|
|
60
|
+
* {@inheritDoc ICalcGrid.calculate}
|
|
61
|
+
*
|
|
62
|
+
* @remarks
|
|
63
|
+
* A request through the channel, answered once the pass it asks for has been started.
|
|
64
|
+
*/
|
|
65
|
+
calculate(full?: boolean): Promise<ICalculation.Status>;
|
|
66
|
+
/** {@inheritDoc ICalcGrid.Backend.requestPass} */
|
|
67
|
+
requestPass(): void;
|
|
68
|
+
/** {@inheritDoc ICalcGrid.markDirtyRegions} */
|
|
69
|
+
markDirtyRegions(coords: IRange.Coords[]): void;
|
|
70
|
+
/** {@inheritDoc ICalcGrid.delete} */
|
|
71
|
+
delete(options?: ICalcGrid.RequestOptions): void;
|
|
72
|
+
/** {@inheritDoc ICalcGrid.revert} */
|
|
73
|
+
revert(options: ICalcGrid.RevertOptions): Promise<ICalcGrid.Results>;
|
|
74
|
+
/** {@inheritDoc ICalcGrid.close} */
|
|
75
|
+
close(): void;
|
|
76
|
+
/** {@inheritDoc ICalcGrid.seed} */
|
|
77
|
+
seed(json: ICalcGrid.JSON, options?: ICalcGrid.SeedOptions): Promise<ICalcGrid.Results>;
|
|
78
|
+
/**
|
|
79
|
+
* {@inheritDoc ICalcGrid.toJSON}
|
|
80
|
+
*
|
|
81
|
+
* @remarks
|
|
82
|
+
* A request: answered in order behind every write sent before it, so a `Starting` engine answers
|
|
83
|
+
* once the writes held ahead of it have landed.
|
|
84
|
+
*/
|
|
85
|
+
toJSON(options?: ICalcGrid.ToJSONOptions): Promise<ICalcGrid.JSON | null>;
|
|
86
|
+
/** {@inheritDoc ICalcGrid.getSnapshot} */
|
|
87
|
+
getSnapshot(options?: ICalcGrid.GetSnapshotOptions): ICalcGrid.ISnapshot;
|
|
88
|
+
/**
|
|
89
|
+
* {@inheritDoc ICalcGrid.getGraphNeighborsAt}
|
|
90
|
+
*
|
|
91
|
+
* @remarks
|
|
92
|
+
* A question: an engine that holds no grid (`Off`) answers with nothing.
|
|
93
|
+
*/
|
|
94
|
+
getGraphNeighborsAt(coords: IRange.Coords, kind: 'precedents' | 'dependents', direct: boolean): Promise<ICalcGrid.GraphNeighbors>;
|
|
95
|
+
/** {@inheritDoc ICalcGrid.Backend.getNameGraph} */
|
|
96
|
+
getNameGraph(kind: 'precedents' | 'dependents', direct: boolean): Promise<ICalcGrid.GraphNeighbors>;
|
|
97
|
+
/**
|
|
98
|
+
* {@inheritDoc ICalcGrid.isVolatileAt}
|
|
99
|
+
*
|
|
100
|
+
* @remarks
|
|
101
|
+
* A question: an engine that holds no grid (`Off`) answers `false`.
|
|
102
|
+
*/
|
|
103
|
+
isVolatileAt(row: number, column: number): Promise<boolean>;
|
|
104
|
+
/** {@inheritDoc ICalcGrid.evaluateAt} */
|
|
105
|
+
evaluateAt(row: number, column: number, options?: number | ICalculation.EvaluateOptions): Promise<Scalar | IRange>;
|
|
106
|
+
/** {@inheritDoc ICalcGrid.Backend.evaluateScalarAt} */
|
|
107
|
+
evaluateScalarAt(row: number, column: number, evalIndex?: number): Promise<Scalar>;
|
|
108
|
+
/** {@inheritDoc ICalcGrid.Backend.setBody} */
|
|
109
|
+
setBody(options: ICalcGrid.BodyOptions): Promise<ICalcGrid.Results>;
|
|
110
|
+
/**
|
|
111
|
+
* {@inheritDoc ICalcGrid.setReferenceAt}
|
|
112
|
+
*
|
|
113
|
+
* @remarks
|
|
114
|
+
* A request through the channel: the edit is made against the compiled formula, in order with
|
|
115
|
+
* the writes before it, and a refusal rejects.
|
|
116
|
+
*/
|
|
117
|
+
setReferenceAt(row: number, column: number, index: number, precedent: IRange.FixableCoords | IRange.FixableCellCoords | NamedReference | FormulaError.Ref): Promise<IFormulaBlockView | null>;
|
|
118
|
+
/** {@inheritDoc ICalcGrid.setReferenceModeAt} */
|
|
119
|
+
setReferenceModeAt(row: number, column: number, index: number, side?: ICalculation.ReferenceSide, mode?: number): Promise<IFormulaBlockView | null>;
|
|
120
|
+
}
|
|
121
|
+
export declare namespace CalcGridProxy {
|
|
122
|
+
interface ConstructorOptions {
|
|
123
|
+
/** The grid's id: what every request is addressed to. */
|
|
124
|
+
id: string;
|
|
125
|
+
/** The service's channel (`Calculation._sendRequest`). */
|
|
126
|
+
send: (gridId: string, landingId: string | undefined, request: CalcRequest) => Promise<ICalcGrid.Results>;
|
|
127
|
+
/** For the engine's status, and `ready()` ahead of an evaluation. */
|
|
128
|
+
calculation?: ICalculation | null;
|
|
129
|
+
/** The grid's size, as the model knows it. */
|
|
130
|
+
getEntireCoords?: () => IRange.Coords;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
//# sourceMappingURL=CalcGridProxy.d.ts.map
|