@univerjs/engine-formula 0.15.0 → 0.15.1-insiders.20260117-8ce4a01

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;
@@ -36,12 +36,7 @@ export declare class BaseReferenceObject extends ObjectClassType {
36
36
  x: number;
37
37
  y: number;
38
38
  };
39
- getRangePosition(): {
40
- startRow: number;
41
- endRow: number;
42
- startColumn: number;
43
- endColumn: number;
44
- };
39
+ getRangePosition(): IRange;
45
40
  isReferenceObject(): boolean;
46
41
  iterator(callback: (valueObject: Nullable<BaseValueObject>, rowIndex: number, columnIndex: number) => Nullable<boolean>): Nullable<boolean>;
47
42
  getFirstCell(): BaseValueObject;
@@ -120,12 +115,7 @@ export declare class BaseReferenceObject extends ObjectClassType {
120
115
  getCellPattern(unitId: string, sheetId: string, row: number, column: number): string;
121
116
  toArrayValueObject(useCache?: boolean): ArrayValueObject;
122
117
  toUnitRange(): {
123
- range: {
124
- startRow: number;
125
- endRow: number;
126
- startColumn: number;
127
- endColumn: number;
128
- };
118
+ range: IRange;
129
119
  sheetId: string;
130
120
  unitId: string;
131
121
  };
@@ -62,19 +62,9 @@ export declare class MultiAreaReferenceObject extends BaseReferenceObject {
62
62
  * - inner `_areas[row]` dimension => columns
63
63
  */
64
64
  toArrayValueObject(): ArrayValueObject;
65
- getRangePosition(): {
66
- startRow: number;
67
- endRow: number;
68
- startColumn: number;
69
- endColumn: number;
70
- };
65
+ getRangePosition(): import('@univerjs/core').IRange;
71
66
  toUnitRange(): {
72
- range: {
73
- startRow: number;
74
- endRow: number;
75
- startColumn: number;
76
- endColumn: number;
77
- };
67
+ range: import('@univerjs/core').IRange;
78
68
  sheetId: string;
79
69
  unitId: string;
80
70
  };
@@ -101,24 +101,11 @@ export declare class FFormula extends FBase {
101
101
  */
102
102
  calculationEnd(callback: (functionsExecutedState: FormulaExecutedStateType) => void): IDisposable;
103
103
  /**
104
- * Wait for computing in the Univer instance to complete. Please note that this does not only include formula calculation,
105
- * but also other computing tasks, e.g. pivot table calculation.
106
- * @param {number} [timeout] The maximum time to wait for the computing to complete, in milliseconds. The default
107
- * value is 30,000 milliseconds.
108
- * @returns {Promise<boolean>} This method returns `true` if the computing is complete. If the timeout is reached, this
109
- * method returns `false`.
110
- *
111
- * @example
112
- * ```ts
113
- * const formulaEngine = univerAPI.getFormula();
114
- * formulaEngine.whenComputingCompleteAsync(3000).then((isComplete) => {
115
- * console.log('Computing complete:', isComplete);
116
- * });
117
- * ```
104
+ * @deprecated Use `onCalculationEnd` instead.
118
105
  */
119
106
  whenComputingCompleteAsync(timeout?: number): Promise<boolean>;
120
107
  /**
121
- * @deprecated Use `whenComputingCompleteAsync` instead.
108
+ * Waits for the formula calculation to complete.
122
109
  * @returns {Promise<void>} This method returns a promise that resolves when the calculation is complete.
123
110
  */
124
111
  onCalculationEnd(): Promise<void>;
@@ -17,6 +17,7 @@ export type { IArrayFormulaEmbeddedMap, IArrayFormulaRangeType, IArrayFormulaUni
17
17
  export { BooleanValue } from './basics/common';
18
18
  export { type IOtherFormulaData } from './basics/common';
19
19
  export type { IExprTreeNode, ISuperTable, IUnitRowData } from './basics/common';
20
+ export { excelDateSerial } from './basics/date';
20
21
  export { isInDirtyRange } from './basics/dirty';
21
22
  export { ERROR_TYPE_SET, ErrorType } from './basics/error-type';
22
23
  export { type ISheetFormulaError } from './basics/error-type';