@univerjs/engine-formula 0.1.0-alpha.1

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 (149) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +16 -0
  3. package/lib/cjs/index.js +8809 -0
  4. package/lib/esm/index.js +8800 -0
  5. package/lib/types/analysis/lexer-node.d.ts +49 -0
  6. package/lib/types/analysis/lexer-node.d.ts.map +1 -0
  7. package/lib/types/analysis/lexer.d.ts +84 -0
  8. package/lib/types/analysis/lexer.d.ts.map +1 -0
  9. package/lib/types/analysis/parser.d.ts +41 -0
  10. package/lib/types/analysis/parser.d.ts.map +1 -0
  11. package/lib/types/analysis/un-parser.d.ts +1 -0
  12. package/lib/types/analysis/un-parser.d.ts.map +1 -0
  13. package/lib/types/ast-node/ast-root-node.d.ts +13 -0
  14. package/lib/types/ast-node/ast-root-node.d.ts.map +1 -0
  15. package/lib/types/ast-node/base-ast-node-factory.d.ts +11 -0
  16. package/lib/types/ast-node/base-ast-node-factory.d.ts.map +1 -0
  17. package/lib/types/ast-node/base-ast-node.d.ts +57 -0
  18. package/lib/types/ast-node/base-ast-node.d.ts.map +1 -0
  19. package/lib/types/ast-node/function-node.d.ts +24 -0
  20. package/lib/types/ast-node/function-node.d.ts.map +1 -0
  21. package/lib/types/ast-node/index.d.ts +11 -0
  22. package/lib/types/ast-node/index.d.ts.map +1 -0
  23. package/lib/types/ast-node/lambda-node.d.ts +24 -0
  24. package/lib/types/ast-node/lambda-node.d.ts.map +1 -0
  25. package/lib/types/ast-node/lambda-parameter-node.d.ts +21 -0
  26. package/lib/types/ast-node/lambda-parameter-node.d.ts.map +1 -0
  27. package/lib/types/ast-node/node-type.d.ts +17 -0
  28. package/lib/types/ast-node/node-type.d.ts.map +1 -0
  29. package/lib/types/ast-node/null-node.d.ts +9 -0
  30. package/lib/types/ast-node/null-node.d.ts.map +1 -0
  31. package/lib/types/ast-node/operator-node.d.ts +21 -0
  32. package/lib/types/ast-node/operator-node.d.ts.map +1 -0
  33. package/lib/types/ast-node/prefix-node.d.ts +26 -0
  34. package/lib/types/ast-node/prefix-node.d.ts.map +1 -0
  35. package/lib/types/ast-node/reference-node.d.ts +28 -0
  36. package/lib/types/ast-node/reference-node.d.ts.map +1 -0
  37. package/lib/types/ast-node/suffix-node.d.ts +25 -0
  38. package/lib/types/ast-node/suffix-node.d.ts.map +1 -0
  39. package/lib/types/ast-node/union-node.d.ts +21 -0
  40. package/lib/types/ast-node/union-node.d.ts.map +1 -0
  41. package/lib/types/ast-node/value-node.d.ts +17 -0
  42. package/lib/types/ast-node/value-node.d.ts.map +1 -0
  43. package/lib/types/basics/cache-lru.d.ts +9 -0
  44. package/lib/types/basics/cache-lru.d.ts.map +1 -0
  45. package/lib/types/basics/calculate.d.ts +3 -0
  46. package/lib/types/basics/calculate.d.ts.map +1 -0
  47. package/lib/types/basics/common.d.ts +112 -0
  48. package/lib/types/basics/common.d.ts.map +1 -0
  49. package/lib/types/basics/dirty.d.ts +3 -0
  50. package/lib/types/basics/dirty.d.ts.map +1 -0
  51. package/lib/types/basics/error-type.d.ts +29 -0
  52. package/lib/types/basics/error-type.d.ts.map +1 -0
  53. package/lib/types/basics/function-definition.d.ts +4 -0
  54. package/lib/types/basics/function-definition.d.ts.map +1 -0
  55. package/lib/types/basics/function.d.ts +138 -0
  56. package/lib/types/basics/function.d.ts.map +1 -0
  57. package/lib/types/basics/match-token.d.ts +6 -0
  58. package/lib/types/basics/match-token.d.ts.map +1 -0
  59. package/lib/types/basics/node-type.d.ts +6 -0
  60. package/lib/types/basics/node-type.d.ts.map +1 -0
  61. package/lib/types/basics/object-class-type.d.ts +9 -0
  62. package/lib/types/basics/object-class-type.d.ts.map +1 -0
  63. package/lib/types/basics/regex.d.ts +18 -0
  64. package/lib/types/basics/regex.d.ts.map +1 -0
  65. package/lib/types/basics/sequence.d.ts +28 -0
  66. package/lib/types/basics/sequence.d.ts.map +1 -0
  67. package/lib/types/basics/set-zero-time-out.d.ts +7 -0
  68. package/lib/types/basics/set-zero-time-out.d.ts.map +1 -0
  69. package/lib/types/basics/token-type.d.ts +8 -0
  70. package/lib/types/basics/token-type.d.ts.map +1 -0
  71. package/lib/types/basics/token.d.ts +45 -0
  72. package/lib/types/basics/token.d.ts.map +1 -0
  73. package/lib/types/dependency/dependency-tree.d.ts +49 -0
  74. package/lib/types/dependency/dependency-tree.d.ts.map +1 -0
  75. package/lib/types/dependency/formula-dependency.d.ts +67 -0
  76. package/lib/types/dependency/formula-dependency.d.ts.map +1 -0
  77. package/lib/types/functions/average.d.ts +6 -0
  78. package/lib/types/functions/average.d.ts.map +1 -0
  79. package/lib/types/functions/base-function.d.ts +14 -0
  80. package/lib/types/functions/base-function.d.ts.map +1 -0
  81. package/lib/types/functions/concatenate.d.ts +7 -0
  82. package/lib/types/functions/concatenate.d.ts.map +1 -0
  83. package/lib/types/functions/count.d.ts +7 -0
  84. package/lib/types/functions/count.d.ts.map +1 -0
  85. package/lib/types/functions/index.d.ts +16 -0
  86. package/lib/types/functions/index.d.ts.map +1 -0
  87. package/lib/types/functions/indirect.d.ts +7 -0
  88. package/lib/types/functions/indirect.d.ts.map +1 -0
  89. package/lib/types/functions/max.d.ts +8 -0
  90. package/lib/types/functions/max.d.ts.map +1 -0
  91. package/lib/types/functions/meta/compare.d.ts +9 -0
  92. package/lib/types/functions/meta/compare.d.ts.map +1 -0
  93. package/lib/types/functions/meta/divided.d.ts +6 -0
  94. package/lib/types/functions/meta/divided.d.ts.map +1 -0
  95. package/lib/types/functions/meta/minus.d.ts +6 -0
  96. package/lib/types/functions/meta/minus.d.ts.map +1 -0
  97. package/lib/types/functions/meta/multiply.d.ts +6 -0
  98. package/lib/types/functions/meta/multiply.d.ts.map +1 -0
  99. package/lib/types/functions/meta/plus.d.ts +6 -0
  100. package/lib/types/functions/meta/plus.d.ts.map +1 -0
  101. package/lib/types/functions/meta/union.d.ts +9 -0
  102. package/lib/types/functions/meta/union.d.ts.map +1 -0
  103. package/lib/types/functions/min.d.ts +8 -0
  104. package/lib/types/functions/min.d.ts.map +1 -0
  105. package/lib/types/functions/offset.d.ts +7 -0
  106. package/lib/types/functions/offset.d.ts.map +1 -0
  107. package/lib/types/functions/power.d.ts +7 -0
  108. package/lib/types/functions/power.d.ts.map +1 -0
  109. package/lib/types/functions/sum.d.ts +8 -0
  110. package/lib/types/functions/sum.d.ts.map +1 -0
  111. package/lib/types/index.d.ts +23 -0
  112. package/lib/types/index.d.ts.map +1 -0
  113. package/lib/types/interpreter/interpreter.d.ts +18 -0
  114. package/lib/types/interpreter/interpreter.d.ts.map +1 -0
  115. package/lib/types/other-object/error-value-object.d.ts +12 -0
  116. package/lib/types/other-object/error-value-object.d.ts.map +1 -0
  117. package/lib/types/plugin.d.ts +8 -0
  118. package/lib/types/plugin.d.ts.map +1 -0
  119. package/lib/types/reference-object/base-reference-object.d.ts +95 -0
  120. package/lib/types/reference-object/base-reference-object.d.ts.map +1 -0
  121. package/lib/types/reference-object/cell-reference-object.d.ts +12 -0
  122. package/lib/types/reference-object/cell-reference-object.d.ts.map +1 -0
  123. package/lib/types/reference-object/column-reference-object.d.ts +8 -0
  124. package/lib/types/reference-object/column-reference-object.d.ts.map +1 -0
  125. package/lib/types/reference-object/range-reference-object.d.ts +7 -0
  126. package/lib/types/reference-object/range-reference-object.d.ts.map +1 -0
  127. package/lib/types/reference-object/row-reference-object.d.ts +8 -0
  128. package/lib/types/reference-object/row-reference-object.d.ts.map +1 -0
  129. package/lib/types/reference-object/table-reference-object.d.ts +12 -0
  130. package/lib/types/reference-object/table-reference-object.d.ts.map +1 -0
  131. package/lib/types/services/current-data.service.d.ts +49 -0
  132. package/lib/types/services/current-data.service.d.ts.map +1 -0
  133. package/lib/types/services/defined-names.service.d.ts +13 -0
  134. package/lib/types/services/defined-names.service.d.ts.map +1 -0
  135. package/lib/types/services/formula-engine.service.d.ts +98 -0
  136. package/lib/types/services/formula-engine.service.d.ts.map +1 -0
  137. package/lib/types/services/function.service.d.ts +29 -0
  138. package/lib/types/services/function.service.d.ts.map +1 -0
  139. package/lib/types/services/runtime.service.d.ts +149 -0
  140. package/lib/types/services/runtime.service.d.ts.map +1 -0
  141. package/lib/types/services/super-table.service.d.ts +19 -0
  142. package/lib/types/services/super-table.service.d.ts.map +1 -0
  143. package/lib/types/value-object/array-value-object.d.ts +41 -0
  144. package/lib/types/value-object/array-value-object.d.ts.map +1 -0
  145. package/lib/types/value-object/base-value-object.d.ts +41 -0
  146. package/lib/types/value-object/base-value-object.d.ts.map +1 -0
  147. package/lib/types/value-object/primitive-object.d.ts +67 -0
  148. package/lib/types/value-object/primitive-object.d.ts.map +1 -0
  149. package/package.json +52 -0
