@univerjs-pro/engine-formula 0.22.1 → 0.23.0

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.
@@ -0,0 +1,220 @@
1
+ import type { IUnitRange } from '@univerjs/core';
2
+ /**
3
+ * Dependency engine shared type declarations.
4
+ *
5
+ * The engine uses numeric node indexes internally and keeps the external
6
+ * node identity in these public references. `row` and `col` are always
7
+ * zero-based.
8
+ */
9
+ export type CellId = number;
10
+ export type CalcNodeIndex = number;
11
+ export type ExternalNodeId = number | string;
12
+ /**
13
+ * Supported calculation node categories.
14
+ */
15
+ export declare enum CalcNodeType {
16
+ CellFormula = 1,
17
+ OtherFormula = 2,
18
+ FeatureCalculation = 3
19
+ }
20
+ /**
21
+ * Public reference for a calculation node.
22
+ */
23
+ export interface ICalcNodeRef {
24
+ type: CalcNodeType;
25
+ id: ExternalNodeId;
26
+ }
27
+ export type DynamicDependencyId = number | string;
28
+ export type DynamicResolveStatus = 'resolved' | 'unknown' | 'error';
29
+ /**
30
+ * Decoded location for an encoded `CellId`.
31
+ */
32
+ export interface IDecodedCell {
33
+ unitId: string;
34
+ sheetId: string;
35
+ row: number;
36
+ col: number;
37
+ }
38
+ /**
39
+ * Decoded identity for a feature calculation id encoded by the engine.
40
+ */
41
+ export interface IDecodedFeatureCalculationId {
42
+ unitId: string;
43
+ sheetId: string;
44
+ formulaId: string;
45
+ }
46
+ /**
47
+ * Decoded identity for an other formula id encoded by the engine.
48
+ */
49
+ export interface IDecodedOtherFormulaId {
50
+ unitId: string;
51
+ sheetId: string;
52
+ formulaId: string;
53
+ refOffsetX: number;
54
+ refOffsetY: number;
55
+ }
56
+ /**
57
+ * Unit-aware rectangular range.
58
+ */
59
+ export type IRefRange = IUnitRange;
60
+ /**
61
+ * Dependency declaration for a calculation node.
62
+ */
63
+ export interface ICalcNodeDeps {
64
+ /**
65
+ * Direct precedent cells.
66
+ *
67
+ * If a precedent cell is itself a `CellFormula`, it also becomes a
68
+ * precedent node in calculation order.
69
+ */
70
+ cells?: CellId[];
71
+ /**
72
+ * Precedent ranges.
73
+ *
74
+ * Formula cells inside these ranges naturally become precedent nodes.
75
+ */
76
+ ranges?: IRefRange[];
77
+ /**
78
+ * Explicit precedent calculation nodes.
79
+ *
80
+ * `FeatureCalculation` and `CellFormula` can be depended on explicitly.
81
+ * `OtherFormula` cannot be used as a precedent.
82
+ */
83
+ nodes?: ICalcNodeRef[];
84
+ /**
85
+ * Dynamic dependencies such as OFFSET / INDIRECT.
86
+ *
87
+ * `paramDeps` are registered into the static graph so parameter changes
88
+ * dirty the node. Runtime dependencies are patched later through a
89
+ * `DynamicResolver`.
90
+ */
91
+ dynamics?: IDynamicDependency[];
92
+ }
93
+ export type ICompressedSharedFormulaPattern = {
94
+ kind: 'cell';
95
+ unitId: string;
96
+ sheetId: string;
97
+ rowDelta: number;
98
+ colDelta: number;
99
+ } | {
100
+ kind: 'range';
101
+ unitId: string;
102
+ sheetId: string;
103
+ startRowDelta: number;
104
+ startColDelta: number;
105
+ endRowDelta: number;
106
+ endColDelta: number;
107
+ };
108
+ export interface ICompressedSharedFormulaGroup {
109
+ groupId: string;
110
+ fillRange: IRefRange;
111
+ patterns: ICompressedSharedFormulaPattern[];
112
+ }
113
+ export interface IDynamicDependency {
114
+ id: DynamicDependencyId;
115
+ paramDeps: ICalcNodeDeps;
116
+ }
117
+ export interface IDynamicResolveResult {
118
+ signature: string;
119
+ cells?: CellId[];
120
+ ranges?: IRefRange[];
121
+ nodes?: ICalcNodeRef[];
122
+ traceCells?: CellId[];
123
+ status?: DynamicResolveStatus;
124
+ }
125
+ export type IDynamicResolver = (node: ICalcNodeRef, dynamic: IDynamicDependency) => IDynamicResolveResult;
126
+ /**
127
+ * Construction options for the dependency engine.
128
+ */
129
+ export interface IDependencyEngineOptions {
130
+ maxRows: number;
131
+ maxCols: number;
132
+ /**
133
+ * Ranges are indexed by their shorter side until this span is exceeded.
134
+ * Very large ranges are kept in a fallback list.
135
+ */
136
+ maxIndexedSpan?: number;
137
+ /**
138
+ * Changed ranges below this cell count are scanned point-by-point against
139
+ * direct cell dependencies.
140
+ */
141
+ pointScanCellLimit?: number;
142
+ initialNodeCapacity?: number;
143
+ initialRangeCapacity?: number;
144
+ }
145
+ /**
146
+ * Result returned when adding or updating a node.
147
+ */
148
+ export interface ISetNodeResult {
149
+ nodeIndex: CalcNodeIndex;
150
+ hasCycle: boolean;
151
+ }
152
+ /**
153
+ * A single executable item in a dirty calculation plan.
154
+ */
155
+ export interface ICalculationNodePlanItem {
156
+ type: 'node';
157
+ nodeIndex: CalcNodeIndex;
158
+ }
159
+ /**
160
+ * A compact batch of acyclic dirty nodes.
161
+ */
162
+ export interface ICalculationNodesPlanItem {
163
+ type: 'nodes';
164
+ nodeIndices: CalcNodeIndex[];
165
+ }
166
+ /**
167
+ * A strongly-connected dirty node group that should be calculated iteratively.
168
+ */
169
+ export interface ICalculationCyclePlanItem {
170
+ type: 'cycle';
171
+ nodeIndices: CalcNodeIndex[];
172
+ }
173
+ export type ICalculationPlanItem = ICalculationNodePlanItem | ICalculationNodesPlanItem | ICalculationCyclePlanItem;
174
+ /**
175
+ * One independent dirty dependency tree. Trees have no dependency edges between
176
+ * them and can be scheduled independently by higher layers.
177
+ */
178
+ export interface ICalculationOrderTree {
179
+ hasCycle: boolean;
180
+ plan: ICalculationPlanItem[];
181
+ }
182
+ /**
183
+ * Dirty-node calculation order.
184
+ */
185
+ export interface ICalculationOrderResult {
186
+ hasCycle: boolean;
187
+ calculationForest: ICalculationOrderTree[];
188
+ }
189
+ /**
190
+ * Compact dependent list representation. A single dependent is stored as a
191
+ * number and promoted to an array only when needed.
192
+ */
193
+ export type DepList = CalcNodeIndex | CalcNodeIndex[];
194
+ /**
195
+ * Internal range storage strategy.
196
+ */
197
+ export declare enum RangeKind {
198
+ RowIndexed = 1,
199
+ ColIndexed = 2,
200
+ Large = 3
201
+ }
202
+ /**
203
+ * Backward-compatible type aliases for older imports.
204
+ */
205
+ export type CalcNodeRef = ICalcNodeRef;
206
+ export type DecodedCell = IDecodedCell;
207
+ export type DecodedFeatureCalculationId = IDecodedFeatureCalculationId;
208
+ export type DecodedOtherFormulaId = IDecodedOtherFormulaId;
209
+ export type DynamicDependency = IDynamicDependency;
210
+ export type DynamicResolver = IDynamicResolver;
211
+ export type DynamicResolveResult = IDynamicResolveResult;
212
+ export type CompressedSharedFormulaGroup = ICompressedSharedFormulaGroup;
213
+ export type CompressedSharedFormulaPattern = ICompressedSharedFormulaPattern;
214
+ export type RefRange = IRefRange;
215
+ export type CalcNodeDeps = ICalcNodeDeps;
216
+ export type DependencyEngineOptions = IDependencyEngineOptions;
217
+ export type SetNodeResult = ISetNodeResult;
218
+ export type CalculationOrderResult = ICalculationOrderResult;
219
+ export type CalculationPlanItem = ICalculationPlanItem;
220
+ export type CalculationOrderTree = ICalculationOrderTree;
@@ -0,0 +1,8 @@
1
+ export { CellCodec } from './dependency-engine/cell-codec';
2
+ export { DependencyEngine } from './dependency-engine/dependency-engine';
3
+ export { FormulaCellIndex } from './dependency-engine/formula-cell-index';
4
+ export { cellFormulaNode, featureCalculationNode, otherFormulaNode, } from './dependency-engine/node-helpers';
5
+ export { PointSubscriptionIndex } from './dependency-engine/point-subscription-index';
6
+ export { RangeIndex } from './dependency-engine/range-index';
7
+ export type { CalcNodeDeps, CalcNodeIndex, CalcNodeRef, CalculationOrderResult, CalculationOrderTree, CalculationPlanItem, CellId, CompressedSharedFormulaGroup, CompressedSharedFormulaPattern, DecodedCell, DecodedFeatureCalculationId, DecodedOtherFormulaId, DependencyEngineOptions, DynamicDependency, DynamicResolver, DynamicResolveResult, ExternalNodeId, ICalcNodeDeps, ICalcNodeRef, ICalculationOrderResult, ICalculationOrderTree, ICalculationPlanItem, ICompressedSharedFormulaGroup, ICompressedSharedFormulaPattern, IDecodedCell, IDecodedFeatureCalculationId, IDecodedOtherFormulaId, IDependencyEngineOptions, IRefRange, ISetNodeResult, RefRange, SetNodeResult, } from './dependency-engine/types';
8
+ export { CalcNodeType } from './dependency-engine/types';
@@ -1,28 +1,90 @@
1
- import type { Nullable } from '@univerjs/core';
2
- import type { IFeatureCalculationManagerParam, IFormulaData, IFormulaDataItem, IFormulaDependencyTree, IOtherFormulaData, IUnitData } from '@univerjs/engine-formula';
3
- import { FormulaDependencyGenerator, FormulaDependencyTree, FormulaDependencyTreeVirtual } from '@univerjs/engine-formula';
1
+ import type { IUnitRange, Nullable } from '@univerjs/core';
2
+ import type { BaseAstNode, IFormulaDataItem, IFormulaDependencyTree, IFormulaDependencyTreeJson, IUnitData } from '@univerjs/engine-formula';
3
+ import type { DynamicResolver } from './dependency-engine';
4
+ import type { ISharedFormulaCompressionMetrics } from './shared-formula-group-analyzer';
5
+ import { FormulaDependencyGenerator, FormulaDependencyTree, FormulaDependencyTreeType } from '@univerjs/engine-formula';
6
+ export interface IFormulaCalculationTree {
7
+ unitId: string;
8
+ subUnitId: string;
9
+ formula: string;
10
+ row: number;
11
+ column: number;
12
+ rowCount: number;
13
+ columnCount: number;
14
+ refOffsetX: number;
15
+ refOffsetY: number;
16
+ formulaId: Nullable<string>;
17
+ featureId: Nullable<string>;
18
+ getDirtyData: IFormulaDependencyTree['getDirtyData'];
19
+ hasDynamicDeps: boolean;
20
+ rangeList?: IUnitRange[];
21
+ type?: FormulaDependencyTreeType;
22
+ }
23
+ export interface IFormulaCalculationNodeData {
24
+ node: BaseAstNode;
25
+ refOffsetX: number;
26
+ refOffsetY: number;
27
+ }
4
28
  export declare class FormulaDependencyProGenerator extends FormulaDependencyGenerator {
5
- protected _dependencyTreeCache: Map<number, IFormulaDependencyTree>;
29
+ private readonly _featureFormulaDirtyDependencies;
30
+ private readonly _calculationTreeCache;
31
+ private _calculationNodeDataCache;
32
+ private readonly _forcedRecalculationNodeIndices;
33
+ private _sharedFormulaCompressionMetrics;
34
+ private _cacheDependencyTreeModelRangeList;
6
35
  dispose(): void;
7
- generate(isCalculateTreeModel?: boolean): Promise<(FormulaDependencyTree | FormulaDependencyTreeVirtual)[]>;
8
- private _isCyclicUtilMap;
9
- protected _checkIsCycleDependency(treeList: IFormulaDependencyTree[]): boolean;
10
- protected _getFeatureFormulaTree(featureId: string, treeId: Nullable<number>, params: IFeatureCalculationManagerParam): FormulaDependencyTree;
11
- protected _registerOtherFormulas(otherFormulaData: IOtherFormulaData, otherFormulaDataKeys: string[], treeList: IFormulaDependencyTree[]): void;
12
- protected _registerFormulas(formulaDataKeys: string[], formulaData: IFormulaData, unitData: IUnitData, treeList: IFormulaDependencyTree[]): void;
13
- protected _createFDtree(unitId: string, sheetId: string, row: number, column: number, unitData: IUnitData, formulaDataItem: IFormulaDataItem): FormulaDependencyTree;
36
+ clearCalculatedDirty(nodeIndices: number[]): void;
37
+ clearCachedCalculationNodeData(): void;
38
+ clearCachedCalculationTree(): void;
39
+ getCachedCalculationNodeData(nodeIndex: number): IFormulaCalculationNodeData | undefined;
40
+ getCalculationOrder(): import("./dependency-engine").ICalculationOrderResult;
41
+ getSharedFormulaCompressionMetrics(): ISharedFormulaCompressionMetrics;
42
+ hasDynamicDepsByIndex(nodeIndex: number): boolean;
43
+ refreshDynamicDepsByIndex(nodeIndex: number, resolver: DynamicResolver): boolean;
44
+ hasUncalculatedDirtyPrecedentByIndex(nodeIndex: number, calculatedNodeIndices: ReadonlySet<number>): boolean;
45
+ getAllDependencyJson(): Promise<IFormulaDependencyTreeJson[]>;
46
+ generatePro(isCalculateTreeModel?: boolean): Promise<{
47
+ calculationOrderResult: import("./dependency-engine").ICalculationOrderResult;
48
+ dependencyTree: Map<number, IFormulaCalculationTree>;
49
+ }>;
14
50
  /**
15
- * Build a formula dependency tree based on the dependency relationships.
16
- * @param treeList
51
+ * Generate nodes for the dependency tree, where each node contains all the reference data ranges included in each formula.
52
+ * @param formulaData
17
53
  */
18
- protected _getUpdateTreeListAndMakeDependency(): IFormulaDependencyTree[];
19
- protected _getTreeById(treeId: number): IFormulaDependencyTree | undefined;
20
- protected _getTreeNode(tree: IFormulaDependencyTree): import("@univerjs/engine-formula/engine/ast-node/ast-root-node.js").AstRootNode;
21
- private _traverse;
22
- protected _calculateRunList(treeList: IFormulaDependencyTree[]): (FormulaDependencyTree | FormulaDependencyTreeVirtual)[];
23
- protected _getAllTreeList(): Promise<IFormulaDependencyTree[]>;
24
- protected _getDependencyTreeParenIds(tree: IFormulaDependencyTree): Set<number>;
25
- protected _getDependencyTreeChildrenIds(tree: IFormulaDependencyTree): Set<number>;
26
- protected _startFormulaDependencyTreeModel(): void;
27
- protected _endFormulaDependencyTreeModel(): void;
54
+ private _generateTreeListPro;
55
+ private _registerFeatureFormulasPro;
56
+ private _getFeatureFormulaTreePro;
57
+ private _registerOtherFormulasPro;
58
+ private _registerFormulasPro;
59
+ private _createSharedFormulaGroupMap;
60
+ private _createSharedFormulaGroupId;
61
+ private _analyzeSharedFormulaCompression;
62
+ private _getSharedFormulaUnsupportedReason;
63
+ private _convertSharedFormulaPatterns;
64
+ private _hasSharedFormulaSelfOverlap;
65
+ private _computeSharedFormulaSourceCoverage;
66
+ private _normalizeSharedFormulaRange;
67
+ private _recordCompressedSharedFormulaGroupMetrics;
68
+ private _recordExpandedSharedFormulaGroupMetrics;
69
+ private _markDirtyDependenciesPro;
70
+ private _markForcedRecalculationNodesPro;
71
+ private _markDirtyDefinedNameDependenciesPro;
72
+ private _cacheCalculationTree;
73
+ private _cacheCompressedVirtualCalculationTree;
74
+ private _getOffsetRangeList;
75
+ private _getAllDependencyJsonPro;
76
+ private _inferDependencyTreeTypePro;
77
+ private _clearCalculationTreeCache;
78
+ private _releaseDependencyTree;
79
+ private _hasDirtyDefinedNames;
80
+ private _syncForcedRecalculationNodeIndex;
81
+ private _syncCompressedVirtualForcedRecalculationNodeIndex;
82
+ private _detectForcedRecalculationNodePro;
83
+ private _includeDirtyDefinedNamePro;
84
+ private _ensureTreeInitializedForFeatureDependencies;
85
+ private _ensureTreeNodeForCalculation;
86
+ private _getFeatureFormulaDependencyNodes;
87
+ private _rangesIntersectAny;
88
+ private _initialAstNodeAndRanges;
89
+ protected _createFDtree(unitId: string, sheetId: string, row: number, column: number, unitData: IUnitData, formulaDataItem: IFormulaDataItem): FormulaDependencyTree;
28
90
  }
