@univerjs/engine-formula 0.1.9 → 0.1.11

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 (160) hide show
  1. package/lib/cjs/index.js +1 -1
  2. package/lib/es/index.js +7758 -7333
  3. package/lib/types/basics/function.d.ts +16 -16
  4. package/lib/types/commands/mutations/set-array-formula-data.mutation.d.ts +1 -1
  5. package/lib/types/commands/mutations/set-feature-calculation.mutation.d.ts +1 -1
  6. package/lib/types/commands/mutations/set-formula-calculation.mutation.d.ts +2 -2
  7. package/lib/types/commands/mutations/set-formula-data.mutation.d.ts +1 -1
  8. package/lib/types/commands/mutations/set-other-formula.mutation.d.ts +1 -1
  9. package/lib/types/commands/mutations/set-super-table.mutation.d.ts +2 -2
  10. package/lib/types/controller/calculate.controller.d.ts +2 -2
  11. package/lib/types/controller/formula.controller.d.ts +4 -4
  12. package/lib/types/controller/register-function.controller.d.ts +2 -2
  13. package/lib/types/controller/set-defined-name.controller.d.ts +1 -1
  14. package/lib/types/controller/set-dependency.controller.d.ts +1 -1
  15. package/lib/types/controller/set-feature-calculation.controller.d.ts +1 -1
  16. package/lib/types/controller/set-other-formula.controller.d.ts +2 -2
  17. package/lib/types/controller/set-super-table.controller.d.ts +1 -1
  18. package/lib/types/engine/analysis/__tests__/create-command-test-bed.d.ts +2 -2
  19. package/lib/types/engine/analysis/lexer-node.d.ts +1 -1
  20. package/lib/types/engine/analysis/lexer-tree-builder.d.ts +4 -4
  21. package/lib/types/engine/analysis/lexer.d.ts +4 -4
  22. package/lib/types/engine/analysis/parser.d.ts +13 -13
  23. package/lib/types/engine/ast-node/ast-root-node.d.ts +3 -3
  24. package/lib/types/engine/ast-node/base-ast-node-factory.d.ts +4 -4
  25. package/lib/types/engine/ast-node/base-ast-node.d.ts +5 -5
  26. package/lib/types/engine/ast-node/function-node.d.ts +10 -10
  27. package/lib/types/engine/ast-node/lambda-node.d.ts +5 -5
  28. package/lib/types/engine/ast-node/lambda-parameter-node.d.ts +3 -3
  29. package/lib/types/engine/ast-node/null-node.d.ts +1 -1
  30. package/lib/types/engine/ast-node/operator-node.d.ts +5 -5
  31. package/lib/types/engine/ast-node/prefix-node.d.ts +7 -7
  32. package/lib/types/engine/ast-node/reference-node.d.ts +8 -8
  33. package/lib/types/engine/ast-node/suffix-node.d.ts +6 -6
  34. package/lib/types/engine/ast-node/union-node.d.ts +4 -4
  35. package/lib/types/engine/ast-node/value-node.d.ts +3 -3
  36. package/lib/types/engine/dependency/dependency-tree.d.ts +2 -2
  37. package/lib/types/engine/dependency/formula-dependency.d.ts +10 -12
  38. package/lib/types/engine/interpreter/interpreter.d.ts +4 -5
  39. package/lib/types/engine/reference-object/base-reference-object.d.ts +6 -6
  40. package/lib/types/engine/reference-object/cell-reference-object.d.ts +3 -3
  41. package/lib/types/engine/reference-object/column-reference-object.d.ts +1 -1
  42. package/lib/types/engine/reference-object/range-reference-object.d.ts +1 -1
  43. package/lib/types/engine/reference-object/row-reference-object.d.ts +1 -1
  44. package/lib/types/engine/reference-object/table-reference-object.d.ts +1 -1
  45. package/lib/types/engine/utils/array-object.d.ts +1 -1
  46. package/lib/types/engine/utils/ast-node-tool.d.ts +1 -1
  47. package/lib/types/engine/utils/node-type.d.ts +3 -3
  48. package/lib/types/engine/utils/numfmt-kit.d.ts +63 -0
  49. package/lib/types/engine/utils/object-compare.d.ts +1 -1
  50. package/lib/types/engine/utils/prefixHandler.d.ts +3 -3
  51. package/lib/types/engine/utils/value-object.d.ts +3 -3
  52. package/lib/types/engine/value-object/array-value-object.d.ts +4 -4
  53. package/lib/types/engine/value-object/base-value-object.d.ts +5 -5
  54. package/lib/types/engine/value-object/cube-value-object.d.ts +2 -2
  55. package/lib/types/engine/value-object/lambda-value-object.d.ts +3 -3
  56. package/lib/types/engine/value-object/primitive-object.d.ts +3 -3
  57. package/lib/types/functions/__tests__/create-function-test-bed.d.ts +3 -3
  58. package/lib/types/functions/base-function.d.ts +15 -7
  59. package/lib/types/functions/compatibility/function-map.d.ts +1 -1
  60. package/lib/types/functions/date/date/index.d.ts +3 -1
  61. package/lib/types/functions/date/day/index.d.ts +3 -1
  62. package/lib/types/functions/date/edate/index.d.ts +3 -1
  63. package/lib/types/functions/date/function-map.d.ts +1 -1
  64. package/lib/types/functions/date/month/index.d.ts +3 -1
  65. package/lib/types/functions/date/today/index.d.ts +5 -3
  66. package/lib/types/functions/date/year/index.d.ts +3 -1
  67. package/lib/types/functions/information/function-map.d.ts +1 -1
  68. package/lib/types/functions/information/isblank/index.d.ts +3 -1
  69. package/lib/types/functions/information/iserr/index.d.ts +3 -1
  70. package/lib/types/functions/information/iserror/index.d.ts +3 -1
  71. package/lib/types/functions/information/iseven/iseven.d.ts +4 -2
  72. package/lib/types/functions/information/islogical/index.d.ts +3 -1
  73. package/lib/types/functions/information/isna/index.d.ts +3 -1
  74. package/lib/types/functions/information/isnontext/index.d.ts +3 -1
  75. package/lib/types/functions/information/isnumber/index.d.ts +3 -1
  76. package/lib/types/functions/information/isodd/__tests__/isodd.spec.d.ts +16 -0
  77. package/lib/types/functions/information/isodd/isodd.d.ts +4 -2
  78. package/lib/types/functions/information/isref/index.d.ts +5 -3
  79. package/lib/types/functions/information/istext/index.d.ts +3 -1
  80. package/lib/types/functions/logical/and/index.d.ts +3 -1
  81. package/lib/types/functions/logical/function-map.d.ts +3 -3
  82. package/lib/types/functions/logical/if/index.d.ts +3 -1
  83. package/lib/types/functions/logical/iferror/index.d.ts +4 -2
  84. package/lib/types/functions/logical/lambda/index.d.ts +3 -1
  85. package/lib/types/functions/logical/makearray/index.d.ts +4 -2
  86. package/lib/types/functions/logical/or/index.d.ts +3 -1
  87. package/lib/types/functions/lookup/address/index.d.ts +3 -1
  88. package/lib/types/functions/lookup/column/index.d.ts +4 -2
  89. package/lib/types/functions/lookup/columns/index.d.ts +4 -2
  90. package/lib/types/functions/lookup/function-map.d.ts +10 -10
  91. package/lib/types/functions/lookup/hlookup/index.d.ts +3 -1
  92. package/lib/types/functions/lookup/index/index.d.ts +6 -2
  93. package/lib/types/functions/lookup/indirect/index.d.ts +4 -2
  94. package/lib/types/functions/lookup/lookup/index.d.ts +4 -2
  95. package/lib/types/functions/lookup/match/index.d.ts +4 -2
  96. package/lib/types/functions/lookup/offset/index.d.ts +3 -1
  97. package/lib/types/functions/lookup/row/index.d.ts +4 -2
  98. package/lib/types/functions/lookup/rows/index.d.ts +4 -2
  99. package/lib/types/functions/lookup/vlookup/index.d.ts +4 -2
  100. package/lib/types/functions/lookup/xlookup/index.d.ts +4 -2
  101. package/lib/types/functions/lookup/xmatch/index.d.ts +4 -2
  102. package/lib/types/functions/math/abs/index.d.ts +3 -1
  103. package/lib/types/functions/math/acos/index.d.ts +3 -1
  104. package/lib/types/functions/math/acosh/index.d.ts +3 -1
  105. package/lib/types/functions/math/acot/index.d.ts +3 -1
  106. package/lib/types/functions/math/function-map.d.ts +3 -3
  107. package/lib/types/functions/math/mod/index.d.ts +3 -1
  108. package/lib/types/functions/math/power/index.d.ts +3 -1
  109. package/lib/types/functions/math/product/index.d.ts +3 -1
  110. package/lib/types/functions/math/subtotal/index.d.ts +4 -2
  111. package/lib/types/functions/math/sum/index.d.ts +3 -1
  112. package/lib/types/functions/math/sumif/index.d.ts +3 -1
  113. package/lib/types/functions/math/sumifs/index.d.ts +4 -2
  114. package/lib/types/functions/meta/compare/index.d.ts +4 -2
  115. package/lib/types/functions/meta/cube/index.d.ts +3 -1
  116. package/lib/types/functions/meta/divided/index.d.ts +3 -1
  117. package/lib/types/functions/meta/function-map.d.ts +1 -1
  118. package/lib/types/functions/meta/minus/index.d.ts +3 -1
  119. package/lib/types/functions/meta/multiply/index.d.ts +3 -1
  120. package/lib/types/functions/meta/plus/index.d.ts +3 -1
  121. package/lib/types/functions/statistical/average/index.d.ts +3 -1
  122. package/lib/types/functions/statistical/count/index.d.ts +3 -1
  123. package/lib/types/functions/statistical/counta/index.d.ts +3 -1
  124. package/lib/types/functions/statistical/function-map.d.ts +1 -1
  125. package/lib/types/functions/statistical/max/index.d.ts +3 -1
  126. package/lib/types/functions/statistical/maxifs/index.d.ts +4 -2
  127. package/lib/types/functions/statistical/min/index.d.ts +3 -1
  128. package/lib/types/functions/statistical/stdev-p/index.d.ts +3 -1
  129. package/lib/types/functions/statistical/stdev-s/index.d.ts +3 -1
  130. package/lib/types/functions/statistical/stdeva/index.d.ts +3 -1
  131. package/lib/types/functions/statistical/stdevpa/index.d.ts +3 -1
  132. package/lib/types/functions/statistical/var-p/index.d.ts +3 -1
  133. package/lib/types/functions/statistical/var-s/index.d.ts +3 -1
  134. package/lib/types/functions/statistical/vara/index.d.ts +3 -1
  135. package/lib/types/functions/statistical/varpa/index.d.ts +3 -1
  136. package/lib/types/functions/text/concatenate/index.d.ts +3 -1
  137. package/lib/types/functions/text/function-map.d.ts +1 -1
  138. package/lib/types/functions/text/len/index.d.ts +3 -1
  139. package/lib/types/functions/text/lenb/index.d.ts +3 -1
  140. package/lib/types/functions/text/lower/index.d.ts +3 -1
  141. package/lib/types/functions/text/text/index.d.ts +3 -1
  142. package/lib/types/index.d.ts +1 -0
  143. package/lib/types/models/__tests__/create-command-test-bed.d.ts +1 -1
  144. package/lib/types/models/formula-data.model.d.ts +9 -8
  145. package/lib/types/models/utils/formula-data-util.d.ts +1 -1
  146. package/lib/types/plugin.d.ts +3 -3
  147. package/lib/types/services/active-dirty-manager.service.d.ts +1 -1
  148. package/lib/types/services/calculate-formula.service.d.ts +8 -9
  149. package/lib/types/services/current-data.service.d.ts +1 -1
  150. package/lib/types/services/defined-names.service.d.ts +1 -1
  151. package/lib/types/services/dependency-manager.service.d.ts +1 -1
  152. package/lib/types/services/feature-calculation-manager.service.d.ts +2 -2
  153. package/lib/types/services/function.service.d.ts +5 -4
  154. package/lib/types/services/other-formula-manager.service.d.ts +1 -1
  155. package/lib/types/services/runtime.service.d.ts +4 -4
  156. package/lib/types/services/super-table.service.d.ts +1 -1
  157. package/lib/umd/index.js +1 -1
  158. package/package.json +8 -8
  159. /package/lib/types/{functions/information/iseven/iseven.spec.d.ts → engine/utils/__tests__/numfmt-kit.spec.d.ts} +0 -0
  160. /package/lib/types/functions/information/{isodd/isodd.spec.d.ts → iseven/__tests__/iseven.spec.d.ts} +0 -0