@@ -0,0 +1,3 @@
1
+ import { compareToken } from './token';
2
+ export declare function reverseCompareOperator(operator: compareToken): compareToken;
3
+ //# sourceMappingURL=calculate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calculate.d.ts","sourceRoot":"","sources":["../../../src/basics/calculate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,YAAY,GAAG,YAAY,CAuB3E"}
@@ -0,0 +1,112 @@
1
+ import type { BooleanNumber, ICellData, IRange, IUnitRange, Nullable, ObjectMatrix, ObjectMatrixPrimitiveType } from '@univerjs/core';
2
+ export declare const ERROR_VALUE_OBJECT_CLASS_TYPE = "errorValueObject";
3
+ export declare const ASYNC_OBJECT_CLASS_TYPE = "asyncObject";
4
+ export declare const REFERENCE_OBJECT_CLASS_TYPE = "referenceObject";
5
+ export declare const VALUE_OBJECT_CLASS_TYPE = "valueObject";
6
+ export declare enum BooleanValue {
7
+ FALSE = "FALSE",
8
+ TRUE = "TRUE"
9
+ }
10
+ export declare enum AstNodePromiseType {
11
+ SUCCESS = 0,
12
+ ERROR = 1
13
+ }
14
+ export interface ISheetItem {
15
+ cellData: ObjectMatrix<ICellData>;
16
+ rowCount: number;
17
+ columnCount: number;
18
+ }
19
+ export interface ISheetData {
20
+ [sheetId: string]: ISheetItem;
21
+ }
22
+ /**
23
+ * The subset of workbook data needs to be assembled into a new reference object when being passed in,
24
+ * and then input through the FormulaCurrentConfigService.
25
+ */
26
+ export interface IUnitData {
27
+ [unitId: string]: ISheetData;
28
+ }
29
+ export interface IRuntimeUnitDataType {
30
+ [unitId: string]: {
31
+ [sheetId: string]: ObjectMatrix<ICellData>;
32
+ };
33
+ }
34
+ export interface IRuntimeOtherUnitDataType {
35
+ [unitId: string]: {
36
+ [sheetId: string]: {
37
+ [formulaId: string]: ICellData;
38
+ };
39
+ };
40
+ }
41
+ export interface IUnitSheetNameMap {
42
+ [unitId: string]: {
43
+ [sheetName: string]: string;
44
+ };
45
+ }
46
+ export interface IDirtyUnitSheetNameMap {
47
+ [unitId: string]: {
48
+ [sheetId: string]: Nullable<string>;
49
+ };
50
+ }
51
+ export interface IArrayFormulaRangeType {
52
+ [unitId: string]: {
53
+ [sheetId: string]: ObjectMatrixPrimitiveType<IRange>;
54
+ };
55
+ }
56
+ export interface IArrayFormulaUnitCellType {
57
+ [unitId: string]: {
58
+ [sheetId: string]: ObjectMatrixPrimitiveType<ICellData>;
59
+ };
60
+ }
61
+ export interface IFormulaData {
62
+ [unitId: string]: {
63
+ [sheetId: string]: ObjectMatrixPrimitiveType<IFormulaDataItem>;
64
+ };
65
+ }
66
+ export interface IOtherFormulaData {
67
+ [unitId: string]: {
68
+ [subComponentId: string]: {
69
+ [formulaId: string]: IFormulaDataItem;
70
+ };
71
+ };
72
+ }
73
+ /**
74
+ * @f formulaString, the text string of the formula.
75
+ * @si The formula ID can be utilized in scenarios such as copy-pasting and drag-filling to convert formulas into references, eliminating the need for recreating the formulaString.
76
+ */
77
+ export interface IFormulaDataItem {
78
+ f: string;
79
+ x?: number;
80
+ y?: number;
81
+ si?: string;
82
+ }
83
+ export interface ISuperTable {
84
+ sheetId: string;
85
+ hasCustomTitle: BooleanNumber;
86
+ titleMap: Map<string, number>;
87
+ range: IRange;
88
+ }
89
+ export declare enum TableOptionType {
90
+ ALL = "#All",
91
+ DATA = "#Data",
92
+ HEADERS = "#Headers",
93
+ TOTALS = "#Totals"
94
+ }
95
+ export interface IUnitExcludedCell {
96
+ [unitId: string]: {
97
+ [sheetId: string]: ObjectMatrix<boolean>;
98
+ };
99
+ }
100
+ export interface IFormulaDatasetConfig {
101
+ formulaData: IFormulaData;
102
+ arrayFormulaCellData: IArrayFormulaUnitCellType;
103
+ forceCalculate: boolean;
104
+ dirtyRanges: IUnitRange[];
105
+ dirtyNameMap: IDirtyUnitSheetNameMap;
106
+ excludedCell?: IUnitExcludedCell;
107
+ }
108
+ export declare enum ConcatenateType {
109
+ FRONT = 0,
110
+ BACK = 1
111
+ }
112
+ //# sourceMappingURL=common.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/basics/common.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,aAAa,EACb,SAAS,EACT,MAAM,EACN,UAAU,EACV,QAAQ,EACR,YAAY,EACZ,yBAAyB,EAC5B,MAAM,gBAAgB,CAAC;AAExB,eAAO,MAAM,6BAA6B,qBAAqB,CAAC;AAEhE,eAAO,MAAM,uBAAuB,gBAAgB,CAAC;AAErD,eAAO,MAAM,2BAA2B,oBAAoB,CAAC;AAE7D,eAAO,MAAM,uBAAuB,gBAAgB,CAAC;AAErD,oBAAY,YAAY;IACpB,KAAK,UAAU;IACf,IAAI,SAAS;CAChB;AAED,oBAAY,kBAAkB;IAC1B,OAAO,IAAA;IACP,KAAK,IAAA;CACR;AAED,MAAM,WAAW,UAAU;IACvB,QAAQ,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,UAAU;IACvB,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,CAAC;CACjC;AAED;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E,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,CAAA;SAAE,CAAA;KAAE,CAAC;CAC7F;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC7B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,EAAE,CAAC,EAAE,MAAM,CAAC;CAIf;AAED,MAAM,WAAW,WAAW;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,aAAa,CAAC;IAC9B,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,oBAAY,eAAe;IACvB,GAAG,SAAS;IACZ,IAAI,UAAU;IACd,OAAO,aAAa;IACpB,MAAM,YAAY;CACrB;AAED,MAAM,WAAW,iBAAiB;IAC9B,CAAC,MAAM,EAAE,MAAM,GAAG;QAAE,CAAC,OAAO,EAAE,MAAM,GAAG,YAAY,CAAC,OAAO,CAAC,CAAA;KAAE,CAAC;CAClE;AAED,MAAM,WAAW,qBAAqB;IAClC,WAAW,EAAE,YAAY,CAAC;IAC1B,oBAAoB,EAAE,yBAAyB,CAAC;IAChD,cAAc,EAAE,OAAO,CAAC;IACxB,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,YAAY,EAAE,sBAAsB,CAAC;IACrC,YAAY,CAAC,EAAE,iBAAiB,CAAC;CACpC;AAED,oBAAY,eAAe;IACvB,KAAK,IAAA;IACL,IAAI,IAAA;CACP"}
@@ -0,0 +1,3 @@
1
+ import type { IUnitRange } from '@univerjs/core';
2
+ export declare function isInDirtyRange(dirtyRanges: IUnitRange[], unitId: string, sheetId: string, row: number, column: number): boolean;
3
+ //# sourceMappingURL=dirty.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dirty.d.ts","sourceRoot":"","sources":["../../../src/basics/dirty.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD,wBAAgB,cAAc,CAC1B,WAAW,EAAE,UAAU,EAAE,EACzB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,MAAM,WAoBjB"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Possible errors returned by our interpreter.
3
+ * 18.17.3 Error values
4
+ */
5
+ export declare enum ErrorType {
6
+ /** Division by zero. */
7
+ DIV_BY_ZERO = "#DIV/0!",
8
+ /** Function error. */
9
+ NAME = "#NAME!",
10
+ VALUE = "#VALUE!",
11
+ NUM = "#NUM!",
12
+ NA = "#NA!",
13
+ /** Cyclic dependency. */
14
+ CYCLE = "#CYCLE!",
15
+ /** Wrong reference. */
16
+ REF = "#REF!",
17
+ /** Array spill error. */
18
+ SPILL = "#SPILL!",
19
+ /** Calculation error. */
20
+ CALC = "#CALC!",
21
+ /** Generic error */
22
+ ERROR = "#ERROR!",
23
+ /** connected to remote */
24
+ CONNECT = "#GETTING_DATA",
25
+ /** In the case of SUM(B1 C1), */
26
+ NULL = "#NULL!"
27
+ }
28
+ export declare const ERROR_TYPE_SET: Set<string>;
29
+ //# sourceMappingURL=error-type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-type.d.ts","sourceRoot":"","sources":["../../../src/basics/error-type.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,oBAAY,SAAS;IACjB,wBAAwB;IACxB,WAAW,YAAY;IAEvB,sBAAsB;IACtB,IAAI,WAAW;IACf,KAAK,YAAY;IACjB,GAAG,UAAU;IACb,EAAE,SAAS;IAEX,yBAAyB;IACzB,KAAK,YAAY;IAEjB,uBAAuB;IACvB,GAAG,UAAU;IAEb,yBAAyB;IACzB,KAAK,YAAY;IAEjB,yBAAyB;IACzB,IAAI,WAAW;IAEf,oBAAoB;IACpB,KAAK,YAAY;IAEjB,0BAA0B;IAC1B,OAAO,kBAAkB;IAEzB,iCAAiC;IACjC,IAAI,WAAW;CAClB;AAED,eAAO,MAAM,cAAc,aAazB,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { LexerNode } from '../analysis/lexer-node';
2
+ export declare function isFirstChildParameter(lexerNode: LexerNode | string): boolean;
3
+ export declare function isChildRunTimeParameter(lexerNode: LexerNode | string): boolean;
4
+ //# sourceMappingURL=function-definition.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"function-definition.d.ts","sourceRoot":"","sources":["../../../src/basics/function-definition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAGnD,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM,WAKlE;AAED,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM,WAKpE"}
@@ -0,0 +1,138 @@
1
+ import type { BooleanNumber } from '@univerjs/core';
2
+ /**
3
+ * Function type, refer to https://support.microsoft.com/en-us/office/excel-functions-by-category-5f91f4e9-7b42-46d2-9bd1-63f26a86c0eb
4
+ */
5
+ export declare enum FunctionType {
6
+ /**
7
+ * Financial Functions
8
+ */
9
+ Financial = 0,
10
+ /**
11
+ * Date and Time Functions
12
+ */
13
+ Date = 1,
14
+ /**
15
+ * Math and Trigonometry Functions
16
+ */
17
+ Math = 2,
18
+ /**
19
+ * Statistical Functions
20
+ */
21
+ Statistical = 3,
22
+ /**
23
+ * Lookup and Reference Functions
24
+ */
25
+ Lookup = 4,
26
+ /**
27
+ * Database Functions
28
+ */
29
+ Database = 5,
30
+ /**
31
+ * Text Functions
32
+ */
33
+ Text = 6,
34
+ /**
35
+ * Logical Functions
36
+ */
37
+ Logical = 7,
38
+ /**
39
+ * Information Functions
40
+ */
41
+ Information = 8,
42
+ /**
43
+ * Engineering Functions
44
+ */
45
+ Engineering = 9,
46
+ /**
47
+ * Cube Functions
48
+ */
49
+ Cube = 10,
50
+ /**
51
+ * Compatibility Functions
52
+ */
53
+ Compatibility = 11,
54
+ /**
55
+ * Web Functions
56
+ */
57
+ Web = 12,
58
+ /**
59
+ * Array Functions
60
+ */
61
+ Array = 13,
62
+ /**
63
+ * Univer-specific functions
64
+ */
65
+ Univer = 14
66
+ }
67
+ export interface IFunctionParam {
68
+ /**
69
+ * Function name, with internationalization
70
+ */
71
+ name: string;
72
+ /**
73
+ * Detailed description of function, with internationalization
74
+ */
75
+ detail: string;
76
+ /**
77
+ * Function example
78
+ */
79
+ example: string;
80
+ /**
81
+ * Is it optional
82
+ *
83
+ * true: required
84
+ * false: optional
85
+ */
86
+ require: BooleanNumber;
87
+ /**
88
+ * Whether it is repeatable, in the case of repeatability, the maximum parameter of m is generally set to 255, such as [1,255]
89
+ *
90
+ * true: repeatable
91
+ * false: not repeatable
92
+ */
93
+ repeat: BooleanNumber;
94
+ }
95
+ export interface IFunctionInfo {
96
+ /**
97
+ * Function name
98
+ */
99
+ functionName: string;
100
+ /**
101
+ * Alias function name
102
+ */
103
+ aliasFunctionName?: string;
104
+ /**
105
+ * Function type
106
+ */
107
+ functionType: FunctionType;
108
+ /**
109
+ * Detailed description
110
+ */
111
+ description: string;
112
+ /**
113
+ * Concise abstract
114
+ */
115
+ abstract: string;
116
+ /**
117
+ * Function params
118
+ */
119
+ functionParameter: IFunctionParam[];
120
+ }
121
+ export declare enum FUNCTION_NAMES {
122
+ AVERAGE = "AVERAGE",
123
+ CONCATENATE = "CONCATENATE",
124
+ COUNT = "COUNT",
125
+ INDIRECT = "INDIRECT",
126
+ MAX = "MAX",
127
+ MIN = "MIN",
128
+ OFFSET = "OFFSET",
129
+ POWER = "POWER",
130
+ SUM = "SUM",
131
+ COMPARE = "COMPARE",
132
+ DIVIDED = "DIVIDED",
133
+ MINUS = "MINUS",
134
+ MULTIPLY = "MULTIPLY",
135
+ PLUS = "PLUS",
136
+ UNION = "UNION"
137
+ }
138
+ //# sourceMappingURL=function.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"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AU;IACf,QAAQ,aAAa;IACrB,GAAG,QAAQ;IACX,GAAG,QAAQ;IACX,MAAM,WAAW;IACjB,KAAK,UAAU;IACf,GAAG,QAAQ;IACX,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,QAAQ,aAAa;IACrB,IAAI,SAAS;IACb,KAAK,UAAU;CAClB"}
@@ -0,0 +1,6 @@
1
+ import { compareToken, matchToken, operatorToken, prefixToken, suffixToken } from './token';
2
+ export declare const FORMULA_LEXER_TOKENS: (operatorToken | suffixToken | prefixToken | compareToken | matchToken)[];
3
+ export declare function isFormulaLexerToken(str: string): boolean;
4
+ export declare function includeFormulaLexerToken(str: string): boolean;
5
+ export declare function normalizeSheetName(sheetName: string): string;
6
+ //# sourceMappingURL=match-token.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"match-token.d.ts","sourceRoot":"","sources":["../../../src/basics/match-token.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE5F,eAAO,MAAM,oBAAoB,2EAMhC,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,WAE9C;AAED,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,MAAM,WAQnD;AAED,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,UAKnD"}
@@ -0,0 +1,6 @@
1
+ import type { PrefixNode } from '../ast-node/prefix-node';
2
+ import type { ReferenceNode } from '../ast-node/reference-node';
3
+ import type { SuffixNode } from '../ast-node/suffix-node';
4
+ import type { UnionNode } from '../ast-node/union-node';
5
+ export type PreCalculateNodeType = ReferenceNode | UnionNode | PrefixNode | SuffixNode;
6
+ //# sourceMappingURL=node-type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node-type.d.ts","sourceRoot":"","sources":["../../../src/basics/node-type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,MAAM,oBAAoB,GAAG,aAAa,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { Disposable } from '@univerjs/core';
2
+ export declare class ObjectClassType extends Disposable {
3
+ isErrorObject(): boolean;
4
+ isAsyncObject(): boolean;
5
+ isReferenceObject(): boolean;
6
+ isValueObject(): boolean;
7
+ isEqual(object: ObjectClassType): boolean;
8
+ }
9
+ //# sourceMappingURL=object-class-type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"object-class-type.d.ts","sourceRoot":"","sources":["../../../src/basics/object-class-type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C,qBAAa,eAAgB,SAAQ,UAAU;IAC3C,aAAa;IAIb,aAAa;IAIb,iBAAiB;IAIjB,aAAa;IAIb,OAAO,CAAC,MAAM,EAAE,eAAe;CAGlC"}
@@ -0,0 +1,18 @@
1
+ export declare const UNIT_NAME_REGEX = "'?\\[((?![\\/?:\"<>|*\\\\]).)*\\]";
2
+ export declare const SHEET_NAME_REGEX = "((?![\\[\\]\\/?*\\\\]).)*!";
3
+ export declare const ABSOLUTE_SYMBOL = "$";
4
+ export declare const RANGE_SYMBOL = "\\s*?:\\s*?";
5
+ export declare const SIMPLE_SINGLE_RANGE_REGEX = "\\$?[A-Za-z]+\\$?[0-9]+";
6
+ export declare const REFERENCE_MULTIPLE_RANGE_REGEX = "^(@)?('?\\[((?![\\/?:\"<>|*\\\\]).)*\\])?(((?![\\[\\]\\/?*\\\\]).)*!)?\\$?[A-Za-z]+\\$?[0-9]+\\s*?:\\s*?\\$?[A-Za-z]+\\$?[0-9]+$";
7
+ export declare const REFERENCE_SINGLE_RANGE_REGEX = "^('?\\[((?![\\/?:\"<>|*\\\\]).)*\\])?(((?![\\[\\]\\/?*\\\\]).)*!)?\\s*?\\$?[A-Za-z]+\\$?[0-9]+(#)?$";
8
+ export declare const REFERENCE_REGEX_ROW = "^('?\\[((?![\\/?:\"<>|*\\\\]).)*\\])?(((?![\\[\\]\\/?*\\\\]).)*!)?\\$?[0-9]+\\s*?:\\s*?\\$?[0-9]+$";
9
+ export declare const REFERENCE_REGEX_COLUMN = "^('?\\[((?![\\/?:\"<>|*\\\\]).)*\\])?(((?![\\[\\]\\/?*\\\\]).)*!)?\\$?[A-Za-z]+\\s*?:\\s*?\\$?[A-Za-z]+$";
10
+ export declare const REFERENCE_REGEX_SINGLE_ROW = "^('?\\[((?![\\/?:\"<>|*\\\\]).)*\\])?(((?![\\[\\]\\/?*\\\\]).)*!)?\\s*?\\$?[0-9]+$";
11
+ export declare const REFERENCE_REGEX_SINGLE_COLUMN = "^('?\\[((?![\\/?:\"<>|*\\\\]).)*\\])?(((?![\\[\\]\\/?*\\\\]).)*!)?\\s*?\\$?[A-Za-z]+$";
12
+ export declare const REFERENCE_TABLE_ALL_COLUMN_REGEX = "^('?\\[((?![\\/?:\"<>|*\\\\]).)*\\])?((?![~!@#$%^&*()_+<>?:,./;\u2019\uFF0C\u3002\u3001\u2018\uFF1A\u201C\u300A\u300B\uFF1F~\uFF01@#\uFFE5%\u2026\u2026\uFF08\uFF09\u3010\u3011\\[\\]\\/\\\\]).)+$";
13
+ export declare const REFERENCE_TABLE_SINGLE_COLUMN_REGEX = "^('?\\[((?![\\/?:\"<>|*\\\\]).)*\\])?((?![~!@#$%^&*()_+<>?:,./;\u2019\uFF0C\u3002\u3001\u2018\uFF1A\u201C\u300A\u300B\uFF1F~\uFF01@#\uFFE5%\u2026\u2026\uFF08\uFF09\u3010\u3011\\[\\]\\/\\\\]).)+(\\[((?<!#).)*\\]|\\[\\[#.+\\]\\s*?,\\s*?\\[((?<!#).)*\\]\\])+$";
14
+ export declare const REFERENCE_TABLE_MULTIPLE_COLUMN_REGEX = "^('?\\[((?![\\/?:\"<>|*\\\\]).)*\\])?((?![~!@#$%^&*()_+<>?:,./;\u2019\uFF0C\u3002\u3001\u2018\uFF1A\u201C\u300A\u300B\uFF1F~\uFF01@#\uFFE5%\u2026\u2026\uFF08\uFF09\u3010\u3011\\[\\]\\/\\\\]).)+(\\[\\[((?<!#).)*\\]\\s*?:\\s*?\\[((?<!#).)*\\]\\])?$|^((?![~!@#$%^&*()_+<>?:,./;\u2019\uFF0C\u3002\u3001\u2018\uFF1A\u201C\u300A\u300B\uFF1F~\uFF01@#\uFFE5%\u2026\u2026\uFF08\uFF09\u3010\u3011\\[\\]\\/\\\\]).)+(\\[\\[#.+\\]\\s*?,\\s*?\\[((?<!#).)*\\]\\s*?:\\s*?\\[((?<!#).)*\\]\\])?$";
15
+ export declare const $SUPER_TABLE_COLUMN_REGEX: RegExp;
16
+ export declare const $ARRAY_VALUE_REGEX: RegExp;
17
+ export declare function isReferenceString(refString: string): boolean;
18
+ //# sourceMappingURL=regex.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"regex.d.ts","sourceRoot":"","sources":["../../../src/basics/regex.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe,sCAAsC,CAAC;AAEnE,eAAO,MAAM,gBAAgB,+BAA+B,CAAC;AAE7D,eAAO,MAAM,eAAe,MAAM,CAAC;AAEnC,eAAO,MAAM,YAAY,gBAAgB,CAAC;AAE1C,eAAO,MAAM,yBAAyB,4BAA8D,CAAC;AAErG,eAAO,MAAM,8BAA8B,qIAA6I,CAAC;AAEzL,eAAO,MAAM,4BAA4B,wGAA0G,CAAC;AAEpJ,eAAO,MAAM,mBAAmB,uGAAuH,CAAC;AAExJ,eAAO,MAAM,sBAAsB,6GAA6H,CAAC;AAEjK,eAAO,MAAM,0BAA0B,uFAAkF,CAAC;AAE1H,eAAO,MAAM,6BAA6B,0FAAqF,CAAC;AAUhI,eAAO,MAAM,gCAAgC,uMAA+C,CAAC;AAE7F,eAAO,MAAM,mCAAmC,qQAAyH,CAAC;AAE1K,eAAO,MAAM,qCAAqC,keAAuK,CAAC;AAE1N,eAAO,MAAM,yBAAyB,QAAW,CAAC;AAElD,eAAO,MAAM,kBAAkB,QAAW,CAAC;AAE3C,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,WAOlD"}
@@ -0,0 +1,28 @@
1
+ import type { LexerNode } from '../analysis/lexer-node';
2
+ export declare enum sequenceNodeType {
3
+ NORMAL = 0,
4
+ NUMBER = 1,
5
+ STRING = 2,
6
+ FUNCTION = 3,
7
+ REFERENCE = 4,
8
+ ARRAY = 5
9
+ }
10
+ export interface ISequenceNode {
11
+ nodeType: sequenceNodeType;
12
+ token: string;
13
+ startIndex: number;
14
+ endIndex: number;
15
+ }
16
+ export interface ISequenceArray {
17
+ segment: string;
18
+ currentString: string;
19
+ cur: number;
20
+ currentLexerNode: LexerNode;
21
+ }
22
+ /**
23
+ * Deserialize Sequence to text.
24
+ * @param newSequenceNodes
25
+ * @returns
26
+ */
27
+ export declare function generateStringWithSequence(newSequenceNodes: Array<string | ISequenceNode>): string;
28
+ //# sourceMappingURL=sequence.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sequence.d.ts","sourceRoot":"","sources":["../../../src/basics/sequence.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAExD,oBAAY,gBAAgB;IACxB,MAAM,IAAA;IACN,MAAM,IAAA;IACN,MAAM,IAAA;IACN,QAAQ,IAAA;IACR,SAAS,IAAA;IACT,KAAK,IAAA;CACR;AAED,MAAM,WAAW,aAAa;IAC1B,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,cAAc;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,gBAAgB,EAAE,SAAS,CAAC;CAC/B;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,gBAAgB,EAAE,KAAK,CAAC,MAAM,GAAG,aAAa,CAAC,UAUzF"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Maintain the form of setTimeout, only accept a single function parameter,
3
+ * and the delay is always 0.
4
+ * @param fn
5
+ */
6
+ export declare function setZeroTimeout(fn: any): void;
7
+ //# sourceMappingURL=set-zero-time-out.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"set-zero-time-out.d.ts","sourceRoot":"","sources":["../../../src/basics/set-zero-time-out.ts"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,GAAG,QAGrC"}
@@ -0,0 +1,8 @@
1
+ export declare const DEFAULT_TOKEN_TYPE_PARAMETER = "P_1";
2
+ export declare const DEFAULT_TOKEN_TYPE_ROOT = "R_1";
3
+ export declare const DEFAULT_TOKEN_TYPE_LAMBDA_PARAMETER = "L_1";
4
+ export declare const DEFAULT_TOKEN_TYPE_LAMBDA_RUNTIME_PARAMETER = "LR_1";
5
+ export declare const DEFAULT_TOKEN_TYPE_LAMBDA_OMIT_PARAMETER = "LO_1";
6
+ export declare const DEFAULT_TOKEN_LET_FUNCTION_NAME = "LET";
7
+ export declare const DEFAULT_TOKEN_LAMBDA_FUNCTION_NAME = "LAMBDA";
8
+ //# sourceMappingURL=token-type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"token-type.d.ts","sourceRoot":"","sources":["../../../src/basics/token-type.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,4BAA4B,QAAQ,CAAC;AAElD,eAAO,MAAM,uBAAuB,QAAQ,CAAC;AAE7C,eAAO,MAAM,mCAAmC,QAAQ,CAAC;AAEzD,eAAO,MAAM,2CAA2C,SAAS,CAAC;AAElE,eAAO,MAAM,wCAAwC,SAAS,CAAC;AAE/D,eAAO,MAAM,+BAA+B,QAAQ,CAAC;AAErD,eAAO,MAAM,kCAAkC,WAAW,CAAC"}
@@ -0,0 +1,45 @@
1
+ export declare enum operatorToken {
2
+ PLUS = "+",
3
+ MINUS = "-",
4
+ MULTIPLY = "*",
5
+ DIVIDED = "/",
6
+ CONCATENATE = "&",
7
+ POWER = "^",
8
+ EQUALS = "=",
9
+ NOT_EQUAL = "<>",
10
+ GREATER_THAN = ">",
11
+ GREATER_THAN_OR_EQUAL = ">=",
12
+ LESS_THAN = "<",
13
+ LESS_THAN_OR_EQUAL = "<="
14
+ }
15
+ export declare enum compareToken {
16
+ EQUALS = "=",
17
+ NOT_EQUAL = "<>",
18
+ GREATER_THAN = ">",
19
+ GREATER_THAN_OR_EQUAL = ">=",
20
+ LESS_THAN = "<",
21
+ LESS_THAN_OR_EQUAL = "<="
22
+ }
23
+ export declare const OPERATOR_TOKEN_PRIORITY: Map<string, number>;
24
+ export declare const OPERATOR_TOKEN_SET: Set<string>;
25
+ export declare const OPERATOR_TOKEN_COMPARE_SET: Set<string>;
26
+ export declare enum matchToken {
27
+ OPEN_BRACKET = "(",
28
+ CLOSE_BRACKET = ")",
29
+ COMMA = ",",
30
+ SINGLE_QUOTATION = "'",
31
+ DOUBLE_QUOTATION = "\"",
32
+ OPEN_BRACES = "{",
33
+ CLOSE_BRACES = "}",
34
+ COLON = ":"
35
+ }
36
+ export declare enum suffixToken {
37
+ PERCENTAGE = "%",
38
+ POUND = "#"
39
+ }
40
+ export declare const SUFFIX_TOKEN_SET: Set<string>;
41
+ export declare enum prefixToken {
42
+ AT = "@",
43
+ MINUS = "-"
44
+ }
45
+ //# sourceMappingURL=token.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"token.d.ts","sourceRoot":"","sources":["../../../src/basics/token.ts"],"names":[],"mappings":"AAAA,oBAAY,aAAa;IACrB,IAAI,MAAM;IACV,KAAK,MAAM;IACX,QAAQ,MAAM;IACd,OAAO,MAAM;IACb,WAAW,MAAM;IACjB,KAAK,MAAM;IACX,MAAM,MAAM;IACZ,SAAS,OAAO;IAChB,YAAY,MAAM;IAClB,qBAAqB,OAAO;IAC5B,SAAS,MAAM;IACf,kBAAkB,OAAO;CAC5B;AAED,oBAAY,YAAY;IACpB,MAAM,MAAM;IACZ,SAAS,OAAO;IAChB,YAAY,MAAM;IAClB,qBAAqB,OAAO;IAC5B,SAAS,MAAM;IACf,kBAAkB,OAAO;CAC5B;AAED,eAAO,MAAM,uBAAuB,qBAalC,CAAC;AAEH,eAAO,MAAM,kBAAkB,aAA0C,CAAC;AAE1E,eAAO,MAAM,0BAA0B,aAOrC,CAAC;AAEH,oBAAY,UAAU;IAClB,YAAY,MAAM;IAClB,aAAa,MAAM;IACnB,KAAK,MAAM;IACX,gBAAgB,MAAM;IACtB,gBAAgB,OAAM;IACtB,WAAW,MAAM;IACjB,YAAY,MAAM;IAClB,KAAK,MAAM;CACd;AAED,oBAAY,WAAW;IACnB,UAAU,MAAM;IAChB,KAAK,MAAM;CACd;AAED,eAAO,MAAM,gBAAgB,aAAiE,CAAC;AAE/F,oBAAY,WAAW;IACnB,EAAE,MAAM;IACR,KAAK,MAAM;CACd"}
@@ -0,0 +1,49 @@
1
+ import type { IRange, IUnitRange, Nullable } from '@univerjs/core';
2
+ import { Disposable } from '@univerjs/core';
3
+ import type { BaseAstNode } from '../ast-node/base-ast-node';
4
+ import type { IUnitExcludedCell } from '../basics/common';
5
+ export declare enum FDtreeStateType {
6
+ DEFAULT = 0,
7
+ ADDED = 1,
8
+ SKIP = 2
9
+ }
10
+ export declare class FormulaDependencyTree extends Disposable {
11
+ node: Nullable<BaseAstNode>;
12
+ children: FormulaDependencyTree[];
13
+ parents: FormulaDependencyTree[];
14
+ formula: string;
15
+ row: number;
16
+ column: number;
17
+ subComponentId: string;
18
+ unitId: string;
19
+ rangeList: IUnitRange[];
20
+ formulaId: Nullable<string>;
21
+ private _state;
22
+ dispose(): void;
23
+ setAdded(): void;
24
+ isAdded(): boolean;
25
+ setSkip(): void;
26
+ isSkip(): boolean;
27
+ compareRangeData(range: IRange): boolean;
28
+ /**
29
+ * "Determine whether all ranges of the current node exist within the dirty area.
30
+ * If they are within the dirty area, return true, indicating that this node needs to be calculated.
31
+ * @param dependencyRangeList
32
+ * @returns
33
+ */
34
+ dependencyRange(dependencyRangeList: Map<string, Map<string, IRange[]>>, unitExcludedCell: Nullable<IUnitExcludedCell>): boolean;
35
+ pushChildren(tree: FormulaDependencyTree): void;
36
+ /**
37
+ * Add the range corresponding to the current ast node.
38
+ * @param range
39
+ */
40
+ pushRangeList(range: IUnitRange): void;
41
+ /**
42
+ * Determine whether it is dependent on other trees.
43
+ * @param dependenceTree
44
+ * @returns
45
+ */
46
+ dependency(dependenceTree: FormulaDependencyTree): boolean;
47
+ private _pushParent;
48
+ }
49
+ //# sourceMappingURL=dependency-tree.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dependency-tree.d.ts","sourceRoot":"","sources":["../../../src/dependency/dependency-tree.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAE1D,oBAAY,eAAe;IACvB,OAAO,IAAA;IACP,KAAK,IAAA;IACL,IAAI,IAAA;CACP;AAED,qBAAa,qBAAsB,SAAQ,UAAU;IACjD,IAAI,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC;IAE5B,QAAQ,EAAE,qBAAqB,EAAE,CAAM;IAEvC,OAAO,EAAE,qBAAqB,EAAE,CAAM;IAEtC,OAAO,EAAE,MAAM,CAAM;IAErB,GAAG,EAAE,MAAM,CAAM;IAEjB,MAAM,EAAE,MAAM,CAAM;IAEpB,cAAc,EAAE,MAAM,CAAM;IAE5B,MAAM,EAAE,MAAM,CAAM;IAEpB,SAAS,EAAE,UAAU,EAAE,CAAM;IAE7B,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAE5B,OAAO,CAAC,MAAM,CAA2B;IAEhC,OAAO,IAAI,IAAI;IAWxB,QAAQ;IAIR,OAAO;IAIP,OAAO;IAIP,MAAM;IAIN,gBAAgB,CAAC,KAAK,EAAE,MAAM;IAa9B;;;;;OAKG;IACH,eAAe,CACX,mBAAmB,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,EACvD,gBAAgB,EAAE,QAAQ,CAAC,iBAAiB,CAAC;IAgEjD,YAAY,CAAC,IAAI,EAAE,qBAAqB;IAKxC;;;OAGG;IACH,aAAa,CAAC,KAAK,EAAE,UAAU;IAI/B;;;;OAIG;IACH,UAAU,CAAC,cAAc,EAAE,qBAAqB;IAuBhD,OAAO,CAAC,WAAW;CAGtB"}
@@ -0,0 +1,67 @@
1
+ import { Disposable } from '@univerjs/core';
2
+ import { LexerTreeBuilder } from '../analysis/lexer';
3
+ import { AstTreeBuilder } from '../analysis/parser';
4
+ import type { AstRootNode } from '../ast-node';
5
+ import { FormulaAstLRU } from '../basics/cache-lru';
6
+ import { Interpreter } from '../interpreter/interpreter';
7
+ import { IFormulaCurrentConfigService } from '../services/current-data.service';
8
+ import { IFormulaRuntimeService } from '../services/runtime.service';
9
+ import { FormulaDependencyTree } from './dependency-tree';
10
+ export declare const FormulaASTCache: FormulaAstLRU<AstRootNode>;
11
+ export declare class FormulaDependencyGenerator extends Disposable {
12
+ private readonly _currentConfigService;
13
+ private readonly _runtimeService;
14
+ private readonly _interpreter;
15
+ private readonly _astTreeBuilder;
16
+ private readonly _lexerTreeBuilder;
17
+ private _updateRangeFlattenCache;
18
+ constructor(_currentConfigService: IFormulaCurrentConfigService, _runtimeService: IFormulaRuntimeService, _interpreter: Interpreter, _astTreeBuilder: AstTreeBuilder, _lexerTreeBuilder: LexerTreeBuilder);
19
+ dispose(): void;
20
+ generate(): Promise<FormulaDependencyTree[]>;
21
+ private _isCyclicUtil;
22
+ private _checkIsCycleDependency;
23
+ /**
24
+ * Generate nodes for the dependency tree, where each node contains all the reference data ranges included in each formula.
25
+ * @param formulaData
26
+ * @returns
27
+ */
28
+ private _generateTreeList;
29
+ /**
30
+ * Break down the dirty areas into ranges for subsequent matching.
31
+ * @returns
32
+ */
33
+ private _updateRangeFlatten;
34
+ private _generateAstNode;
35
+ private _addFlattenCache;
36
+ private _isPreCalculateNode;
37
+ private _nodeTraversalRef;
38
+ private _nodeTraversalReferenceFunction;
39
+ private _executeNode;
40
+ /**
41
+ * Calculate the range required for collection in advance,
42
+ * including references and location functions (such as OFFSET, INDIRECT, INDEX, etc.).
43
+ * @param node
44
+ * @returns
45
+ */
46
+ private _getRangeListByNode;
47
+ /**
48
+ * Build a formula dependency tree based on the dependency relationships.
49
+ * @param treeList
50
+ * @returns
51
+ */
52
+ private _getUpdateTreeListAndMakeDependency;
53
+ /**
54
+ * Determine whether all ranges of the current node exist within the dirty area.
55
+ * If they are within the dirty area, return true, indicating that this node needs to be calculated.
56
+ * @param tree
57
+ * @returns
58
+ */
59
+ private _includeTree;
60
+ /**
61
+ * Generate the final formula calculation order array by traversing the dependency tree established via depth-first search.
62
+ * @param treeList
63
+ * @returns
64
+ */
65
+ private _calculateRunList;
66
+ }
67
+ //# sourceMappingURL=formula-dependency.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formula-dependency.d.ts","sourceRoot":"","sources":["../../../src/dependency/formula-dependency.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAA8C,MAAM,gBAAgB,CAAC;AAGxF,OAAO,EAAE,gBAAg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AmC;IAuC3C;;;;;OAKG;IACH,OAAO,CAAC,YAAY;IA2CpB;;;;OAIG;IACH,OAAO,CAAC,iBAAiB;CAkC5B"}
@@ -0,0 +1,6 @@
1
+ import type { FunctionVariantType } from '../reference-object/base-reference-object';
2
+ import { BaseFunction } from './base-function';
3
+ export declare class Average extends BaseFunction {
4
+ calculate(...variants: FunctionVariantType[]): import("../value-object/base-value-object").CalculateValueType;
5
+ }
6
+ //# sourceMappingURL=average.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"average.d.ts","sourceRoot":"","sources":["../../../src/functions/average.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAGrF,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,qBAAa,OAAQ,SAAQ,YAAY;IAC5B,SAAS,CAAC,GAAG,QAAQ,EAAE,mBAAmB,EAAE;CAkBxD"}
@@ -0,0 +1,14 @@
1
+ import { Disposable } from '@univerjs/core';
2
+ import type { IAccessor } from '@wendellhu/redi';
3
+ import type { FunctionVariantType, NodeValueType } from '../reference-object/base-reference-object';
4
+ export declare class BaseFunction extends Disposable {
5
+ readonly accessor: IAccessor;
6
+ private _name;
7
+ constructor(accessor: IAccessor, _name: string);
8
+ get name(): string;
9
+ isAsync(): boolean;
10
+ isAddress(): boolean;
11
+ calculate(...arg: FunctionVariantType[]): NodeValueType;
12
+ checkArrayType(variant: FunctionVariantType): boolean;
13
+ }
14
+ //# sourceMappingURL=base-function.d.ts.map