@@ -0,0 +1,45 @@
1
+ import type { IUnitRange } from '@univerjs/core';
2
+ import type { IFormulaData } from '@univerjs/engine-formula';
3
+ export type SharedFormulaFallbackReason = 'small-group' | 'non-rectangular-fill-range' | 'missing-anchor-formula' | 'ambiguous-anchor-formula' | 'unsupported-dynamic-reference' | 'volatile-function' | 'self-overlap' | 'array-formula' | 'spill-formula' | 'external-reference' | 'unsupported-range-pattern';
4
+ export interface ISharedFormulaAnalyzerConfig {
5
+ minSharedGroupSize?: number;
6
+ }
7
+ export interface ISharedFormulaCellAddress {
8
+ unitId: string;
9
+ sheetId: string;
10
+ row: number;
11
+ col: number;
12
+ }
13
+ export interface ISharedFormulaGroupSummary {
14
+ groupId: string;
15
+ unitId: string;
16
+ sheetId: string;
17
+ si: string;
18
+ anchor?: ISharedFormulaCellAddress;
19
+ fillRange?: IUnitRange;
20
+ width: number;
21
+ height: number;
22
+ size: number;
23
+ virtualFormulaCount: number;
24
+ mode: 'candidate' | 'expanded';
25
+ fallbackReason?: SharedFormulaFallbackReason;
26
+ }
27
+ export interface ISharedFormulaCompressionMetrics {
28
+ totalFormulaNodes: number;
29
+ totalSharedFormulaGroups: number;
30
+ compressedSharedFormulaGroups: number;
31
+ compressibleSharedFormulaGroups: number;
32
+ expandedSharedFormulaGroups: number;
33
+ totalVirtualFormulaNodesInCompressedGroups: number;
34
+ totalVirtualFormulaNodesInCompressibleGroups: number;
35
+ skippedExpandedDependencyRegistrationCount: number;
36
+ sharedPatternCount: number;
37
+ sharedSourceCoverageEntryCount: number;
38
+ fallbackReasonCounts: Partial<Record<SharedFormulaFallbackReason, number>>;
39
+ }
40
+ export interface ISharedFormulaAnalysisResult {
41
+ groups: ISharedFormulaGroupSummary[];
42
+ metrics: ISharedFormulaCompressionMetrics;
43
+ }
44
+ export declare function createEmptySharedFormulaCompressionMetrics(): ISharedFormulaCompressionMetrics;
45
+ export declare function analyzeSharedFormulaGroups(formulaData: IFormulaData, config?: ISharedFormulaAnalyzerConfig): ISharedFormulaAnalysisResult;
@@ -1,3 +1,2 @@
1
- export { LexerTreeProBuilder } from './engine/lexer-tree-builder';
2
1
  export { UniverProFormulaEnginePlugin } from './plugin';
