@univerjs/engine-formula 0.15.1 → 0.15.2-insiders.20260122-b1556b1

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.
@@ -1,4 +1,4 @@
1
- import { IRange, IUnitRange, Nullable, Disposable, RTree } from '@univerjs/core';
1
+ import { IRange, IUnitRange, Nullable, Disposable, IUniverInstanceService, RTree } from '@univerjs/core';
2
2
  import { IFeatureDirtyRangeType, IFormulaData, IFormulaDataItem, IOtherFormulaData, IUnitData } from '../../basics/common';
3
3
  import { IFeatureCalculationManagerParam, IFeatureCalculationManagerService } from '../../services/feature-calculation-manager.service';
4
4
  import { FunctionNode } from '../ast-node';
@@ -23,11 +23,12 @@ export interface IFormulaDependencyGenerator {
23
23
  getRangeDependentsAndInRangeFormulas(unitRanges: IUnitRange[]): Promise<IFormulaDependentsAndInRangeResults>;
24
24
  }
25
25
  export declare const IFormulaDependencyGenerator: import('@wendellhu/redi').IdentifierDecorator<IFormulaDependencyGenerator>;
26
- export declare class FormulaDependencyGenerator extends Disposable {
26
+ export declare class FormulaDependencyGenerator extends Disposable implements IFormulaDependencyGenerator {
27
27
  protected readonly _currentConfigService: IFormulaCurrentConfigService;
28
28
  protected readonly _runtimeService: IFormulaRuntimeService;
29
29
  protected readonly _otherFormulaManagerService: IOtherFormulaManagerService;
30
30
  private readonly _featureCalculationManagerService;
31
+ private readonly _univerInstanceService;
31
32
  private readonly _interpreter;
32
33
  protected readonly _astTreeBuilder: AstTreeBuilder;
33
34
  protected readonly _lexer: Lexer;
@@ -35,8 +36,10 @@ export declare class FormulaDependencyGenerator extends Disposable {
35
36
  protected readonly _lexerTreeBuilder: LexerTreeBuilder;
36
37
  private _updateRangeFlattenCache;
37
38
  protected _dependencyRTreeCacheForAddressFunction: RTree;
38
- constructor(_currentConfigService: IFormulaCurrentConfigService, _runtimeService: IFormulaRuntimeService, _otherFormulaManagerService: IOtherFormulaManagerService, _featureCalculationManagerService: IFeatureCalculationManagerService, _interpreter: Interpreter, _astTreeBuilder: AstTreeBuilder, _lexer: Lexer, _dependencyManagerService: IDependencyManagerService, _lexerTreeBuilder: LexerTreeBuilder);
39
+ constructor(_currentConfigService: IFormulaCurrentConfigService, _runtimeService: IFormulaRuntimeService, _otherFormulaManagerService: IOtherFormulaManagerService, _featureCalculationManagerService: IFeatureCalculationManagerService, _univerInstanceService: IUniverInstanceService, _interpreter: Interpreter, _astTreeBuilder: AstTreeBuilder, _lexer: Lexer, _dependencyManagerService: IDependencyManagerService, _lexerTreeBuilder: LexerTreeBuilder);
39
40
  dispose(): void;
41
+ private _initUnitDispose;
42
+ private _disposeByUnitId;
40
43
  generate(isCalculateTreeModel?: boolean): Promise<(FormulaDependencyTree | FormulaDependencyTreeVirtual)[]>;
41
44
  private _dependencyFeatureCalculation;
42
45
  private _clearFeatureCalculationNode;
@@ -102,20 +102,6 @@ export declare class FFormula extends FBase {
102
102
  calculationEnd(callback: (functionsExecutedState: FormulaExecutedStateType) => void): IDisposable;
103
103
  /**
104
104
  * @deprecated Use `onCalculationEnd` instead.
105
- * Wait for computing in the Univer instance to complete. Please note that this does not only include formula calculation,
106
- * but also other computing tasks, e.g. pivot table calculation.
107
- * @param {number} [timeout] The maximum time to wait for the computing to complete, in milliseconds. The default
108
- * value is 30,000 milliseconds.
109
- * @returns {Promise<boolean>} This method returns `true` if the computing is complete. If the timeout is reached, this
110
- * method returns `false`.
111
- *
112
- * @example
113
- * ```ts
114
- * const formulaEngine = univerAPI.getFormula();
115
- * formulaEngine.whenComputingCompleteAsync(3000).then((isComplete) => {
116
- * console.log('Computing complete:', isComplete);
117
- * });
118
- * ```
119
105
  */
120
106
  whenComputingCompleteAsync(timeout?: number): Promise<boolean>;
121
107
  /**