@univerjs/engine-formula 0.1.3 → 0.1.5

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 (178) hide show
  1. package/lib/cjs/index.js +1 -1
  2. package/lib/es/index.js +4520 -3304
  3. package/lib/types/basics/calculate.d.ts +1 -15
  4. package/lib/types/basics/common.d.ts +16 -17
  5. package/lib/types/basics/date.d.ts +1 -1
  6. package/lib/types/basics/dirty.d.ts +2 -16
  7. package/lib/types/basics/format.d.ts +24 -0
  8. package/lib/types/basics/function.d.ts +18 -32
  9. package/lib/types/basics/inverted-index-cache.d.ts +2 -2
  10. package/lib/types/basics/match-token.d.ts +1 -15
  11. package/lib/types/basics/object-class-type.d.ts +6 -15
  12. package/lib/types/basics/runtime.d.ts +2 -16
  13. package/lib/types/commands/mutations/register-function.mutation.d.ts +2 -16
  14. package/lib/types/commands/mutations/set-array-formula-data.mutation.d.ts +4 -18
  15. package/lib/types/commands/mutations/set-defined-name.mutation.d.ts +2 -16
  16. package/lib/types/commands/mutations/set-feature-calculation.mutation.d.ts +3 -17
  17. package/lib/types/commands/mutations/set-formula-calculation.mutation.d.ts +5 -18
  18. package/lib/types/commands/mutations/set-formula-data.mutation.d.ts +3 -17
  19. package/lib/types/commands/mutations/set-numfmt-formula-data.mutation.d.ts +3 -17
  20. package/lib/types/commands/mutations/set-other-formula.mutation.d.ts +15 -19
  21. package/lib/types/commands/mutations/set-super-table.mutation.d.ts +4 -18
  22. package/lib/types/commands/mutations/unregister-function.mutation.d.ts +2 -16
  23. package/lib/types/controller/calculate.controller.d.ts +3 -17
  24. package/lib/types/controller/formula.controller.d.ts +5 -20
  25. package/lib/types/controller/register-function.controller.d.ts +3 -17
  26. package/lib/types/controller/set-defined-name.controller.d.ts +2 -16
  27. package/lib/types/controller/set-feature-calculation.controller.d.ts +2 -16
  28. package/lib/types/controller/set-other-formula.controller.d.ts +2 -16
  29. package/lib/types/controller/set-super-table.controller.d.ts +2 -16
  30. package/lib/types/engine/analysis/__tests__/create-command-test-bed.d.ts +11 -26
  31. package/lib/types/engine/analysis/lexer-node.d.ts +3 -17
  32. package/lib/types/engine/analysis/lexer-tree-builder.d.ts +5 -19
  33. package/lib/types/engine/analysis/lexer.d.ts +5 -19
  34. package/lib/types/engine/analysis/parser.d.ts +14 -29
  35. package/lib/types/engine/ast-node/ast-root-node.d.ts +4 -18
  36. package/lib/types/engine/ast-node/base-ast-node-factory.d.ts +3 -18
  37. package/lib/types/engine/ast-node/base-ast-node.d.ts +6 -21
  38. package/lib/types/engine/ast-node/function-node.d.ts +10 -24
  39. package/lib/types/engine/ast-node/lambda-node.d.ts +6 -20
  40. package/lib/types/engine/ast-node/lambda-parameter-node.d.ts +4 -19
  41. package/lib/types/engine/ast-node/null-node.d.ts +2 -16
  42. package/lib/types/engine/ast-node/operator-node.d.ts +6 -20
  43. package/lib/types/engine/ast-node/prefix-node.d.ts +8 -23
  44. package/lib/types/engine/ast-node/reference-node.d.ts +10 -25
  45. package/lib/types/engine/ast-node/suffix-node.d.ts +7 -22
  46. package/lib/types/engine/ast-node/union-node.d.ts +5 -19
  47. package/lib/types/engine/ast-node/value-node.d.ts +4 -18
  48. package/lib/types/engine/dependency/dependency-tree.d.ts +24 -23
  49. package/lib/types/engine/dependency/formula-dependency.d.ts +11 -31
  50. package/lib/types/engine/interpreter/interpreter.d.ts +6 -20
  51. package/lib/types/engine/reference-object/base-reference-object.d.ts +22 -32
  52. package/lib/types/engine/reference-object/cell-reference-object.d.ts +4 -18
  53. package/lib/types/engine/reference-object/column-reference-object.d.ts +2 -16
  54. package/lib/types/engine/reference-object/range-reference-object.d.ts +2 -16
  55. package/lib/types/engine/reference-object/row-reference-object.d.ts +2 -16
  56. package/lib/types/engine/reference-object/table-reference-object.d.ts +2 -17
  57. package/lib/types/engine/utils/array-object.d.ts +3 -17
  58. package/lib/types/engine/utils/ast-node-tool.d.ts +3 -17
  59. package/lib/types/engine/utils/cell.d.ts +2 -16
  60. package/lib/types/engine/utils/char-kit.d.ts +25 -0
  61. package/lib/types/engine/utils/compare.d.ts +1 -15
  62. package/lib/types/engine/utils/function-definition.d.ts +1 -15
  63. package/lib/types/engine/utils/node-type.d.ts +5 -19
  64. package/lib/types/engine/utils/object-compare.d.ts +2 -17
  65. package/lib/types/engine/utils/prefixHandler.d.ts +4 -18
  66. package/lib/types/engine/utils/r1c1-reference.d.ts +2 -16
  67. package/lib/types/engine/utils/reference.d.ts +3 -18
  68. package/lib/types/engine/utils/sequence.d.ts +2 -16
  69. package/lib/types/engine/utils/value-object.d.ts +6 -0
  70. package/lib/types/engine/{utils/object-covert.d.ts → value-object/__tests__/array-value-divided.spec.d.ts} +1 -3
  71. package/lib/types/engine/value-object/__tests__/array-value-minus.spec.d.ts +16 -0
  72. package/lib/types/engine/value-object/__tests__/array-value-multiply.spec.d.ts +16 -0
  73. package/lib/types/engine/value-object/__tests__/array-value-plus.spec.d.ts +16 -0
  74. package/lib/types/engine/value-object/array-value-object.d.ts +11 -26
  75. package/lib/types/engine/value-object/base-value-object.d.ts +12 -23
  76. package/lib/types/engine/value-object/cube-value-object.d.ts +4 -17
  77. package/lib/types/engine/value-object/lambda-value-object.d.ts +5 -18
  78. package/lib/types/engine/value-object/primitive-object.d.ts +26 -19
  79. package/lib/types/functions/__tests__/create-function-test-bed.d.ts +13 -26
  80. package/lib/types/functions/base-function.d.ts +10 -31
  81. package/lib/types/functions/compatibility/function-map.d.ts +2 -16
  82. package/lib/types/functions/date/date/index.d.ts +2 -16
  83. package/lib/types/functions/date/day/index.d.ts +2 -16
  84. package/lib/types/functions/date/edate/index.d.ts +2 -16
  85. package/lib/types/functions/date/function-map.d.ts +2 -16
  86. package/lib/types/functions/date/month/index.d.ts +2 -16
  87. package/lib/types/functions/date/today/index.d.ts +3 -18
  88. package/lib/types/functions/date/year/index.d.ts +2 -16
  89. package/lib/types/functions/information/function-map.d.ts +2 -16
  90. package/lib/types/functions/information/isblank/index.d.ts +2 -16
  91. package/lib/types/functions/information/iserr/index.d.ts +2 -16
  92. package/lib/types/functions/information/iserror/index.d.ts +2 -16
  93. package/lib/types/functions/information/islogical/index.d.ts +2 -16
  94. package/lib/types/functions/information/isna/index.d.ts +2 -16
  95. package/lib/types/functions/information/isnontext/index.d.ts +2 -16
  96. package/lib/types/functions/information/isnumber/index.d.ts +2 -16
  97. package/lib/types/functions/information/isref/index.d.ts +3 -17
  98. package/lib/types/functions/information/istext/index.d.ts +2 -16
  99. package/lib/types/functions/logical/and/index.d.ts +2 -16
  100. package/lib/types/functions/logical/function-map.d.ts +4 -18
  101. package/lib/types/functions/logical/if/index.d.ts +2 -16
  102. package/lib/types/functions/logical/iferror/index.d.ts +3 -17
  103. package/lib/types/functions/logical/lambda/index.d.ts +2 -16
  104. package/lib/types/functions/logical/makearray/index.d.ts +3 -17
  105. package/lib/types/functions/logical/or/__tests__/index.spec.d.ts +16 -0
  106. package/lib/types/functions/logical/or/index.d.ts +6 -0
  107. package/lib/types/functions/lookup/address/index.d.ts +2 -16
  108. package/lib/types/functions/lookup/column/index.d.ts +3 -17
  109. package/lib/types/functions/lookup/columns/index.d.ts +2 -16
  110. package/lib/types/functions/lookup/function-map.d.ts +12 -25
  111. package/lib/types/functions/lookup/hlookup/index.d.ts +2 -16
  112. package/lib/types/functions/lookup/index/index.d.ts +8 -15
  113. package/lib/types/functions/lookup/indirect/index.d.ts +3 -17
  114. package/lib/types/functions/lookup/lookup/index.d.ts +3 -17
  115. package/lib/types/functions/lookup/match/index.d.ts +3 -17
  116. package/lib/types/functions/lookup/offset/index.d.ts +5 -19
  117. package/lib/types/functions/lookup/row/index.d.ts +3 -17
  118. package/lib/types/functions/lookup/rows/index.d.ts +2 -16
  119. package/lib/types/functions/lookup/vlookup/index.d.ts +5 -17
  120. package/lib/types/functions/lookup/xlookup/index.d.ts +3 -17
  121. package/lib/types/functions/lookup/xmatch/index.d.ts +3 -17
  122. package/lib/types/functions/math/abs/index.d.ts +2 -16
  123. package/lib/types/functions/math/acos/index.d.ts +2 -16
  124. package/lib/types/functions/math/acosh/index.d.ts +2 -16
  125. package/lib/types/functions/math/acot/index.d.ts +2 -16
  126. package/lib/types/functions/math/function-map.d.ts +4 -18
  127. package/lib/types/functions/math/mod/index.d.ts +2 -16
  128. package/lib/types/functions/math/power/index.d.ts +2 -16
  129. package/lib/types/functions/math/product/index.d.ts +2 -16
  130. package/lib/types/functions/math/subtotal/index.d.ts +3 -17
  131. package/lib/types/functions/math/sum/index.d.ts +2 -16
  132. package/lib/types/functions/math/sumif/index.d.ts +2 -16
  133. package/lib/types/functions/math/sumifs/index.d.ts +3 -18
  134. package/lib/types/functions/meta/compare/index.d.ts +3 -17
  135. package/lib/types/functions/meta/cube/index.d.ts +2 -16
  136. package/lib/types/functions/meta/divided/index.d.ts +2 -16
  137. package/lib/types/functions/meta/function-map.d.ts +2 -16
  138. package/lib/types/functions/meta/minus/index.d.ts +2 -16
  139. package/lib/types/functions/meta/multiply/index.d.ts +2 -16
  140. package/lib/types/functions/meta/plus/index.d.ts +2 -16
  141. package/lib/types/functions/statistical/average/index.d.ts +2 -16
  142. package/lib/types/functions/statistical/count/index.d.ts +2 -16
  143. package/lib/types/functions/statistical/counta/index.d.ts +2 -16
  144. package/lib/types/functions/statistical/function-map.d.ts +2 -16
  145. package/lib/types/functions/statistical/max/index.d.ts +2 -16
  146. package/lib/types/functions/statistical/min/index.d.ts +2 -16
  147. package/lib/types/functions/statistical/stdev-p/index.d.ts +3 -17
  148. package/lib/types/functions/statistical/stdev-s/index.d.ts +3 -17
  149. package/lib/types/functions/statistical/stdeva/index.d.ts +3 -17
  150. package/lib/types/functions/statistical/stdevpa/index.d.ts +3 -17
  151. package/lib/types/functions/statistical/var-p/index.d.ts +3 -17
  152. package/lib/types/functions/statistical/var-s/index.d.ts +3 -17
  153. package/lib/types/functions/statistical/vara/index.d.ts +3 -17
  154. package/lib/types/functions/statistical/varpa/index.d.ts +3 -17
  155. package/lib/types/functions/text/concatenate/index.d.ts +2 -16
  156. package/lib/types/functions/text/function-map.d.ts +2 -16
  157. package/lib/types/functions/text/len/__test__/index.spec.d.ts +16 -0
  158. package/lib/types/functions/text/len/index.d.ts +7 -0
  159. package/lib/types/functions/text/lenb/__test__/index.spec.d.ts +16 -0
  160. package/lib/types/functions/text/lenb/index.d.ts +7 -0
  161. package/lib/types/functions/text/text/__test__/index.spec.d.ts +16 -0
  162. package/lib/types/functions/text/text/index.d.ts +6 -0
  163. package/lib/types/index.d.ts +8 -3
  164. package/lib/types/models/__tests__/create-command-test-bed.d.ts +10 -25
  165. package/lib/types/models/formula-data.model.d.ts +3 -18
  166. package/lib/types/plugin.d.ts +5 -20
  167. package/lib/types/services/active-dirty-manager.service.d.ts +34 -0
  168. package/lib/types/services/calculate-formula.service.d.ts +12 -27
  169. package/lib/types/services/current-data.service.d.ts +10 -19
  170. package/lib/types/services/defined-names.service.d.ts +3 -18
  171. package/lib/types/services/feature-calculation-manager.service.d.ts +5 -20
  172. package/lib/types/services/function.service.d.ts +5 -20
  173. package/lib/types/services/other-formula-manager.service.d.ts +8 -19
  174. package/lib/types/services/runtime.service.d.ts +6 -21
  175. package/lib/types/services/super-table.service.d.ts +4 -19
  176. package/lib/umd/index.js +1 -1
  177. package/package.json +12 -10
  178. /package/lib/types/engine/utils/__tests__/{object-covert.spec.d.ts → value-object.spec.d.ts} +0 -0