3
2
  export * from '@univerjs/engine-formula';
@@ -1,8 +1,6 @@
1
1
  import { UniverFormulaEnginePlugin } from '@univerjs/engine-formula';
2
- export declare const BUILD_TIMESTAMP: number;
3
2
  export declare class UniverProFormulaEnginePlugin extends UniverFormulaEnginePlugin {
4
3
  static packageName: string;
5
4
  static version: string;
6
5
  protected _initializeWithOverride(): void;
7
- private _initLicenseValid;
8
6
  }
@@ -1,4 +1,21 @@
1
+ import type { IFormulaDatasetConfig } from '@univerjs/engine-formula';
2
+ import type { CalcNodeIndex, DynamicResolver, ICalculationOrderResult } from '../engine/dependency-engine';
3
+ import type { IFormulaCalculationTree } from '../engine/formula-dependency';
1
4
  import { CalculateFormulaService } from '@univerjs/engine-formula';
2
5
  export declare class CalculateFormulaProService extends CalculateFormulaService {
3
- protected _apply(isArrayFormulaState?: boolean): Promise<import("@univerjs/engine-formula").IAllRuntimeData | undefined>;
6
+ private _dynamicRuntimeRanges;
7
+ execute(formulaDatasetConfig: IFormulaDatasetConfig): Promise<void>;
8
+ protected _executeStep(cycleReferenceCount?: number): Promise<true | undefined>;
9
+ protected _apply(isArrayFormulaState?: boolean, cycleReferenceCount?: number): Promise<import("@univerjs/engine-formula").IAllRuntimeData | undefined>;
10
+ private _shouldRescheduleAfterDynamicChange;
11
+ protected _forEachCalculationPlanTree(calculationOrderResult: Pick<ICalculationOrderResult, 'calculationForest'>, dependencyTree: Map<CalcNodeIndex, IFormulaCalculationTree>, cycleReferenceCount: number, visitor: (tree: IFormulaCalculationTree, nodeIndex: CalcNodeIndex, cycleIndex?: number) => Promise<boolean | void>): Promise<void>;
12
+ protected _getCalculationPlanTreeCount(calculationOrderResult: Pick<ICalculationOrderResult, 'calculationForest'>, dependencyTree: Map<CalcNodeIndex, IFormulaCalculationTree>, cycleReferenceCount: number): number;
13
+ protected _getDynamicResolver(): DynamicResolver | undefined;
14
+ private _refreshDynamicDepsAfterCalculate;
15
+ private _collectAddressFunctionRuntimeRanges;
16
+ private _collectAddressFunctionRuntimeRangesInternal;
17
+ private _getRangeSignature;
18
+ private _waitForExecutionSlot;
19
+ private _calculateDependencyTree;
20
+ private _getCalculationNodeData;
4
21
  }