@@ -1,20 +1,20 @@
1
- import { FUNCTION_NAMES_WEB } from '../functions/web/function-names';
2
- import { FUNCTION_NAMES_UNIVER } from '../functions/univer/function-names';
3
- import { FUNCTION_NAMES_TEXT } from '../functions/text/function-names';
4
- import { FUNCTION_NAMES_STATISTICAL } from '../functions/statistical/function-names';
5
- import { FUNCTION_NAMES_META } from '../functions/meta/function-names';
6
- import { FUNCTION_NAMES_MATH } from '../functions/math/function-names';
7
- import { FUNCTION_NAMES_LOOKUP } from '../functions/lookup/function-names';
8
- import { FUNCTION_NAMES_LOGICAL } from '../functions/logical/function-names';
9
- import { FUNCTION_NAMES_INFORMATION } from '../functions/information/function-names';
10
- import { FUNCTION_NAMES_FINANCIAL } from '../functions/financial/function-names';
11
- import { FUNCTION_NAMES_ENGINEERING } from '../functions/engineering/function-names';
12
- import { FUNCTION_NAMES_DATE } from '../functions/date/function-names';
13
- import { FUNCTION_NAMES_DATABASE } from '../functions/database/function-names';
14
- import { FUNCTION_NAMES_CUBE } from '../functions/cube/function-names';
15
- import { FUNCTION_NAMES_COMPATIBILITY } from '../functions/compatibility/function-names';
16
- import { FUNCTION_NAMES_ARRAY } from '../functions/array/function-names';
17
1
  import { BooleanNumber } from '@univerjs/core';
