@univerjs/engine-formula 0.1.6 → 0.1.8

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.
Files changed (46) hide show
  1. package/lib/cjs/index.js +1 -1
  2. package/lib/es/index.js +3715 -3356
  3. package/lib/types/basics/common.d.ts +9 -8
  4. package/lib/types/commands/mutations/set-array-formula-data.mutation.d.ts +3 -2
  5. package/lib/types/commands/mutations/set-defined-name.mutation.d.ts +1 -7
  6. package/lib/types/commands/mutations/set-formula-calculation.mutation.d.ts +1 -2
  7. package/lib/types/commands/mutations/set-formula-data.mutation.d.ts +3 -0
  8. package/lib/types/controller/calculate.controller.d.ts +2 -2
  9. package/lib/types/controller/set-dependency.controller.d.ts +10 -0
  10. package/lib/types/controller/set-other-formula.controller.d.ts +3 -1
  11. package/lib/types/engine/analysis/__tests__/create-command-test-bed.d.ts +3 -3
  12. package/lib/types/engine/analysis/lexer-tree-builder.d.ts +6 -2
  13. package/lib/types/engine/ast-node/function-node.d.ts +6 -2
  14. package/lib/types/engine/ast-node/reference-node.d.ts +1 -0
  15. package/lib/types/engine/dependency/dependency-tree.d.ts +2 -0
  16. package/lib/types/engine/dependency/formula-dependency.d.ts +9 -1
  17. package/lib/types/engine/reference-object/base-reference-object.d.ts +16 -6
  18. package/lib/types/engine/utils/reference.d.ts +10 -1
  19. package/lib/types/engine/utils/sequence.d.ts +2 -1
  20. package/lib/types/engine/utils/value-object.d.ts +7 -0
  21. package/lib/types/engine/value-object/array-value-object.d.ts +7 -1
  22. package/lib/types/functions/__tests__/create-function-test-bed.d.ts +3 -3
  23. package/lib/types/functions/base-function.d.ts +12 -0
  24. package/lib/types/functions/information/iseven/iseven.d.ts +7 -0
  25. package/lib/types/functions/information/iseven/iseven.spec.d.ts +16 -0
  26. package/lib/types/functions/information/isodd/isodd.d.ts +7 -0
  27. package/lib/types/functions/information/isodd/isodd.spec.d.ts +16 -0
  28. package/lib/types/functions/information/isref/index.d.ts +1 -1
  29. package/lib/types/functions/lookup/indirect/index.d.ts +8 -0
  30. package/lib/types/functions/math/subtotal/index.d.ts +1 -1
  31. package/lib/types/functions/statistical/maxifs/__tests__/index.spec.d.ts +16 -0
  32. package/lib/types/functions/statistical/maxifs/index.d.ts +7 -0
  33. package/lib/types/functions/text/lower/__test__/index.spec.d.ts +16 -0
  34. package/lib/types/functions/text/lower/index.d.ts +7 -0
  35. package/lib/types/index.d.ts +6 -7
  36. package/lib/types/models/__tests__/create-command-test-bed.d.ts +1 -1
  37. package/lib/types/models/formula-data.model.d.ts +16 -17
  38. package/lib/types/models/utils/formula-data-util.d.ts +10 -0
  39. package/lib/types/plugin.d.ts +1 -1
  40. package/lib/types/services/current-data.service.d.ts +9 -5
  41. package/lib/types/services/defined-names.service.d.ts +2 -0
  42. package/lib/types/services/dependency-manager.service.d.ts +74 -0
  43. package/lib/types/services/runtime.service.d.ts +1 -5
  44. package/lib/umd/index.js +1 -1
  45. package/package.json +9 -9
  46. package/lib/types/commands/mutations/set-numfmt-formula-data.mutation.d.ts +0 -7
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Inc.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export {};
@@ -0,0 +1,7 @@
1
+ import { BaseFunction } from '../../base-function';
2
+ import { BaseValueObject } from '../../../engine/value-object/base-value-object';
3
+
4
+ export declare class Lower extends BaseFunction {
5
+ calculate(text: BaseValueObject): BaseValueObject;
6
+ private _handleSingleText;
7
+ }
@@ -13,17 +13,17 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- export type { IArrayFormulaRangeType, IArrayFormulaUnitCellType, IDirtyUnitFeatureMap, IDirtyUnitSheetNameMap, IFormulaData, IFormulaDataItem, IFormulaDatasetConfig, IRuntimeUnitDataType, ISheetData, IUnitData, IUnitSheetNameMap, INumfmtItemMap, IDirtyUnitOtherFormulaMap, IDirtyUnitSheetDefinedNameMap, } from './basics/common';
16
+ export type { IArrayFormulaRangeType, IArrayFormulaUnitCellType, IDirtyUnitFeatureMap, IDirtyUnitSheetNameMap, IFormulaData, IFormulaDataItem, IFormulaDatasetConfig, IRuntimeUnitDataType, ISheetData, IUnitData, IUnitSheetNameMap, IDirtyUnitOtherFormulaMap, IDirtyUnitSheetDefinedNameMap, } from './basics/common';
17
17
  export { isInDirtyRange } from './basics/dirty';