@@ -1,17 +1,3 @@
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
1
  import { compareToken } from './token';
2
+
17
3
  export declare function reverseCompareOperator(operator: compareToken): compareToken;
@@ -1,19 +1,5 @@
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
- import type { BooleanNumber, ICellData, IColumnData, IObjectArrayPrimitiveType, IObjectMatrixPrimitiveType, IRange, IRowData, IUnitRange, Nullable, ObjectMatrix } from '@univerjs/core';
1
+ import { BooleanNumber, ICellData, IColumnData, IObjectArrayPrimitiveType, IObjectMatrixPrimitiveType, IRange, IRowData, IUnitRange, Nullable, ObjectMatrix } from '@univerjs/core';
2
+
17
3
  export declare const ERROR_VALUE_OBJECT_CLASS_TYPE = "errorValueObject";
18
4
  export declare const ASYNC_OBJECT_CLASS_TYPE = "asyncObject";
19
5
  export declare const REFERENCE_OBJECT_CLASS_TYPE = "referenceObject";
@@ -56,7 +42,7 @@ export interface IRuntimeUnitDataPrimitiveType {
56
42
  export interface IRuntimeOtherUnitDataType {
57
43
  [unitId: string]: Nullable<{
58
44
  [sheetId: string]: Nullable<{
59
- [formulaId: string]: ICellData;
45
+ [formulaId: string]: Nullable<ICellData>[][];
60
46
  }>;
61
47
  }>;
62
48
  }
@@ -65,6 +51,11 @@ export interface IUnitSheetNameMap {
65
51
  [sheetName: string]: string;
66
52
  }>;
67
53
  }