@@ -1,24 +1,49 @@
1
- import type { IRange, Nullable } from '@univerjs/core';
2
- import type { FormulaDependencyTree, IFormulaDependencyTree } from '@univerjs/engine-formula';
3
- import { RTree } from '@univerjs/core';
1
+ import type { IUnitRange } from '@univerjs/core';
2
+ import type { FormulaDependencyTree, IDirtyUnitFeatureMap, IDirtyUnitOtherFormulaMap, IDirtyUnitSheetNameMap, IFormulaDependencyTree } from '@univerjs/engine-formula';
3
+ import type { DynamicResolver, ICalcNodeRef, ICompressedSharedFormulaGroup } from '../engine/dependency-engine';
4
4
  import { DependencyManagerBaseService } from '@univerjs/engine-formula';
5
5
  export declare class DependencyManagerProService extends DependencyManagerBaseService {
6
- protected _allTreeMap: Map<number, Map<string, Map<string, IRange>>>;
7
- protected _dependencyRTreeCache: RTree;
6
+ private _dependencyEngineCache;
8
7
  reset(): void;
9
- addOtherFormulaDependency(unitId: string, sheetId: string, formulaId: string, dependencyTree: IFormulaDependencyTree): void;
8
+ private _getCellIdsAndRanges;
9
+ private _getDynamicDeps;
10
+ addOtherFormulaDependencyPro(unitId: string, sheetId: string, formulaId: string, dependencyTree: IFormulaDependencyTree, featureNodes?: ICalcNodeRef[], mode?: 'replace' | 'merge'): number;
10
11
  removeOtherFormulaDependency(unitId: string, sheetId: string, formulaIds: string[]): void;
11
12
  clearOtherFormulaDependency(unitId: string, sheetId?: string): void;
12
- addFeatureFormulaDependency(unitId: string, sheetId: string, featureId: string, dependencyTree: FormulaDependencyTree): void;
13
+ getOtherFormulaDependencyPro(unitId: string, sheetId: string, formulaId: string, refOffsetX: number, refOffsetY: number): number | undefined;
14
+ addFeatureFormulaDependencyPro(unitId: string, sheetId: string, featureId: string, dependencyTree: FormulaDependencyTree): number;
13
15
  removeFeatureFormulaDependency(unitId: string, sheetId: string, featureIds: string[]): void;
14
16
  clearFeatureFormulaDependency(unitId: string, sheetId?: string): void;
15
- addFormulaDependency(unitId: string, sheetId: string, row: number, column: number, dependencyTree: IFormulaDependencyTree): void;
17
+ getFeatureFormulaDependencyPro(unitId: string, sheetId: string, featureId: string): number | undefined;
18
+ getFeatureFormulaDependencyNodePro(unitId: string, sheetId: string, featureId: string): ICalcNodeRef;
19
+ addFormulaDependencyPro(unitId: string, sheetId: string, row: number, column: number, dependencyTree: IFormulaDependencyTree, featureNodes?: ICalcNodeRef[], mode?: 'replace' | 'merge'): number;
20
+ addFormulaDependencyNodeOnlyPro(unitId: string, sheetId: string, row: number, column: number): number;
21
+ registerCompressedSharedFormulaGroup(group: ICompressedSharedFormulaGroup): void;
22
+ clearCompressedSharedFormulaGroups(unitId?: string, sheetId?: string): void;
16
23
  removeFormulaDependency(unitId: string, sheetId: string, row: number, column: number): void;
17
24
  clearFormulaDependency(unitId: string, sheetId?: string): void;
18
- private _removeDependencyRTreeCache;
19
- removeFormulaDependencyByDefinedName(unitId: string, definedName: string): void;
20
- openKdTree(): void;
21
- closeKdTree(): void;
22
- protected _removeAllTreeMap(treeId: Nullable<number>): void;
23
- protected _addAllTreeMap(tree: IFormulaDependencyTree): void;
25
+ getFormulaDependencyPro(unitId: string, sheetId: string, row: number, column: number): number | undefined;
26
+ markIndicesChanged(indices: number[], options?: {
27
+ onlySelf?: boolean;
28
+ }): void;
29
+ markRangesChanged(ranges: IUnitRange[], options?: {
30
+ includeFormulaCells?: boolean;
31
+ coalesce?: boolean;
32
+ }): void;
33
+ markDirtyFeatureCalculations(dirtyFeatureMap: IDirtyUnitFeatureMap): void;
34
+ markDirtyOtherFormulas(dirtyOtherFormulaMap: IDirtyUnitOtherFormulaMap): void;
35
+ markDirtySheetNames(dirtyNameMap: IDirtyUnitSheetNameMap): void;
36
+ markAllDirty(): void;
37
+ clearCalculatedDirty(indices: number[]): void;
38
+ hasDynamicDeps(node: ICalcNodeRef): boolean;
39
+ hasDynamicDepsByIndex(nodeIndex: number): boolean;
40
+ refreshDynamicDeps(node: ICalcNodeRef, resolver: DynamicResolver): boolean;
41
+ refreshDynamicDepsByIndex(nodeIndex: number, resolver: DynamicResolver): boolean;
42
+ hasUncalculatedDirtyPrecedentByIndex(nodeIndex: number, calculatedNodeIndices: ReadonlySet<number>): boolean;
43
+ forEachPrecedentNodeByIndex(nodeIndex: number, cb: (precedentNodeIndex: number) => void): void;
44
+ forEachDependentNodeByIndex(nodeIndex: number, cb: (dependentNodeIndex: number) => void): void;
45
+ prepareDynamicDependencies(resolver: DynamicResolver): boolean;
46
+ getCalculationOrder(options?: {
47
+ detectCycles?: boolean;
48
+ }): import("../engine/dependency-engine").ICalculationOrderResult;
24
49
  }