18
- export { ErrorType } from './basics/error-type';
18
+ export { ErrorType, ERROR_TYPE_SET } from './basics/error-type';
19
19
  export { FunctionType, type IFunctionInfo, type IFunctionParam } from './basics/function';
20
20
  export { type IFunctionNames } from './basics/function';
21
21
  export { includeFormulaLexerToken, isFormulaLexerToken, normalizeSheetName } from './basics/match-token';
22
22
  export { convertUnitDataToRuntime } from './basics/runtime';
23
23
  export { matchToken, compareToken, operatorToken } from './basics/token';
24
24
  export { RegisterFunctionMutation } from './commands/mutations/register-function.mutation';
25
- export { type ISetArrayFormulaDataMutationParams, SetArrayFormulaDataMutation, SetArrayFormulaDataUndoMutationFactory, } from './commands/mutations/set-array-formula-data.mutation';
26
- export { RemoveDefinedNameMutation, SetDefinedNameMutation, SetDefinedNameCurrentMutation, type ISetDefinedNameMutationSearchParam, type ISetDefinedNameMutationParam } from './commands/mutations/set-defined-name.mutation';
25
+ export { type ISetArrayFormulaDataMutationParams, SetArrayFormulaDataMutation, } from './commands/mutations/set-array-formula-data.mutation';
26
+ export { RemoveDefinedNameMutation, SetDefinedNameMutation, type ISetDefinedNameMutationSearchParam, type ISetDefinedNameMutationParam } from './commands/mutations/set-defined-name.mutation';
27
27
  export { RemoveFeatureCalculationMutation, SetFeatureCalculationMutation, } from './commands/mutations/set-feature-calculation.mutation';
28
28
  export { type ISetFormulaCalculationNotificationMutation, type ISetFormulaCalculationResultMutation, type ISetFormulaCalculationStartMutation, SetFormulaCalculationNotificationMutation, SetFormulaCalculationResultMutation, SetFormulaCalculationStartMutation, SetFormulaCalculationStopMutation, } from './commands/mutations/set-formula-calculation.mutation';
29
29
  export { type ISetFormulaDataMutationParams, SetFormulaDataMutation, } from './commands/mutations/set-formula-data.mutation';
@@ -35,7 +35,7 @@ export { LexerTreeBuilder } from './engine/analysis/lexer-tree-builder';
35
35
  export { BaseReferenceObject, type FunctionVariantType } from './engine/reference-object/base-reference-object';
36
36
  export { RangeReferenceObject } from './engine/reference-object/range-reference-object';
37
37
  export { deserializeRangeForR1C1 } from './engine/utils/r1c1-reference';