2
+ import { FUNCTION_NAMES_ARRAY } from '../functions/array/function-names';
3
+ import { FUNCTION_NAMES_COMPATIBILITY } from '../functions/compatibility/function-names';
4
+ import { FUNCTION_NAMES_CUBE } from '../functions/cube/function-names';
5
+ import { FUNCTION_NAMES_DATABASE } from '../functions/database/function-names';
6
+ import { FUNCTION_NAMES_DATE } from '../functions/date/function-names';
7
+ import { FUNCTION_NAMES_ENGINEERING } from '../functions/engineering/function-names';
8
+ import { FUNCTION_NAMES_FINANCIAL } from '../functions/financial/function-names';
9
+ import { FUNCTION_NAMES_INFORMATION } from '../functions/information/function-names';
10
+ import { FUNCTION_NAMES_LOGICAL } from '../functions/logical/function-names';
11
+ import { FUNCTION_NAMES_LOOKUP } from '../functions/lookup/function-names';
12
+ import { FUNCTION_NAMES_MATH } from '../functions/math/function-names';
13
+ import { FUNCTION_NAMES_META } from '../functions/meta/function-names';
14
+ import { FUNCTION_NAMES_STATISTICAL } from '../functions/statistical/function-names';
15
+ import { FUNCTION_NAMES_TEXT } from '../functions/text/function-names';
16
+ import { FUNCTION_NAMES_UNIVER } from '../functions/univer/function-names';
17
+ import { FUNCTION_NAMES_WEB } from '../functions/web/function-names';
18
18
 