package/lib/umd/facade.js CHANGED
@@ -1 +1 @@
1
- (function(_0x19859c,_0x4341f7){var _0x213b25=_0x14de,_0x10f7fd=_0x19859c();while(!![]){try{var _0x211fb4=parseInt(_0x213b25(0x162))/0x1*(parseInt(_0x213b25(0x161))/0x2)+parseInt(_0x213b25(0x15f))/0x3+parseInt(_0x213b25(0x152))/0x4+parseInt(_0x213b25(0x15a))/0x5*(-parseInt(_0x213b25(0x159))/0x6)+parseInt(_0x213b25(0x15c))/0x7+parseInt(_0x213b25(0x154))/0x8+parseInt(_0x213b25(0x158))/0x9*(-parseInt(_0x213b25(0x156))/0xa);if(_0x211fb4===_0x4341f7)break;else _0x10f7fd['push'](_0x10f7fd['shift']());}catch(_0x30505d){_0x10f7fd['push'](_0x10f7fd['shift']());}}}(_0x5ae6,0x60342),function(_0x137eaf,_0x38664e){var _0x20ebef=_0x14de;typeof exports=='object'&&typeof module<'u'?_0x38664e(exports,require(`@univerjs/engine-formula/facade`)):typeof define==_0x20ebef(0x15e)&&define[_0x20ebef(0x15b)]?define(['exports',_0x20ebef(0x153)],_0x38664e):(_0x137eaf=typeof globalThis<'u'?globalThis:_0x137eaf||self,_0x38664e(_0x137eaf[_0x20ebef(0x15d)]={},_0x137eaf[_0x20ebef(0x163)]));}(this,function(_0x1b5240,_0x3dd8d3){var _0x34202b=_0x14de;Object[_0x34202b(0x160)](_0x1b5240,Symbol[_0x34202b(0x155)],{'value':'Module'}),Object[_0x34202b(0x160)](_0x1b5240,_0x34202b(0x157),{'enumerable':!0x0,'get':function(){return _0x3dd8d3['FFormula'];}});}));function _0x14de(_0x7b697c,_0x5b0451){_0x7b697c=_0x7b697c-0x152;var _0x5ae6e0=_0x5ae6();var _0x14dece=_0x5ae6e0[_0x7b697c];return _0x14dece;}function _0x5ae6(){var _0x1068c1=['UniverEngineFormulaFacade','1529632NHtYaz','@univerjs/engine-formula/facade','689592MrKKrM','toStringTag','10FpPAtd','FFormula','12431754ZevmIl','6maaMeS','2923940wkEMmK','amd','4424875SWLpFg','UniverProEngineFormulaFacade','function','1455126PJrkKc','defineProperty','734aWLILx','2110QwujPP'];_0x5ae6=function(){return _0x1068c1;};return _0x5ae6();}
1
+ (function(_0x38069a,_0x509152){var _0x4f947d=_0x5925,_0x14bcc2=_0x38069a();while(!![]){try{var _0x3c70da=parseInt(_0x4f947d(0x1c8))/0x1+parseInt(_0x4f947d(0x1c3))/0x2+-parseInt(_0x4f947d(0x1c9))/0x3*(parseInt(_0x4f947d(0x1cd))/0x4)+parseInt(_0x4f947d(0x1c2))/0x5*(parseInt(_0x4f947d(0x1c4))/0x6)+-parseInt(_0x4f947d(0x1ca))/0x7*(parseInt(_0x4f947d(0x1c7))/0x8)+parseInt(_0x4f947d(0x1c0))/0x9+-parseInt(_0x4f947d(0x1cb))/0xa*(-parseInt(_0x4f947d(0x1be))/0xb);if(_0x3c70da===_0x509152)break;else _0x14bcc2['push'](_0x14bcc2['shift']());}catch(_0x2604ab){_0x14bcc2['push'](_0x14bcc2['shift']());}}}(_0x5823,0x7ced9),function(_0x1e400c,_0x483446){var _0x5e7a57=_0x5925;typeof exports==_0x5e7a57(0x1bf)&&typeof module<'u'?_0x483446(exports,require(`@univerjs/engine-formula/facade`)):typeof define==_0x5e7a57(0x1cc)&&define['amd']?define([_0x5e7a57(0x1c6),_0x5e7a57(0x1c1)],_0x483446):(_0x1e400c=typeof globalThis<'u'?globalThis:_0x1e400c||self,_0x483446(_0x1e400c['UniverProEngineFormulaFacade']={},_0x1e400c[_0x5e7a57(0x1ce)]));}(this,function(_0x4743d2,_0x4fd6b1){var _0x8572ea=_0x5925;Object[_0x8572ea(0x1cf)](_0x4743d2,Symbol['toStringTag'],{'value':_0x8572ea(0x1bd)}),Object[_0x8572ea(0x1cf)](_0x4743d2,'FFormula',{'enumerable':!0x0,'get':function(){var _0x538da3=_0x8572ea;return _0x4fd6b1[_0x538da3(0x1c5)];}});}));function _0x5925(_0x5274ec,_0x54580f){_0x5274ec=_0x5274ec-0x1bd;var _0x58230f=_0x5823();var _0x5925f4=_0x58230f[_0x5274ec];return _0x5925f4;}function _0x5823(){var _0x5a0757=['3vgXjgB','7dQQJpY','760jABVXV','function','3066056taTkdH','UniverEngineFormulaFacade','defineProperty','Module','72952kRdKTc','object','4980987IpBEfM','@univerjs/engine-formula/facade','607465obAUrd','44626wzXAuA','48oZPayL','FFormula','exports','7706728KEQUhI','189828RkdLYK'];_0x5823=function(){return _0x5a0757;};return _0x5823();}