38
- export { deserializeRangeWithSheet, getAbsoluteRefTypeWithSingleString, getAbsoluteRefTypeWitString, type IAbsoluteRefTypeForRange, serializeRange, serializeRangeToRefString, serializeRangeWithSheet, serializeRangeWithSpreadsheet, } from './engine/utils/reference';
38
+ export { deserializeRangeWithSheet, getAbsoluteRefTypeWithSingleString, getAbsoluteRefTypeWitString, type IAbsoluteRefTypeForRange, serializeRange, serializeRangeToRefString, serializeRangeWithSheet, serializeRangeWithSpreadsheet, isReferenceStringWithEffectiveColumn, getRangeWithRefsString, isReferenceStrings, } from './engine/utils/reference';
39
39
  export { generateStringWithSequence, type ISequenceNode, sequenceNodeType } from './engine/utils/sequence';
40
40
  export { ArrayValueObject, ValueObjectFactory } from './engine/value-object/array-value-object';
41
41
  export { BaseValueObject, ErrorValueObject } from './engine/value-object/base-value-object';
@@ -86,8 +86,6 @@ export { IFunctionService } from './services/function.service';
86
86
  export { IOtherFormulaManagerService, OtherFormulaManagerService } from './services/other-formula-manager.service';
87
87
  export { FormulaExecuteStageType, type IExecutionInProgressParams } from './services/runtime.service';
88
88
  export { FormulaExecutedStateType, type IAllRuntimeData } from './services/runtime.service';
89
- export { SetNumfmtFormulaDataMutation } from './commands/mutations/set-numfmt-formula-data.mutation';
90
- export type { ISetNumfmtFormulaDataMutationParams } from './commands/mutations/set-numfmt-formula-data.mutation';
91
89
  export { isReferenceString } from './basics/regex';
92
90
  export { matchRefDrawToken } from './basics/match-token';
93
91
  export { IDefinedNamesService, DefinedNamesService, type IDefinedNamesServiceParam, type IDefinedNameMapItem } from './services/defined-names.service';
@@ -95,3 +93,4 @@ export { isFormulaTransformable, transformFormula } from './engine/utils/relativ
95
93
  export { IFormulaRuntimeService, FormulaRuntimeService } from './services/runtime.service';
96
94
  export { IFormulaCurrentConfigService, FormulaCurrentConfigService } from './services/current-data.service';
97
95
  export { IActiveDirtyManagerService } from './services/active-dirty-manager.service';
96
+ export type { IRangeChange } from './models/formula-data.model';
@@ -1,7 +1,7 @@
1
1
  import { Dependency } from '@wendellhu/redi';
2
2
  import { IWorkbookData, Univer } from '@univerjs/core';
3
3
 