19
19
  /**
20
20
  * Function type, refer to https://support.microsoft.com/en-us/office/excel-functions-by-category-5f91f4e9-7b42-46d2-9bd1-63f26a86c0eb
@@ -1,5 +1,5 @@
1
- import { IArrayFormulaRangeType, IArrayFormulaUnitCellType } from '../../basics/common';
2
1
  import { IMutation } from '@univerjs/core';
2
+ import { IArrayFormulaRangeType, IArrayFormulaUnitCellType } from '../../basics/common';
3
3
 
4
4
  export interface ISetArrayFormulaDataMutationParams {
5
5
  arrayFormulaRange: IArrayFormulaRangeType;
@@ -1,5 +1,5 @@
1
- import { IFeatureCalculationManagerParam } from '../../services/feature-calculation-manager.service';
2
1
  import { IMutation } from '@univerjs/core';
2
+ import { IFeatureCalculationManagerParam } from '../../services/feature-calculation-manager.service';
3
3
 
4
4
  export interface ISetFeatureCalculationMutation {
5
5
  featureId: string;
@@ -1,6 +1,6 @@
1
- import { FormulaExecutedStateType, IExecutionInProgressParams } from '../../services/runtime.service';
2
- import { IDirtyUnitFeatureMap, IDirtyUnitOtherFormulaMap, IDirtyUnitSheetDefinedNameMap, IDirtyUnitSheetNameMap, IRuntimeOtherUnitDataType, IRuntimeUnitDataPrimitiveType } from '../../basics/common';
3
1
  import { IExecutionOptions, IMutation, IUnitRange, Nullable } from '@univerjs/core';
2
+ import { IDirtyUnitFeatureMap, IDirtyUnitOtherFormulaMap, IDirtyUnitSheetDefinedNameMap, IDirtyUnitSheetNameMap, IRuntimeOtherUnitDataType, IRuntimeUnitDataPrimitiveType } from '../../basics/common';
3
+ import { FormulaExecutedStateType, IExecutionInProgressParams } from '../../services/runtime.service';
4
4
 
5
5
  export interface ISetFormulaCalculationStartMutation {
6
6
  dirtyRanges: IUnitRange[];
@@ -1,5 +1,5 @@
1
- import { IFormulaData } from '../../basics/common';
2
1
  import { IMutation } from '@univerjs/core';
2
+ import { IFormulaData } from '../../basics/common';
3
3
 
4
4
  export interface ISetFormulaDataMutationParams {
5
5
  formulaData: IFormulaData;
@@ -1,5 +1,5 @@
1
- import { IFormulaDataItem } from '../../basics/common';
2
1
  import { IMutation } from '@univerjs/core';
2
+ import { IFormulaDataItem } from '../../basics/common';
3
3
 
4
4
  export interface ISetOtherFormulaMutationParams {
5
5
  unitId: string;
@@ -1,6 +1,6 @@
1
- import { ISuperTableOptionParam } from '../../services/super-table.service';
2
- import { ISuperTable } from '../../basics/common';
3
1
  import { IMutation } from '@univerjs/core';
2
+ import { ISuperTable } from '../../basics/common';
3
+ import { ISuperTableOptionParam } from '../../services/super-table.service';
4
4
 
5
5
  export interface ISetSuperTableMutationSearchParam {
6
6
  unitId: string;
@@ -1,6 +1,6 @@
1
- import { CalculateFormulaService } from '../services/calculate-formula.service';
2
- import { FormulaDataModel } from '../models/formula-data.model';
3
1
  import { Disposable, ICommandService, IUniverInstanceService } from '@univerjs/core';
2
+ import { FormulaDataModel } from '../models/formula-data.model';
3
+ import { CalculateFormulaService } from '../services/calculate-formula.service';
4
4
 
5
5
  export declare class CalculateController extends Disposable {
6
6
  private readonly _commandService;
@@ -1,8 +1,8 @@
1
- import { IFunctionService } from '../services/function.service';
2
- import { BaseFunction } from '../functions/base-function';
3
- import { IFunctionNames } from '../basics/function';
4
- import { Ctor, Injector } from '@wendellhu/redi';
5
1
  import { Disposable, ICommandService } from '@univerjs/core';
2
+ import { Ctor, Injector } from '@wendellhu/redi';
3
+ import { IFunctionNames } from '../basics/function';
4
+ import { BaseFunction } from '../functions/base-function';
5
+ import { IFunctionService } from '../services/function.service';
6
6
 
7
7
  export declare class FormulaController extends Disposable {
8
8
  private _function;
@@ -1,6 +1,6 @@
1
- import { IFunctionService } from '../services/function.service';
2
- import { FormulaDataModel } from '../models/formula-data.model';
3
1
  import { Disposable, ICommandService } from '@univerjs/core';
2
+ import { FormulaDataModel } from '../models/formula-data.model';
3
+ import { IFunctionService } from '../services/function.service';
4
4
 
5
5
  export declare class RegisterFunctionController extends Disposable {
6
6
  private readonly _commandService;
@@ -1,5 +1,5 @@
1
- import { IDefinedNamesService } from '../services/defined-names.service';
2
1
  import { Disposable, ICommandService } from '@univerjs/core';
2
+ import { IDefinedNamesService } from '../services/defined-names.service';
3
3
 
4
4
  export declare class SetDefinedNameController extends Disposable {
5
5
  private readonly _commandService;
@@ -1,5 +1,5 @@
1
- import { IDependencyManagerService } from '../services/dependency-manager.service';
2
1
  import { Disposable, ICommandService } from '@univerjs/core';
2
+ import { IDependencyManagerService } from '../services/dependency-manager.service';
3
3
 
4
4
  export declare class SetDependencyController extends Disposable {
5
5
  private readonly _commandService;
@@ -1,5 +1,5 @@
1
- import { IFeatureCalculationManagerService } from '../services/feature-calculation-manager.service';
2
1
  import { Disposable, ICommandService } from '@univerjs/core';
2
+ import { IFeatureCalculationManagerService } from '../services/feature-calculation-manager.service';
3
3
 
4
4
  export declare class SetFeatureCalculationController extends Disposable {
5
5
  private readonly _commandService;
@@ -1,6 +1,6 @@
1
- import { IDependencyManagerService } from '../services/dependency-manager.service';
2
- import { IOtherFormulaManagerService } from '../services/other-formula-manager.service';
3
1
  import { Disposable, ICommandService } from '@univerjs/core';
2
+ import { IOtherFormulaManagerService } from '../services/other-formula-manager.service';
3
+ import { IDependencyManagerService } from '../services/dependency-manager.service';
4
4
 
5
5
  export declare class SetOtherFormulaController extends Disposable {
6
6
  private readonly _commandService;
@@ -1,5 +1,5 @@
1
- import { ISuperTableService } from '../services/super-table.service';
2
1
  import { Disposable, ICommandService } from '@univerjs/core';
2
+ import { ISuperTableService } from '../services/super-table.service';
3
3
 
4
4
  export declare class SetSuperTableController extends Disposable {
5
5
  private readonly _commandService;
@@ -1,6 +1,6 @@
1
- import { ISheetData } from '../../../basics/common';
2
- import { Dependency } from '@wendellhu/redi';
3
1
  import { IWorkbookData, Workbook, Univer } from '@univerjs/core';
2
+ import { Dependency } from '@wendellhu/redi';
3
+ import { ISheetData } from '../../../basics/common';
4
4
 
5
5
  export declare function createCommandTestBed(workbookData?: IWorkbookData, dependencies?: Dependency[]): {
6
6
  univer: Univer;
@@ -1,5 +1,5 @@
1
- import { LambdaPrivacyVarType } from '../ast-node/base-ast-node';
2
1
  import { Nullable, Observable } from '@univerjs/core';
2
+ import { LambdaPrivacyVarType } from '../ast-node/base-ast-node';
3
3
 
4
4
  interface LexerNodeJson {
5
5
  token: string;
@@ -1,8 +1,8 @@
1
- import { LexerNode } from './lexer-node';
2
- import { ISequenceArray, ISequenceNode } from '../utils/sequence';
3
- import { ErrorType } from '../../basics/error-type';
4
- import { FormulaAstLRU } from '../../basics/cache-lru';
5
1
  import { AbsoluteRefType, Disposable } from '@univerjs/core';
2
+ import { FormulaAstLRU } from '../../basics/cache-lru';
3
+ import { ErrorType } from '../../basics/error-type';
4
+ import { ISequenceArray, ISequenceNode } from '../utils/sequence';
5
+ import { LexerNode } from './lexer-node';
6
6
 
7
7
  export declare const FormulaLexerNodeCache: FormulaAstLRU<LexerNode>;
8
8
  export declare const FormulaSequenceNodeCache: FormulaAstLRU<(string | ISequenceNode)[]>;
@@ -1,8 +1,8 @@
1
- import { LexerTreeBuilder } from './lexer-tree-builder';
2
- import { ErrorType } from '../../basics/error-type';
3
- import { IFormulaCurrentConfigService } from '../../services/current-data.service';
4
- import { IDefinedNamesService } from '../../services/defined-names.service';
5
1
  import { Disposable } from '@univerjs/core';
2
+ import { IDefinedNamesService } from '../../services/defined-names.service';
3
+ import { IFormulaCurrentConfigService } from '../../services/current-data.service';
4
+ import { ErrorType } from '../../basics/error-type';
5
+ import { LexerTreeBuilder } from './lexer-tree-builder';
6
6
 
7
7
  export declare class Lexer extends Disposable {
8
8
  private readonly _definedNamesService;
@@ -1,17 +1,17 @@
1
- import { LexerNode } from './lexer-node';
2
- import { ValueNodeFactory } from '../ast-node/value-node';
3
- import { UnionNodeFactory } from '../ast-node/union-node';
4
- import { SuffixNodeFactory } from '../ast-node/suffix-node';
5
- import { ReferenceNodeFactory } from '../ast-node/reference-node';
6
- import { PrefixNodeFactory } from '../ast-node/prefix-node';
7
- import { OperatorNodeFactory } from '../ast-node/operator-node';
8
- import { LambdaParameterNodeFactory } from '../ast-node/lambda-parameter-node';
9
- import { LambdaNodeFactory } from '../ast-node/lambda-node';
10
- import { FunctionNodeFactory } from '../ast-node/function-node';
11
- import { BaseAstNode } from '../ast-node/base-ast-node';
12
- import { AstRootNodeFactory } from '../ast-node/ast-root-node';
13
- import { IFormulaRuntimeService } from '../../services/runtime.service';
14
1
  import { Nullable, Disposable } from '@univerjs/core';
2
+ import { IFormulaRuntimeService } from '../../services/runtime.service';
3
+ import { AstRootNodeFactory } from '../ast-node/ast-root-node';
4
+ import { BaseAstNode } from '../ast-node/base-ast-node';
5
+ import { FunctionNodeFactory } from '../ast-node/function-node';
6
+ import { LambdaNodeFactory } from '../ast-node/lambda-node';
7
+ import { LambdaParameterNodeFactory } from '../ast-node/lambda-parameter-node';
8
+ import { OperatorNodeFactory } from '../ast-node/operator-node';
9
+ import { PrefixNodeFactory } from '../ast-node/prefix-node';
10
+ import { ReferenceNodeFactory } from '../ast-node/reference-node';
11
+ import { SuffixNodeFactory } from '../ast-node/suffix-node';
12
+ import { UnionNodeFactory } from '../ast-node/union-node';
13
+ import { ValueNodeFactory } from '../ast-node/value-node';
14
+ import { LexerNode } from './lexer-node';
15
15
 
16
16
  export declare class AstTreeBuilder extends Disposable {
17
17
  private readonly _runtimeService;
@@ -1,7 +1,7 @@
1
- import { NodeType } from './node-type';
2
- import { BaseAstNodeFactory } from './base-ast-node-factory';
3
- import { BaseAstNode } from './base-ast-node';
4
1
  import { LexerNode } from '../analysis/lexer-node';
2
+ import { BaseAstNode } from './base-ast-node';
3
+ import { BaseAstNodeFactory } from './base-ast-node-factory';
4
+ import { NodeType } from './node-type';
5
5
 
6
6
  export declare class AstRootNode extends BaseAstNode {
7
7
  get nodeType(): NodeType;
@@ -1,10 +1,10 @@
1
- import { BaseAstNode } from './base-ast-node';
2
- import { LexerNode } from '../analysis/lexer-node';
3
1
  import { Nullable, Disposable } from '@univerjs/core';
2
+ import { LexerNode } from '../analysis/lexer-node';
3
+ import { BaseAstNode } from './base-ast-node';
4
4
 
5
5
  export declare const DEFAULT_AST_NODE_FACTORY_Z_INDEX = 100;
6
- export declare class BaseAstNodeFactory extends Disposable {
6
+ export declare abstract class BaseAstNodeFactory extends Disposable {
7
7
  get zIndex(): number;
8
8
  create(param: LexerNode | string, currentRow?: number, currentColumn?: number): BaseAstNode;
9
- checkAndCreateNodeType(param: LexerNode | string): Nullable<BaseAstNode>;
9
+ abstract checkAndCreateNodeType(param: LexerNode | string): Nullable<BaseAstNode>;
10
10
  }
@@ -1,9 +1,9 @@
1
- import { NodeType } from './node-type';
2
- import { ErrorValueObject } from '../value-object/base-value-object';
3
- import { FunctionVariantType } from '../reference-object/base-reference-object';
4
- import { ErrorType } from '../../basics/error-type';
5
- import { AstNodePromiseType } from '../../basics/common';
6
1
  import { Nullable, Disposable } from '@univerjs/core';
2
+ import { AstNodePromiseType } from '../../basics/common';
3
+ import { ErrorType } from '../../basics/error-type';
4
+ import { FunctionVariantType } from '../reference-object/base-reference-object';
5
+ import { ErrorValueObject } from '../value-object/base-value-object';
6
+ import { NodeType } from './node-type';
7
7
 
8
8
  interface IAstNodeNodeJson {
9
9
  token: string;
@@ -1,14 +1,14 @@
1
- import { NodeType } from './node-type';
2
- import { BaseAstNodeFactory } from './base-ast-node-factory';
3
- import { BaseAstNode } from './base-ast-node';
4
- import { IDefinedNamesService } from '../../services/defined-names.service';
5
- import { LexerNode } from '../analysis/lexer-node';
6
- import { IFormulaRuntimeService } from '../../services/runtime.service';
7
- import { IFunctionService } from '../../services/function.service';
8
- import { IFormulaCurrentConfigService } from '../../services/current-data.service';
9
- import { BaseFunction } from '../../functions/base-function';
10
- import { AstNodePromiseType } from '../../basics/common';
11
1
  import { Injector } from '@wendellhu/redi';
2
+ import { AstNodePromiseType } from '../../basics/common';
3
+ import { BaseFunction } from '../../functions/base-function';
4
+ import { IFormulaCurrentConfigService } from '../../services/current-data.service';
5
+ import { IFunctionService } from '../../services/function.service';
6
+ import { IFormulaRuntimeService } from '../../services/runtime.service';
7
+ import { LexerNode } from '../analysis/lexer-node';
8
+ import { IDefinedNamesService } from '../../services/defined-names.service';
9
+ import { BaseAstNode } from './base-ast-node';
10
+ import { BaseAstNodeFactory } from './base-ast-node-factory';
11
+ import { NodeType } from './node-type';
12
12
 
13
13
  export declare class FunctionNode extends BaseAstNode {
14
14
  private _functionExecutor;
@@ -1,9 +1,9 @@
1
- import { NodeType } from './node-type';
2
- import { BaseAstNodeFactory } from './base-ast-node-factory';
3
- import { BaseAstNode } from './base-ast-node';
4
- import { Interpreter } from '../interpreter/interpreter';
5
- import { LexerNode } from '../analysis/lexer-node';
6
1
  import { IFormulaRuntimeService } from '../../services/runtime.service';
2
+ import { LexerNode } from '../analysis/lexer-node';
3
+ import { Interpreter } from '../interpreter/interpreter';
4
+ import { BaseAstNode } from './base-ast-node';
5
+ import { BaseAstNodeFactory } from './base-ast-node-factory';
6
+ import { NodeType } from './node-type';
7
7
 
8
8
  export declare class LambdaNode extends BaseAstNode {
9
9
  private _lambdaId;
@@ -1,7 +1,7 @@
1
- import { NodeType } from './node-type';
2
- import { BaseAstNodeFactory } from './base-ast-node-factory';
3
- import { LambdaPrivacyVarType, BaseAstNode } from './base-ast-node';
4
1
  import { LexerNode } from '../analysis/lexer-node';
2
+ import { LambdaPrivacyVarType, BaseAstNode } from './base-ast-node';
3
+ import { BaseAstNodeFactory } from './base-ast-node-factory';
4
+ import { NodeType } from './node-type';
5
5
 
6
6
  export declare class LambdaParameterNode extends BaseAstNode {
7
7
  private _lambdaParameter;
@@ -1,5 +1,5 @@
1
- import { NodeType } from './node-type';
2
1
  import { BaseAstNode } from './base-ast-node';
2
+ import { NodeType } from './node-type';
3
3
 
4
4
  export declare class NullNode extends BaseAstNode {
5
5
  private _operatorString;
@@ -1,9 +1,9 @@
1
- import { NodeType } from './node-type';
2
- import { BaseAstNodeFactory } from './base-ast-node-factory';
3
- import { BaseAstNode } from './base-ast-node';
4
- import { LexerNode } from '../analysis/lexer-node';
5
- import { IFunctionService } from '../../services/function.service';
6
1
  import { BaseFunction } from '../../functions/base-function';
2
+ import { IFunctionService } from '../../services/function.service';
3
+ import { LexerNode } from '../analysis/lexer-node';
4
+ import { BaseAstNode } from './base-ast-node';
5
+ import { BaseAstNodeFactory } from './base-ast-node-factory';
6
+ import { NodeType } from './node-type';
7
7
 
8
8
  export declare class OperatorNode extends BaseAstNode {
9
9
  private _operatorString;
@@ -1,11 +1,11 @@
1
- import { NodeType } from './node-type';
2
- import { BaseAstNodeFactory } from './base-ast-node-factory';
3
- import { BaseAstNode, ErrorNode } from './base-ast-node';
4
- import { LexerNode } from '../analysis/lexer-node';
5
- import { IFunctionService } from '../../services/function.service';
6
- import { BaseFunction } from '../../functions/base-function';
7
- import { IAccessor, Injector } from '@wendellhu/redi';
8
1
  import { Nullable } from '@univerjs/core';
2
+ import { IAccessor, Injector } from '@wendellhu/redi';
3
+ import { BaseFunction } from '../../functions/base-function';
4
+ import { IFunctionService } from '../../services/function.service';
5
+ import { LexerNode } from '../analysis/lexer-node';
6
+ import { BaseAstNode, ErrorNode } from './base-ast-node';
7
+ import { BaseAstNodeFactory } from './base-ast-node-factory';
8
+ import { NodeType } from './node-type';
9
9
 
10
10
  export declare class PrefixNode extends BaseAstNode {
11
11
  private _accessor;
@@ -1,12 +1,12 @@
1
- import { NodeType } from './node-type';
2
- import { BaseAstNodeFactory } from './base-ast-node-factory';
3
- import { BaseAstNode } from './base-ast-node';
4
- import { IFunctionService } from '../../services/function.service';
5
- import { BaseReferenceObject } from '../reference-object/base-reference-object';
6
- import { LexerNode } from '../analysis/lexer-node';
7
- import { ISuperTableService } from '../../services/super-table.service';
8
- import { IFormulaRuntimeService } from '../../services/runtime.service';
9
1
  import { IAccessor, Injector } from '@wendellhu/redi';
2
+ import { IFormulaRuntimeService } from '../../services/runtime.service';
3
+ import { ISuperTableService } from '../../services/super-table.service';
4
+ import { LexerNode } from '../analysis/lexer-node';
5
+ import { BaseReferenceObject } from '../reference-object/base-reference-object';
6
+ import { IFunctionService } from '../../services/function.service';
7
+ import { BaseAstNode } from './base-ast-node';
8
+ import { BaseAstNodeFactory } from './base-ast-node-factory';
9
+ import { NodeType } from './node-type';
10
10
 
11
11
  export declare class ReferenceNode extends BaseAstNode {
12
12
  private _accessor;
@@ -1,10 +1,10 @@
1
- import { NodeType } from './node-type';
2
- import { BaseAstNodeFactory } from './base-ast-node-factory';
3
- import { BaseAstNode, ErrorNode } from './base-ast-node';
4
- import { LexerNode } from '../analysis/lexer-node';
5
- import { IFunctionService } from '../../services/function.service';
6
- import { BaseFunction } from '../../functions/base-function';
7
1
  import { IAccessor, Injector } from '@wendellhu/redi';
2
+ import { BaseFunction } from '../../functions/base-function';
3
+ import { IFunctionService } from '../../services/function.service';
4
+ import { LexerNode } from '../analysis/lexer-node';
5
+ import { BaseAstNode, ErrorNode } from './base-ast-node';
6
+ import { BaseAstNodeFactory } from './base-ast-node-factory';
7
+ import { NodeType } from './node-type';
8
8
 
9
9
  export declare class SuffixNode extends BaseAstNode {
10
10
  private _accessor;
@@ -1,8 +1,8 @@
1
- import { NodeType } from './node-type';
2
- import { BaseAstNodeFactory } from './base-ast-node-factory';
3
- import { BaseAstNode } from './base-ast-node';
4
- import { LexerNode } from '../analysis/lexer-node';
5
1
  import { IFunctionService } from '../../services/function.service';
2
+ import { LexerNode } from '../analysis/lexer-node';
3
+ import { BaseAstNode } from './base-ast-node';
4
+ import { BaseAstNodeFactory } from './base-ast-node-factory';
5
+ import { NodeType } from './node-type';
6
6
 
7
7
  export declare class UnionNode extends BaseAstNode {
8
8
  private _operatorString;
@@ -1,7 +1,7 @@
1
- import { NodeType } from './node-type';
2
- import { BaseAstNodeFactory } from './base-ast-node-factory';
3
- import { BaseAstNode } from './base-ast-node';
4
1
  import { LexerNode } from '../analysis/lexer-node';
2
+ import { BaseAstNode } from './base-ast-node';
3
+ import { BaseAstNodeFactory } from './base-ast-node-factory';
4
+ import { NodeType } from './node-type';
5
5
 
6
6
  export declare class ValueNode extends BaseAstNode {
7
7
  private _operatorString;
@@ -1,6 +1,6 @@
1
- import { BaseAstNode } from '../ast-node/base-ast-node';
2
- import { IDirtyUnitSheetNameMap, IFeatureDirtyRangeType, IRuntimeUnitDataType, IUnitExcludedCell } from '../../basics/common';
3
1
  import { IRange, IUnitRange, Nullable, Disposable } from '@univerjs/core';
2
+ import { IDirtyUnitSheetNameMap, IFeatureDirtyRangeType, IRuntimeUnitDataType, IUnitExcludedCell } from '../../basics/common';
3
+ import { BaseAstNode } from '../ast-node/base-ast-node';
4
4
 
5
5
  export declare enum FDtreeStateType {
6
6
  DEFAULT = 0,
@@ -1,17 +1,14 @@
1
- import { FormulaDependencyTree } from './dependency-tree';
2
- import { IDependencyManagerService } from '../../services/dependency-manager.service';
3
- import { Interpreter } from '../interpreter/interpreter';
4
- import { AstRootNode } from '../ast-node';
5
- import { AstTreeBuilder } from '../analysis/parser';
6
- import { Lexer } from '../analysis/lexer';
7
- import { IFormulaRuntimeService } from '../../services/runtime.service';
8
- import { IOtherFormulaManagerService } from '../../services/other-formula-manager.service';
9
- import { IFeatureCalculationManagerService } from '../../services/feature-calculation-manager.service';
10
- import { IFormulaCurrentConfigService } from '../../services/current-data.service';
11
- import { FormulaAstLRU } from '../../basics/cache-lru';
12
1
  import { Disposable } from '@univerjs/core';
2
+ import { IFormulaCurrentConfigService } from '../../services/current-data.service';
3
+ import { IFeatureCalculationManagerService } from '../../services/feature-calculation-manager.service';
4
+ import { IOtherFormulaManagerService } from '../../services/other-formula-manager.service';
5
+ import { IFormulaRuntimeService } from '../../services/runtime.service';
6
+ import { Lexer } from '../analysis/lexer';
7
+ import { AstTreeBuilder } from '../analysis/parser';
8
+ import { Interpreter } from '../interpreter/interpreter';
9
+ import { IDependencyManagerService } from '../../services/dependency-manager.service';
10
+ import { FormulaDependencyTree } from './dependency-tree';
13
11
 
14
- export declare const FormulaASTCache: FormulaAstLRU<AstRootNode>;
15
12
  export declare class FormulaDependencyGenerator extends Disposable {
16
13
  private readonly _currentConfigService;
17
14
  private readonly _runtimeService;
@@ -23,6 +20,7 @@ export declare class FormulaDependencyGenerator extends Disposable {
23
20
  private readonly _dependencyManagerService;
24
21
  private _updateRangeFlattenCache;
25
22
  private _dirtyUnitSheetNameMap;
23
+ private _formulaASTCache;
26
24
  constructor(_currentConfigService: IFormulaCurrentConfigService, _runtimeService: IFormulaRuntimeService, _otherFormulaManagerService: IOtherFormulaManagerService, _featureCalculationManagerService: IFeatureCalculationManagerService, _interpreter: Interpreter, _astTreeBuilder: AstTreeBuilder, _lexer: Lexer, _dependencyManagerService: IDependencyManagerService);
27
25
  dispose(): void;
28
26
  generate(): Promise<FormulaDependencyTree[]>;
@@ -1,13 +1,12 @@
1
- import { PreCalculateNodeType } from '../utils/node-type';
2
- import { FunctionVariantType } from '../reference-object/base-reference-object';
3
- import { BaseAstNode } from '../ast-node/base-ast-node';
4
- import { IFormulaRuntimeService } from '../../services/runtime.service';
5
1
  import { Disposable } from '@univerjs/core';
2
+ import { IFormulaRuntimeService } from '../../services/runtime.service';
3
+ import { BaseAstNode } from '../ast-node/base-ast-node';
4
+ import { FunctionVariantType } from '../reference-object/base-reference-object';
5
+ import { PreCalculateNodeType } from '../utils/node-type';
6
6
 
7
7
  export declare class Interpreter extends Disposable {
8
8
  private readonly _runtimeService;
9
9
  constructor(_runtimeService: IFormulaRuntimeService);
10
- dispose(): void;
11
10
  executeAsync(node: BaseAstNode): Promise<FunctionVariantType>;
12
11
  execute(node: BaseAstNode): FunctionVariantType;
13
12
  executePreCalculateNode(node: PreCalculateNodeType): import('@univerjs/core').Nullable<FunctionVariantType>;
@@ -1,10 +1,10 @@
1
- import { NullValueObject, NumberValueObject } from '../value-object/primitive-object';
2
- import { BaseValueObject, ErrorValueObject } from '../value-object/base-value-object';
3
- import { ArrayValueObject } from '../value-object/array-value-object';
4
- import { ObjectClassType } from '../../basics/object-class-type';
5
- import { IRuntimeUnitDataType, IUnitData, IUnitSheetNameMap, IUnitStylesData } from '../../basics/common';
6
- import { FormulaAstLRU } from '../../basics/cache-lru';
7
1
  import { ICellData, IRange, Nullable } from '@univerjs/core';
2
+ import { FormulaAstLRU } from '../../basics/cache-lru';
3
+ import { IRuntimeUnitDataType, IUnitData, IUnitSheetNameMap, IUnitStylesData } from '../../basics/common';
4
+ import { ObjectClassType } from '../../basics/object-class-type';
5
+ import { ArrayValueObject } from '../value-object/array-value-object';
6
+ import { BaseValueObject, ErrorValueObject } from '../value-object/base-value-object';
7
+ import { NullValueObject, NumberValueObject } from '../value-object/primitive-object';
8
8
 
9
9
  export type NodeValueType = BaseValueObject | BaseReferenceObject | AsyncObject | AsyncArrayObject;
10
10
  export type FunctionVariantType = BaseValueObject | BaseReferenceObject;
@@ -1,7 +1,7 @@
1
- import { RangeReferenceObject } from './range-reference-object';
2
- import { BaseReferenceObject } from './base-reference-object';
3
- import { ErrorValueObject } from '../value-object/base-value-object';
4
1
  import { IRange } from '@univerjs/core';
2
+ import { ErrorValueObject } from '../value-object/base-value-object';
3
+ import { BaseReferenceObject } from './base-reference-object';
4
+ import { RangeReferenceObject } from './range-reference-object';
5
5
 
6
6
  export declare class CellReferenceObject extends BaseReferenceObject {
7
7
  constructor(token: string);
@@ -1,5 +1,5 @@
1
- import { BaseReferenceObject } from './base-reference-object';
2
1
  import { ErrorValueObject } from '../value-object/base-value-object';
2
+ import { BaseReferenceObject } from './base-reference-object';
3
3
 
4
4
  export declare class ColumnReferenceObject extends BaseReferenceObject {
5
5
  constructor(token: string);
@@ -1,5 +1,5 @@
1
- import { BaseReferenceObject } from './base-reference-object';
2
1
  import { IRange, Nullable } from '@univerjs/core';
2
+ import { BaseReferenceObject } from './base-reference-object';
3
3
 
4
4
  export declare class RangeReferenceObject extends BaseReferenceObject {
5
5
  constructor(range: IRange, forcedSheetId?: Nullable<string>, forcedUnitId?: string);
@@ -1,5 +1,5 @@
1
- import { BaseReferenceObject } from './base-reference-object';
2
1
  import { ErrorValueObject } from '../value-object/base-value-object';
2
+ import { BaseReferenceObject } from './base-reference-object';
3
3
 
4
4
  export declare class RowReferenceObject extends BaseReferenceObject {
5
5
  constructor(token: string);
@@ -1,5 +1,5 @@
1
- import { BaseReferenceObject } from './base-reference-object';
2
1
  import { ISuperTable, TableOptionType } from '../../basics/common';
2
+ import { BaseReferenceObject } from './base-reference-object';
3
3
 
4
4
  export declare class TableReferenceObject extends BaseReferenceObject {
5
5
  private _tableData;
@@ -1,5 +1,5 @@
1
- import { BaseValueObject } from '../value-object/base-value-object';
2
1
  import { ArrayValueObject } from '../value-object/array-value-object';
2
+ import { BaseValueObject } from '../value-object/base-value-object';
3
3
 
4
4
  export declare function expandArrayValueObject(rowCount: number, columnCount: number, valueObject: BaseValueObject, defaultValue?: BaseValueObject): ArrayValueObject;
5
5
  export declare function createNewArray(result: BaseValueObject[][], rowCount: number, columnCount: number, unitId?: string, sheetId?: string): ArrayValueObject;
@@ -1,4 +1,4 @@
1
- import { BaseAstNode } from '../ast-node/base-ast-node';
2
1
  import { Nullable } from '@univerjs/core';
2
+ import { BaseAstNode } from '../ast-node/base-ast-node';
3
3
 
4
4
  export declare function getAstNodeTopParent(node: BaseAstNode): Nullable<BaseAstNode>;
@@ -1,6 +1,6 @@
1
- import { UnionNode } from '../ast-node/union-node';
2
- import { SuffixNode } from '../ast-node/suffix-node';
3
- import { ReferenceNode } from '../ast-node/reference-node';
4
1
  import { PrefixNode } from '../ast-node/prefix-node';
2
+ import { ReferenceNode } from '../ast-node/reference-node';
3
+ import { SuffixNode } from '../ast-node/suffix-node';
4
+ import { UnionNode } from '../ast-node/union-node';
5
5
 
6
6
  export type PreCalculateNodeType = ReferenceNode | UnionNode | PrefixNode | SuffixNode;