54
+ export interface IUnitSheetIdToNameMap {
55
+ [unitId: string]: Nullable<{
56
+ [sheetId: string]: string;
57
+ }>;
58
+ }
68
59
  export interface IDirtyUnitSheetNameMap {
69
60
  [unitId: string]: Nullable<{
70
61
  [sheetId: string]: string;
@@ -77,6 +68,13 @@ export interface IDirtyUnitFeatureMap {
77
68
  };
78
69
  }>;
79
70
  }
71
+ export interface IDirtyUnitOtherFormulaMap {
72
+ [unitId: string]: Nullable<{
73
+ [sheetId: string]: {
74
+ [formulaId: string]: boolean;
75
+ };
76
+ }>;
77
+ }
80
78
  export interface IArrayFormulaRangeType {
81
79
  [unitId: string]: Nullable<{
82
80
  [sheetId: string]: IObjectMatrixPrimitiveType<IRange>;
@@ -140,6 +138,7 @@ export interface IFormulaDatasetConfig {
140
138
  dirtyRanges: IUnitRange[];
141
139
  dirtyNameMap: IDirtyUnitSheetNameMap;
142
140
  dirtyUnitFeatureMap: IDirtyUnitFeatureMap;
141
+ dirtyUnitOtherFormulaMap: IDirtyUnitOtherFormulaMap;
143
142
  numfmtItemMap: INumfmtItemMap;
144
143
  excludedCell?: IUnitExcludedCell;
145
144
  allUnitData?: IUnitData;
@@ -13,7 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- export declare const DEFFAULT_DATE_FORMAT = "yyyy-mm-dd;@";
16
+ export declare const DEFAULT_DATE_FORMAT = "yyyy/mm/dd;@";
17
17
  /**
18
18
  * Excel stores dates as sequential serial numbers so they can be used in calculations. By default, January 1, 1900 is serial number 1, and January 1, 2008 is serial number 39448 because it is 39,447 days after January 1, 1900.
19
19
  *
@@ -1,17 +1,3 @@
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
- import type { IUnitRange } from '@univerjs/core';
1
+ import { IUnitRange } from '@univerjs/core';
2
+
17
3
  export declare function isInDirtyRange(dirtyRanges: IUnitRange[], unitId: string, sheetId: string, row: number, column: number): boolean;
@@ -0,0 +1,24 @@
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
+ /**
17
+ * covert number to preview string by pattern
18
+ * @TODODushusir: Internationalization, reuse with numfmt
19
+ *
20
+ * @param pattern
21
+ * @param value
22
+ * @returns
23
+ */
24
+ export declare const getFormatPreview: (pattern: string, value: number) => any;
@@ -1,35 +1,21 @@
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
- import type { BooleanNumber } from '@univerjs/core';
17
- import type { FUNCTION_NAMES_ARRAY } from '../functions/array/function-names';
18
- import type { FUNCTION_NAMES_COMPATIBILITY } from '../functions/compatibility/function-names';
19
- import type { FUNCTION_NAMES_CUBE } from '../functions/cube/function-names';
20
- import type { FUNCTION_NAMES_DATABASE } from '../functions/database/function-names';
21
- import type { FUNCTION_NAMES_DATE } from '../functions/date/function-names';
22
- import type { FUNCTION_NAMES_ENGINEERING } from '../functions/engineering/function-names';
23
- import type { FUNCTION_NAMES_FINANCIAL } from '../functions/financial/function-names';
24
- import type { FUNCTION_NAMES_INFORMATION } from '../functions/information/function-names';
25
- import type { FUNCTION_NAMES_LOGICAL } from '../functions/logical/function-names';
26
- import type { FUNCTION_NAMES_LOOKUP } from '../functions/lookup/function-names';
27
- import type { FUNCTION_NAMES_MATH } from '../functions/math/function-names';
28
- import type { FUNCTION_NAMES_META } from '../functions/meta/function-names';
29
- import type { FUNCTION_NAMES_STATISTICAL } from '../functions/statistical/function-names';
30
- import type { FUNCTION_NAMES_TEXT } from '../functions/text/function-names';
31
- import type { FUNCTION_NAMES_UNIVER } from '../functions/univer/function-names';
32
- import type { FUNCTION_NAMES_WEB } from '../functions/web/function-names';
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
+ import { BooleanNumber } from '@univerjs/core';
18
+
33
19
  /**
34
20
  * Function type, refer to https://support.microsoft.com/en-us/office/excel-functions-by-category-5f91f4e9-7b42-46d2-9bd1-63f26a86c0eb
35
21
  */
@@ -29,8 +29,8 @@ export declare class InvertedIndexCache {
29
29
  private _cache;
30
30
  private _continueBuildingCache;
31
31
  set(unitId: string, sheetId: string, column: number, value: string | number | boolean | null, row: number): void;
32
- getCellValuePositions(unitId: string, sheetId: string, column: number): Map<string | number | boolean | null, number[]> | undefined;
33
- getCellPositions(unitId: string, sheetId: string, column: number, value: string | number | boolean): number[] | undefined;
32
+ getCellValuePositions(unitId: string, sheetId: string, column: number): Map<string | number | boolean | null, Set<number>> | undefined;
33
+ getCellPositions(unitId: string, sheetId: string, column: number, value: string | number | boolean): Set<number> | undefined;
34
34
  getCellPosition(unitId: string, sheetId: string, column: number, value: string | number | boolean, startRow: number, endRow: number): number | undefined;
35
35
  setContinueBuildingCache(unitId: string, sheetId: string, column: number, startRow: number, endRow: number): void;
36
36
  shouldContinueBuildingCache(unitId: string, sheetId: string, column: number, row: number): boolean;
@@ -1,19 +1,5 @@
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
1
  import { compareToken, matchToken, operatorToken, prefixToken, suffixToken } from './token';
2
+
17
3
  export declare const FORMULA_LEXER_TOKENS: (operatorToken | suffixToken | compareToken | matchToken | prefixToken)[];
18
4
  export declare function isFormulaLexerToken(str: string): boolean;
19
5
  export declare function includeFormulaLexerToken(str: string): boolean;
@@ -1,27 +1,18 @@
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
1
  import { Disposable } from '@univerjs/core';
2
+
17
3
  export declare class ObjectClassType extends Disposable {
18
4
  pattern: string;
19
5
  getPattern(): string;
6
+ /**
7
+ * Only used in NumberValueObject
8
+ * @param pattern
9
+ */
20
10
  setPattern(pattern: string): void;
21
11
  isError(): boolean;
22
12
  isAsyncObject(): boolean;
23
13
  isAsyncArrayObject(): boolean;
24
14
  isReferenceObject(): boolean;
15
+ isArray(): boolean;
25
16
  isValueObject(): boolean;
26
17
  isEqualType(object: ObjectClassType): boolean;
27
18
  }
@@ -1,18 +1,4 @@
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
- import type { IArrayFormulaUnitCellType, IRuntimeUnitDataPrimitiveType, IRuntimeUnitDataType } from './common';
1
+ import { IArrayFormulaUnitCellType, IRuntimeUnitDataPrimitiveType, IRuntimeUnitDataType } from './common';
2
+
17
3
  export declare function convertUnitDataToRuntime(unitData: IArrayFormulaUnitCellType): IRuntimeUnitDataType;
18
4
  export declare function convertRuntimeToUnitData(unitData: IRuntimeUnitDataType): IRuntimeUnitDataPrimitiveType;
@@ -1,19 +1,5 @@
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
- import type { IMutation } from '@univerjs/core';
1
+ import { IMutation } from '@univerjs/core';
2
+
17
3
  /**
18
4
  *
19
5
  * Register function in main thread, then send function to worker thread.
@@ -1,21 +1,7 @@
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
- import type { IMutation } from '@univerjs/core';
17
- import type { IAccessor } from '@wendellhu/redi';
18
- import type { IArrayFormulaRangeType, IArrayFormulaUnitCellType } from '../../basics/common';
1
+ import { IArrayFormulaRangeType, IArrayFormulaUnitCellType } from '../../basics/common';
2
+ import { IAccessor } from '@wendellhu/redi';
3
+ import { IMutation } from '@univerjs/core';
4
+
19
5
  export interface ISetArrayFormulaDataMutationParams {
20
6
  arrayFormulaRange: IArrayFormulaRangeType;
21
7
  arrayFormulaCellData: IArrayFormulaUnitCellType;
@@ -1,19 +1,5 @@
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
- import type { IMutation } from '@univerjs/core';
1
+ import { IMutation } from '@univerjs/core';
2
+
17
3
  export interface ISetDefinedNameMutationSearchParam {
18
4
  unitId: string;
19
5
  name: string;
@@ -1,20 +1,6 @@
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
- import type { IMutation } from '@univerjs/core';
17
- import type { IFeatureCalculationManagerParam } from '../../services/feature-calculation-manager.service';
1
+ import { IFeatureCalculationManagerParam } from '../../services/feature-calculation-manager.service';
2
+ import { IMutation } from '@univerjs/core';
3
+
18
4
  export interface ISetFeatureCalculationMutation {
19
5
  featureId: string;
20
6
  calculationParam: IFeatureCalculationManagerParam;
@@ -1,25 +1,12 @@
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
- import type { IExecutionOptions, IMutation, IUnitRange, Nullable } from '@univerjs/core';
17
- import type { IDirtyUnitFeatureMap, IDirtyUnitSheetNameMap, INumfmtItemMap, IRuntimeOtherUnitDataType, IRuntimeUnitDataPrimitiveType } from '../../basics/common';
18
- import type { FormulaExecutedStateType, IExecutionInProgressParams } from '../../services/runtime.service';
1
+ import { FormulaExecutedStateType, IExecutionInProgressParams } from '../../services/runtime.service';
2
+ import { IDirtyUnitFeatureMap, IDirtyUnitOtherFormulaMap, IDirtyUnitSheetNameMap, INumfmtItemMap, IRuntimeOtherUnitDataType, IRuntimeUnitDataPrimitiveType } from '../../basics/common';
3
+ import { IExecutionOptions, IMutation, IUnitRange, Nullable } from '@univerjs/core';
4
+
19
5
  export interface ISetFormulaCalculationStartMutation {
20
6
  dirtyRanges: IUnitRange[];
21
7
  dirtyNameMap: IDirtyUnitSheetNameMap;
22
8
  dirtyUnitFeatureMap: IDirtyUnitFeatureMap;
9
+ dirtyUnitOtherFormulaMap: IDirtyUnitOtherFormulaMap;
23
10
  options: Nullable<IExecutionOptions>;
24
11
  numfmtItemMap: INumfmtItemMap;
25
12
  forceCalculation?: boolean;
@@ -1,20 +1,6 @@
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
- import type { IMutation } from '@univerjs/core';
17
- import type { IFormulaData } from '../../basics/common';
1
+ import { IFormulaData } from '../../basics/common';
2
+ import { IMutation } from '@univerjs/core';
3
+
18
4
  export interface ISetFormulaDataMutationParams {
19
5
  formulaData: IFormulaData;
20
6
  }
@@ -1,20 +1,6 @@
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
- import type { IMutation } from '@univerjs/core';
17
- import type { INumfmtItemMap } from '../../basics/common';
1
+ import { INumfmtItemMap } from '../../basics/common';
2
+ import { IMutation } from '@univerjs/core';
3
+
18
4
  export interface ISetNumfmtFormulaDataMutationParams {
19
5
  numfmtItemMap: INumfmtItemMap;
20
6
  }
@@ -1,23 +1,19 @@
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
- import type { IMutation } from '@univerjs/core';
17
- import type { IOtherFormulaManagerInsertParam, IOtherFormulaManagerSearchParam } from '../../services/other-formula-manager.service';
1
+ import { IFormulaDataItem } from '../../basics/common';
2
+ import { IMutation } from '@univerjs/core';
3
+
4
+ export interface ISetOtherFormulaMutationParams {
5
+ unitId: string;
6
+ subUnitId: string;
7
+ formulaMap: Record<string, IFormulaDataItem>;
8
+ }
9
+ export interface IRemoveOtherFormulaMutationParams {
10
+ unitId: string;
11
+ subUnitId: string;
12
+ formulaIdList: string[];
13
+ }
18
14
  /**
19
15
  * In the formula engine, the mutation is solely responsible for communication between the worker and the main thread.
20
16
  * It requires setting local to true during execution.
21
17
  */
22
- export declare const SetOtherFormulaMutation: IMutation<IOtherFormulaManagerInsertParam>;
23
- export declare const RemoveOtherFormulaMutation: IMutation<IOtherFormulaManagerSearchParam>;
18
+ export declare const SetOtherFormulaMutation: IMutation<ISetOtherFormulaMutationParams>;
19
+ export declare const RemoveOtherFormulaMutation: IMutation<IRemoveOtherFormulaMutationParams>;
@@ -1,21 +1,7 @@
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
- import type { IMutation } from '@univerjs/core';
17
- import type { ISuperTable } from '../../basics/common';
18
- import type { ISuperTableOptionParam } from '../../services/super-table.service';
1
+ import { ISuperTableOptionParam } from '../../services/super-table.service';
2
+ import { ISuperTable } from '../../basics/common';
3
+ import { IMutation } from '@univerjs/core';
4
+
19
5
  export interface ISetSuperTableMutationSearchParam {
20
6
  unitId: string;
21
7
  tableName: string;
@@ -1,19 +1,5 @@
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
- import type { IMutation } from '@univerjs/core';
1
+ import { IMutation } from '@univerjs/core';
2
+
17
3
  /**
18
4
  *
19
5
  * Register function in main thread, then send function to worker thread.
@@ -1,21 +1,7 @@
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
- import { Disposable, ICommandService, IUniverInstanceService } from '@univerjs/core';
17
- import { FormulaDataModel } from '../models/formula-data.model';
18
1
  import { CalculateFormulaService } from '../services/calculate-formula.service';
2
+ import { FormulaDataModel } from '../models/formula-data.model';
3
+ import { Disposable, ICommandService, IUniverInstanceService } from '@univerjs/core';
4
+
19
5
  export declare class CalculateController extends Disposable {
20
6
  private readonly _commandService;
21
7
  private readonly _calculateFormulaService;
@@ -1,24 +1,9 @@
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
- import { Disposable, ICommandService } from '@univerjs/core';
17
- import type { Ctor } from '@wendellhu/redi';
18
- import { Injector } from '@wendellhu/redi';
19
- import type { IFunctionNames } from '../basics/function';
20
- import type { BaseFunction } from '../functions/base-function';
21
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
+ import { Disposable, ICommandService } from '@univerjs/core';
6
+
22
7
  export declare class FormulaController extends Disposable {
23
8
  private _function;
24
9
  private readonly _commandService;
@@ -1,21 +1,7 @@
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
- import { Disposable, ICommandService } from '@univerjs/core';
17
- import { FormulaDataModel } from '../models/formula-data.model';
18
1
  import { IFunctionService } from '../services/function.service';
2
+ import { FormulaDataModel } from '../models/formula-data.model';
3
+ import { Disposable, ICommandService } from '@univerjs/core';
4
+
19
5
  export declare class RegisterFunctionController extends Disposable {
20
6
  private readonly _commandService;
21
7
  private readonly _formulaDataModel;