@univerjs/engine-formula 1.4.0 → 1.5.1
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/README.md +23 -5
- package/lib/cjs/facade.js +2 -2
- package/lib/cjs/index.js +13 -4
- package/lib/cjs/{plugin-CDy-SbDF.js → plugin-DnS4q7WL.js} +2467 -1554
- package/lib/cjs/worker.js +1 -1
- package/lib/es/facade.js +2 -2
- package/lib/es/index.js +2 -2
- package/lib/es/{plugin-BO47k05w.js → plugin-C1e9dnai.js} +2546 -1627
- package/lib/es/worker.js +1 -1
- package/lib/facade.js +2 -2
- package/lib/index.js +2 -2
- package/lib/{plugin-BO47k05w.js → plugin-C1e9dnai.js} +2546 -1627
- package/lib/types/basics/complex.d.ts +10 -4
- package/lib/types/basics/date.d.ts +6 -1
- package/lib/types/basics/function.d.ts +2 -1
- package/lib/types/basics/inverted-index-cache.d.ts +2 -1
- package/lib/types/controllers/calculate.controller.d.ts +0 -2
- package/lib/types/engine/analysis/lexer-tree-builder.d.ts +1 -3
- package/lib/types/engine/analysis/lexer.d.ts +6 -2
- package/lib/types/engine/analysis/parser.d.ts +3 -1
- package/lib/types/engine/ast-node/reference-node.d.ts +1 -4
- package/lib/types/engine/ast-node/union-node.d.ts +1 -3
- package/lib/types/engine/reference-object/base-reference-object.d.ts +5 -3
- package/lib/types/engine/utils/generate-ast-node.d.ts +0 -2
- package/lib/types/engine/utils/three-dimensional-reference.d.ts +21 -0
- package/lib/types/engine/value-object/array-value-object.d.ts +4 -0
- package/lib/types/index.d.ts +3 -2
- package/lib/types/models/formula-data-snapshot.d.ts +24 -0
- package/lib/types/models/formula-data.model.d.ts +9 -1
- package/lib/types/services/calculate-formula.service.d.ts +11 -1
- package/lib/types/services/current-data.service.d.ts +12 -0
- package/lib/types/services/formula/formula-calculation-session.service.d.ts +2 -1
- package/lib/types/services/formula-cache.service.d.ts +47 -0
- package/lib/types/services/formula-result.service.d.ts +29 -0
- package/lib/types/services/function.service.d.ts +3 -0
- package/lib/types/services/runtime.service.d.ts +15 -3
- package/lib/umd/index.js +4 -4
- package/lib/worker.js +1 -1
- package/package.json +6 -6
|
@@ -18,8 +18,10 @@ import type { IArrayFormulaEmbeddedMap, IArrayFormulaRangeType, IFeatureDirtyRan
|
|
|
18
18
|
import type { BaseAstNode } from '../engine/ast-node/base-ast-node';
|
|
19
19
|
import type { IFormulaDependencyTreeJson } from '../engine/dependency/dependency-tree';
|
|
20
20
|
import type { FunctionVariantType } from '../engine/reference-object/base-reference-object';
|
|
21
|
+
import type { FormulaCalculationCache } from './formula-cache.service';
|
|
21
22
|
import { Disposable, IUniverInstanceService } from '@univerjs/core';
|
|
22
23
|
import { IFormulaCurrentConfigService } from './current-data.service';
|
|
24
|
+
import { FormulaCacheService } from './formula-cache.service';
|
|
23
25
|
import { IHyperlinkEngineFormulaService } from './hyperlink-engine-formula.service';
|
|
24
26
|
/**
|
|
25
27
|
* The formula engine has a lot of stages. IDLE and CALCULATION_COMPLETED can be considered as
|
|
@@ -88,7 +90,12 @@ export interface IFormulaRuntimeService {
|
|
|
88
90
|
currentUnitId: string;
|
|
89
91
|
dispose(): void;
|
|
90
92
|
reset(): void;
|
|
91
|
-
|
|
93
|
+
/** Custom runtimes without cache hooks continue to compute uncached values. */
|
|
94
|
+
getCalculationCache?(): FormulaCalculationCache | undefined;
|
|
95
|
+
clearInvertedIndexCache?(): void;
|
|
96
|
+
releaseCalculationCache?(): void;
|
|
97
|
+
/** Start empty when the engine will supply the complete current cycle set. */
|
|
98
|
+
beginCircularReferences(clearPrevious?: boolean): void;
|
|
92
99
|
clearCircularReferenceCells(cells: {
|
|
93
100
|
unitId: string;
|
|
94
101
|
subUnitId: string;
|
|
@@ -149,9 +156,11 @@ export interface IFormulaRuntimeService {
|
|
|
149
156
|
getDependencyTreeModelData(): IFormulaDependencyTreeJson[];
|
|
150
157
|
}
|
|
151
158
|
export declare class FormulaRuntimeService extends Disposable implements IFormulaRuntimeService {
|
|
159
|
+
private readonly _cacheService;
|
|
152
160
|
private readonly _currentConfigService;
|
|
153
161
|
private readonly _hyperlinkEngineFormulaService;
|
|
154
162
|
private readonly _univerInstanceService;
|
|
163
|
+
private _calculationCache;
|
|
155
164
|
private _formulaExecuteStage;
|
|
156
165
|
private _circularReferences;
|
|
157
166
|
private _pendingCircularReferences;
|
|
@@ -184,7 +193,7 @@ export declare class FormulaRuntimeService extends Disposable implements IFormul
|
|
|
184
193
|
private _formulaCycleIndex;
|
|
185
194
|
private _isCycleDependency;
|
|
186
195
|
private _dependencyTreeModelData;
|
|
187
|
-
constructor(_currentConfigService: IFormulaCurrentConfigService, _hyperlinkEngineFormulaService: IHyperlinkEngineFormulaService, _univerInstanceService: IUniverInstanceService);
|
|
196
|
+
constructor(_cacheService: FormulaCacheService, _currentConfigService: IFormulaCurrentConfigService, _hyperlinkEngineFormulaService: IHyperlinkEngineFormulaService, _univerInstanceService: IUniverInstanceService);
|
|
188
197
|
get currentRow(): number;
|
|
189
198
|
get currentColumn(): number;
|
|
190
199
|
get currentRowCount(): number;
|
|
@@ -213,9 +222,12 @@ export declare class FormulaRuntimeService extends Disposable implements IFormul
|
|
|
213
222
|
isStopExecution(): boolean;
|
|
214
223
|
setFormulaExecuteStage(type: FormulaExecuteStageType): void;
|
|
215
224
|
getFormulaExecuteStage(): FormulaExecuteStageType;
|
|
225
|
+
getCalculationCache(): FormulaCalculationCache | undefined;
|
|
226
|
+
clearInvertedIndexCache(): void;
|
|
227
|
+
releaseCalculationCache(): void;
|
|
216
228
|
reset(): void;
|
|
217
229
|
clearReferenceAndNumberformatCache(): void;
|
|
218
|
-
beginCircularReferences(): void;
|
|
230
|
+
beginCircularReferences(clearPrevious?: boolean): void;
|
|
219
231
|
clearCircularReferenceCells(cells: {
|
|
220
232
|
unitId: string;
|
|
221
233
|
subUnitId: string;
|