4
- export declare function createCommandTestBed(workbookConfig?: IWorkbookData, dependencies?: Dependency[]): {
4
+ export declare function createCommandTestBed(workbookData?: IWorkbookData, dependencies?: Dependency[]): {
5
5
  univer: Univer;
6
6
  get: {
7
7
  <T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, lookUp?: import('@wendellhu/redi').LookUp | undefined): T;
@@ -1,20 +1,19 @@
1
+ import { IFormulaIdMap } from './utils/formula-data-util';
1
2
  import { LexerTreeBuilder } from '../engine/analysis/lexer-tree-builder';
2
- import { IArrayFormulaRangeType, IArrayFormulaUnitCellType, IFormulaData, IFormulaDataItem, INumfmtItemMap, IRuntimeUnitDataType, IUnitData, IUnitSheetNameMap } from '../basics/common';
3
- import { ICellData, IObjectMatrixPrimitiveType, Nullable, Disposable, IUniverInstanceService, ObjectMatrix } from '@univerjs/core';
3
+ import { IArrayFormulaRangeType, IArrayFormulaUnitCellType, IFormulaData, IFormulaDataItem, IRuntimeUnitDataType, IUnitData, IUnitSheetNameMap } from '../basics/common';
4
+ import { ICellData, IObjectMatrixPrimitiveType, IRange, Nullable, Disposable, IUniverInstanceService, ObjectMatrix } from '@univerjs/core';
4
5
 
5
- export interface IFormulaIdMap {
6
- f: string;
7
- r: number;
8
- c: number;
6
+ export interface IRangeChange {
7
+ oldCell: IRange;
8
+ newCell: IRange;
9
9
  }
10
10
  export declare class FormulaDataModel extends Disposable {
11
- private readonly _currentUniverService;
11
+ private readonly _univerInstanceService;
12
12
  private readonly _lexerTreeBuilder;
13
13
  private _formulaData;
14
14
  private _arrayFormulaRange;
15
15
  private _arrayFormulaCellData;
16
- private _numfmtItemMap;
17
- constructor(_currentUniverService: IUniverInstanceService, _lexerTreeBuilder: LexerTreeBuilder);
16
+ constructor(_univerInstanceService: IUniverInstanceService, _lexerTreeBuilder: LexerTreeBuilder);
18
17
  clearPreviousArrayFormulaCellData(clearArrayFormulaCellData: IRuntimeUnitDataType): void;
19
18
  mergeArrayFormulaCellData(unitData: IRuntimeUnitDataType): void;
20
19
  getFormulaData(): IFormulaData;
@@ -23,23 +22,23 @@ export declare class FormulaDataModel extends Disposable {
23
22
  setArrayFormulaRange(value: IArrayFormulaRangeType): void;
24
23
  getArrayFormulaCellData(): IArrayFormulaUnitCellType;
25
24
  setArrayFormulaCellData(value: IArrayFormulaUnitCellType): void;
26
- getNumfmtItemMap(): INumfmtItemMap;
27
- getNumfmtValue(unitId: string, sheetId: string, row: number, column: number): Nullable<string>;
28
- setNumfmtItemMap(value: INumfmtItemMap): void;
29
- updateNumfmtItemMap(value: INumfmtItemMap): void;
30
25
  mergeArrayFormulaRange(formulaData: IArrayFormulaRangeType): void;
26
+ mergeFormulaData(formulaData: IFormulaData): void;
31
27
  deleteArrayFormulaRange(unitId: string, sheetId: string, row: number, column: number): void;
32
28
  initFormulaData(): void;
33
29
  getCalculateData(): {
34
30
  allUnitData: IUnitData;
35
31
  unitSheetNameMap: IUnitSheetNameMap;
36
32
  };
37
- updateFormulaData(unitId: string, sheetId: string, cellValue: IObjectMatrixPrimitiveType<Nullable<ICellData>>): void;
33
+ updateFormulaData(unitId: string, sheetId: string, cellValue: IObjectMatrixPrimitiveType<Nullable<ICellData>>): IObjectMatrixPrimitiveType<IFormulaDataItem | null>;
38
34
  updateArrayFormulaRange(unitId: string, sheetId: string, cellValue: IObjectMatrixPrimitiveType<Nullable<ICellData>>): void;
39
35
  updateArrayFormulaCellData(unitId: string, sheetId: string, cellValue: IObjectMatrixPrimitiveType<Nullable<ICellData>>): void;
40
- updateNumfmtData(unitId: string, sheetId: string, cellValue: IObjectMatrixPrimitiveType<Nullable<ICellData>>): void;
41
36
  getFormulaItemBySId(sId: string, sheetId: string, unitId: string): Nullable<IFormulaDataItem>;
42
- getFormulaDataItem(row: number, column: number, sheetId: string, unitId: string): IFormulaDataItem | undefined;
37
+ getFormulaDataItem(row: number, column: number, sheetId: string, unitId: string): Nullable<IFormulaDataItem>;
43
38
  getFormulaIdMap(unitId: string, sheetId: string): Map<string, IFormulaIdMap>;
44
39
  }
45
- export declare function initSheetFormulaData(formulaData: IFormulaData, unitId: string, sheetId: string, cellMatrix: ObjectMatrix<Nullable<ICellData>>): void;
40
+ export declare function initSheetFormulaData(formulaData: IFormulaData, unitId: string, sheetId: string, cellMatrix: ObjectMatrix<Nullable<ICellData>>): {
41
+ [x: string]: {
42
+ [x: string]: IObjectMatrixPrimitiveType<IFormulaDataItem>;
43
+ };
44
+ };
@@ -0,0 +1,10 @@
1
+ import { IFormulaDataItem } from '../../basics/common';
2
+ import { ICellData, IRange, Nullable, ObjectMatrix } from '@univerjs/core';
3
+
4
+ export interface IFormulaIdMap {
5
+ f: string;
6
+ r: number;
7
+ c: number;
8
+ }
9
+ export declare function updateFormulaDataByCellValue(sheetFormulaDataMatrix: ObjectMatrix<Nullable<IFormulaDataItem>>, newSheetFormulaDataMatrix: ObjectMatrix<IFormulaDataItem | null>, formulaIdMap: Map<string, IFormulaIdMap>, deleteFormulaIdMap: Map<string, string | IFormulaIdMap>, r: number, c: number, cell: Nullable<ICellData>): void;
10
+ export declare function clearArrayFormulaCellDataByCell(arrayFormulaRangeMatrix: ObjectMatrix<IRange>, arrayFormulaCellDataMatrix: ObjectMatrix<Nullable<ICellData>>, r: number, c: number): true | undefined;
@@ -10,9 +10,9 @@ interface IUniverFormulaEngine {
10
10
  export declare class UniverFormulaEnginePlugin extends Plugin {
11
11
  private _config;
12
12
  protected _injector: Injector;
13
+ static pluginName: string;
13
14
  constructor(_config: IUniverFormulaEngine, _injector: Injector);
14
15
  onStarting(): void;
15
16
  private _initialize;
16
- onReady(): void;
17
17
  }
18
18
  export {};
@@ -1,10 +1,14 @@
1
- import { IDirtyUnitFeatureMap, IDirtyUnitOtherFormulaMap, IDirtyUnitSheetDefinedNameMap, IDirtyUnitSheetNameMap, IFormulaData, IFormulaDatasetConfig, INumfmtItemMap, IRuntimeUnitDataType, IUnitData, IUnitExcludedCell, IUnitSheetNameMap } from '../basics/common';
1
+ import { IDirtyUnitFeatureMap, IDirtyUnitOtherFormulaMap, IDirtyUnitSheetDefinedNameMap, IDirtyUnitSheetNameMap, IFormulaData, IFormulaDatasetConfig, IRuntimeUnitDataType, IUnitData, IUnitExcludedCell, IUnitSheetNameMap, IUnitStylesData } from '../basics/common';
2
2
  import { IUnitRange, Nullable, Disposable, IUniverInstanceService } from '@univerjs/core';
3
3
 
4
4
  export declare const DEFAULT_DOCUMENT_SUB_COMPONENT_ID = "__default_document_sub_component_id20231101__";
5
5
  export interface IFormulaCurrentConfigService {
6
6
  load(config: IFormulaDatasetConfig): void;
7
7
  getUnitData(): IUnitData;
8
+ /**
9
+ * Get the unit styles data.
10
+ */
11
+ getUnitStylesData(): IUnitStylesData;
8
12
  getFormulaData(): IFormulaData;
9
13
  getSheetNameMap(): IUnitSheetNameMap;
10
14
  isForceCalculate(): boolean;
@@ -26,8 +30,9 @@ export interface IFormulaCurrentConfigService {
26
30
  setExecuteSubUnitId(subUnitId: string): void;
27
31
  }
28
32
  export declare class FormulaCurrentConfigService extends Disposable implements IFormulaCurrentConfigService {
29
- private readonly _currentUniverService;
33
+ private readonly _univerInstanceService;
30
34
  private _unitData;
35
+ private _unitStylesData;
31
36
  private _arrayFormulaCellData;
32
37
  private _formulaData;
33
38
  private _sheetNameMap;
@@ -35,14 +40,13 @@ export declare class FormulaCurrentConfigService extends Disposable implements I
35
40
  private _dirtyRanges;
36
41
  private _dirtyNameMap;
37
42
  private _dirtyDefinedNameMap;
38
- private _numfmtItemMap;
39
43
  private _dirtyUnitFeatureMap;
40
44
  private _dirtyUnitOtherFormulaMap;
41
45
  private _excludedCell;
42
46
  private _sheetIdToNameMap;
43
47
  private _executeUnitId;
44
48
  private _executeSubUnitId;
45
- constructor(_currentUniverService: IUniverInstanceService);
49
+ constructor(_univerInstanceService: IUniverInstanceService);
46
50
  dispose(): void;
47
51
  getExecuteUnitId(): Nullable<string>;
48
52
  getExecuteSubUnitId(): Nullable<string>;
@@ -50,6 +54,7 @@ export declare class FormulaCurrentConfigService extends Disposable implements I
50
54
  setExecuteSubUnitId(subUnitId: string): void;
51
55
  getExcludedRange(): Nullable<IUnitExcludedCell>;
52
56
  getUnitData(): IUnitData;
57
+ getUnitStylesData(): IUnitStylesData;
53
58
  getFormulaData(): IFormulaData;
54
59
  getArrayFormulaCellData(): IRuntimeUnitDataType;
55
60
  getSheetNameMap(): IUnitSheetNameMap;
@@ -57,7 +62,6 @@ export declare class FormulaCurrentConfigService extends Disposable implements I
57
62
  getDirtyRanges(): IUnitRange[];
58
63
  getDirtyNameMap(): IDirtyUnitSheetNameMap;
59
64
  getDirtyDefinedNameMap(): IDirtyUnitSheetDefinedNameMap;
60
- getNumfmtItemMap(): INumfmtItemMap;
61
65
  getDirtyUnitFeatureMap(): IDirtyUnitFeatureMap;
62
66
  getDirtyUnitOtherFormulaMap(): IDirtyUnitOtherFormulaMap;
63
67
  getSheetName(unitId: string, sheetId: string): string;
@@ -25,6 +25,7 @@ export interface IDefinedNamesService {
25
25
  getValueByName(unitId: string, name: string): Nullable<IDefinedNamesServiceParam>;
26
26
  getValueById(unitId: string, id: string): Nullable<IDefinedNamesServiceParam>;
27
27
  removeDefinedName(unitId: string, name: string): void;
28
+ removeUnitDefinedName(unitId: string): void;
28
29
  hasDefinedName(unitId: string): boolean;
29
30
  setCurrentRange(range: IUnitRange): void;
30
31
  getCurrentRange(): IUnitRange;
@@ -52,6 +53,7 @@ export declare class DefinedNamesService extends Disposable implements IDefinedN
52
53
  registerDefinedNames(unitId: string, params: IDefinedNameMapItem): void;
53
54
  registerDefinedName(unitId: string, param: IDefinedNamesServiceParam): void;
54
55
  removeDefinedName(unitId: string, id: string): void;
56
+ removeUnitDefinedName(unitId: string): void;
55
57
  getDefinedNameMap(unitId: string): IDefinedNameMapItem;
56
58
  getValueByName(unitId: string, name: string): IDefinedNamesServiceParam | null;
57
59
  getValueById(unitId: string, id: string): IDefinedNamesServiceParam;
@@ -0,0 +1,74 @@
1
+ import { FormulaDependencyTreeCache, FormulaDependencyTree } from '../engine/dependency/dependency-tree';
2
+ import { Nullable, Disposable, ObjectMatrix } from '@univerjs/core';
3
+
4
+ export interface IOtherFormulaDependencyParam {
5
+ [unitId: string]: Nullable<{
6
+ [sheetId: string]: {
7
+ [formulaId: string]: Nullable<FormulaDependencyTree>;
8
+ };
9
+ }>;
10
+ }
11
+ export interface IFormulaDependencyParam {
12
+ [unitId: string]: Nullable<{
13
+ [sheetId: string]: ObjectMatrix<Nullable<FormulaDependencyTree>>;
14
+ }>;
15
+ }
16
+ export interface IDependencyManagerService {
17
+ dispose(): void;
18
+ getAllTree(): FormulaDependencyTree[];
19
+ buildDependencyTree(shouldBeBuildTrees: FormulaDependencyTree[] | FormulaDependencyTreeCache): FormulaDependencyTree[];
20
+ clearDependencyForTree(shouldBeClearTree: Nullable<FormulaDependencyTree>): void;
21
+ reset(): void;
22
+ addOtherFormulaDependency(unitId: string, sheetId: string, formulaId: string, dependencyTree: FormulaDependencyTree): void;
23
+ removeOtherFormulaDependency(unitId: string, sheetId: string, formulaId: string[]): void;
24
+ hasOtherFormulaDependency(unitId: string, sheetId: string, formulaId: string): boolean;
25
+ addFeatureFormulaDependency(featureId: string, dependencyTree: FormulaDependencyTree): void;
26
+ removeFeatureFormulaDependency(featureId: string): void;
27
+ hasFeatureFormulaDependency(unitId: string, sheetId: string, featureId: string): boolean;
28
+ addFormulaDependency(unitId: string, sheetId: string, row: number, column: number, dependencyTree: FormulaDependencyTree): void;
29
+ removeFormulaDependency(unitId: string, sheetId: string, row: number, column: number): void;
30
+ hasFormulaDependency(unitId: string, sheetId: string, row: number, column: number): boolean;
31
+ clearFormulaDependency(unitId: string, sheetId: string): void;
32
+ }
33
+ /**
34
+ * Passively marked as dirty, register the reference and execution actions of the feature plugin.
35
+ * After execution, a dirty area and calculated data will be returned,
36
+ * causing the formula to be marked dirty again,
37
+ * thereby completing the calculation of the entire dependency tree.
38
+ */
39
+ export declare class DependencyManagerService extends Disposable implements IDependencyManagerService {
40
+ private _otherFormulaData;
41
+ private _featureFormulaData;
42
+ private _formulaData;
43
+ dispose(): void;
44
+ /**
45
+ * Get all FormulaDependencyTree from _otherFormulaData, _featureFormulaData, _formulaData
46
+ * return FormulaDependencyTree[]
47
+ */
48
+ getAllTree(): FormulaDependencyTree[];
49
+ buildDependencyTree(shouldBeBuildTrees: FormulaDependencyTree[] | FormulaDependencyTreeCache): FormulaDependencyTree[];
50
+ /**
51
+ * Build the dependency relationship between the trees.
52
+ * @param allTrees all FormulaDependencyTree
53
+ * @param shouldBeBuildTrees FormulaDependencyTree[] | FormulaDependencyTreeCache
54
+ */
55
+ private _buildDependencyTree;
56
+ /**
57
+ * Clear the dependency relationship of the tree.
58
+ * establish the relationship between the parent and the child.
59
+ * @param shouldBeClearTree
60
+ */
61
+ clearDependencyForTree(shouldBeClearTree: Nullable<FormulaDependencyTree>): void;
62
+ reset(): void;
63
+ addOtherFormulaDependency(unitId: string, sheetId: string, formulaId: string, dependencyTree: FormulaDependencyTree): void;
64
+ removeOtherFormulaDependency(unitId: string, sheetId: string, formulaIds: string[]): void;
65
+ hasOtherFormulaDependency(unitId: string, sheetId: string, formulaId: string): boolean;
66
+ addFeatureFormulaDependency(featureId: string, dependencyTree: FormulaDependencyTree): void;
67
+ removeFeatureFormulaDependency(featureId: string): void;
68
+ hasFeatureFormulaDependency(featureId: string): boolean;
69
+ addFormulaDependency(unitId: string, sheetId: string, row: number, column: number, dependencyTree: FormulaDependencyTree): void;
70
+ removeFormulaDependency(unitId: string, sheetId: string, row: number, column: number): void;
71
+ clearFormulaDependency(unitId: string, sheetId: string): void;
72
+ hasFormulaDependency(unitId: string, sheetId: string, row: number, column: number): boolean;
73
+ }
74
+ export declare const IDependencyManagerService: import('@wendellhu/redi').IdentifierDecorator<DependencyManagerService>;
@@ -1,7 +1,7 @@
1
1
  import { IFormulaCurrentConfigService } from './current-data.service';
2
2
  import { FunctionVariantType } from '../engine/reference-object/base-reference-object';
3
3
  import { BaseAstNode } from '../engine/ast-node/base-ast-node';
4
- import { IArrayFormulaRangeType, IFeatureDirtyRangeType, INumfmtItemMap, IRuntimeOtherUnitDataType, IRuntimeUnitDataType } from '../basics/common';
4
+ import { IArrayFormulaRangeType, IFeatureDirtyRangeType, IRuntimeOtherUnitDataType, IRuntimeUnitDataType } from '../basics/common';
5
5
  import { Nullable, Disposable } from '@univerjs/core';
6
6
 
7
7
  /**
@@ -36,7 +36,6 @@ export interface IAllRuntimeData {
36
36
  functionsExecutedState: FormulaExecutedStateType;
37
37
  arrayFormulaCellData: IRuntimeUnitDataType;
38
38
  clearArrayFormulaCellData: IRuntimeUnitDataType;
39
- numfmtItemMap: INumfmtItemMap;
40
39
  runtimeFeatureRange: {
41
40
  [featureId: string]: IFeatureDirtyRangeType;
42
41
  };
@@ -112,7 +111,6 @@ export declare class FormulaRuntimeService extends Disposable implements IFormul
112
111
  private _unitArrayFormulaRange;
113
112
  private _runtimeArrayFormulaCellData;
114
113
  private _runtimeClearArrayFormulaCellData;
115
- private _numfmtItemMap;
116
114
  private _runtimeFeatureRange;
117
115
  private _runtimeFeatureCellData;
118
116
  private _functionsExecutedState;
@@ -158,7 +156,6 @@ export declare class FormulaRuntimeService extends Disposable implements IFormul
158
156
  setRuntimeData(functionVariant: FunctionVariantType): void;
159
157
  getUnitData(): IRuntimeUnitDataType;
160
158
  getUnitArrayFormula(): IArrayFormulaRangeType;
161
- getNumfmtItemMap(): INumfmtItemMap;
162
159
  getRuntimeOtherData(): IRuntimeOtherUnitDataType;
163
160
  getRuntimeArrayFormulaCellData(): IRuntimeUnitDataType;
164
161
  getRuntimeClearArrayFormulaCellData(): IRuntimeUnitDataType;
@@ -172,7 +169,6 @@ export declare class FormulaRuntimeService extends Disposable implements IFormul
172
169
  setRuntimeFeatureCellData(featureId: string, featureData: IRuntimeUnitDataType): void;
173
170
  getAllRuntimeData(): IAllRuntimeData;
174
171
  getRuntimeState(): IExecutionInProgressParams;
175
- private _objectValueToCellValue;
176
172
  private _checkIfArrayFormulaRangeHasData;
177
173
  private _isInArrayFormulaRange;
178
174
  private _checkIfArrayFormulaExceeded;