@univerjs/engine-formula 0.1.0-beta.1 → 0.1.0-beta.2
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.
- package/lib/cjs/index.js +1 -1
- package/lib/es/index.js +3564 -3064
- package/lib/types/basics/common.d.ts +28 -26
- package/lib/types/basics/error-type.d.ts +1 -1
- package/lib/types/basics/function.d.ts +5 -1
- package/lib/types/basics/inverted-index-cache.d.ts +2 -2
- package/lib/types/basics/regex.d.ts +9 -10
- package/lib/types/commands/mutations/register-function.mutation.d.ts +30 -0
- package/lib/types/commands/mutations/unregister-function.mutation.d.ts +30 -0
- package/lib/types/controller/formula.controller.d.ts +5 -1
- package/lib/types/controller/register-function.controller.d.ts +26 -0
- package/lib/types/engine/analysis/__tests__/create-command-test-bed.d.ts +4 -0
- package/lib/types/engine/analysis/__tests__/parser.spec.d.ts +16 -0
- package/lib/types/engine/analysis/lexer-tree-builder.d.ts +1 -0
- package/lib/types/engine/ast-node/function-node.d.ts +11 -2
- package/lib/types/engine/ast-node/lambda-node.d.ts +0 -2
- package/lib/types/engine/ast-node/lambda-parameter-node.d.ts +0 -1
- package/lib/types/engine/dependency/dependency-tree.d.ts +3 -1
- package/lib/types/engine/reference-object/base-reference-object.d.ts +19 -14
- package/lib/types/engine/reference-object/range-reference-object.d.ts +2 -2
- package/lib/types/engine/utils/compare.d.ts +4 -0
- package/lib/types/engine/value-object/array-value-object.d.ts +12 -7
- package/lib/types/engine/value-object/base-value-object.d.ts +14 -0
- package/lib/types/engine/value-object/primitive-object.d.ts +1 -0
- package/lib/types/functions/array/function-map.d.ts +1 -3
- package/lib/types/functions/array/function-names.d.ts +0 -1
- package/lib/types/functions/base-function.d.ts +37 -2
- package/lib/types/functions/compatibility/function-map.d.ts +1 -3
- package/lib/types/functions/compatibility/function-names.d.ts +38 -1
- package/lib/types/functions/cube/function-names.d.ts +7 -0
- package/lib/types/functions/database/function-names.d.ts +12 -0
- package/lib/types/functions/date/function-names.d.ts +25 -0
- package/lib/types/functions/engineering/function-names.d.ts +54 -0
- package/lib/types/functions/financial/function-names.d.ts +55 -0
- package/lib/types/functions/information/function-names.d.ts +21 -0
- package/lib/types/functions/logical/function-map.d.ts +3 -1
- package/lib/types/functions/logical/function-names.d.ts +19 -0
- package/lib/types/functions/logical/lambda/index.d.ts +24 -0
- package/lib/types/functions/logical/makearray/__test__/index.spec.d.ts +16 -0
- package/lib/types/functions/lookup/address/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/lookup/address/index.d.ts +22 -0
- package/lib/types/functions/lookup/function-map.d.ts +4 -1
- package/lib/types/functions/lookup/function-names.d.ts +36 -1
- package/lib/types/functions/lookup/indirect/__test__/index.spec.d.ts +16 -0
- package/lib/types/functions/lookup/indirect/index.d.ts +4 -3
- package/lib/types/functions/lookup/vlookup/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/lookup/vlookup/index.d.ts +21 -0
- package/lib/types/functions/math/function-names.d.ts +75 -1
- package/lib/types/functions/math/sum/index.d.ts +1 -1
- package/lib/types/functions/meta/compare/index.d.ts +1 -2
- package/lib/types/functions/meta/divided/index.d.ts +1 -2
- package/lib/types/functions/meta/minus/index.d.ts +1 -2
- package/lib/types/functions/meta/multiply/index.d.ts +1 -2
- package/lib/types/functions/meta/plus/index.d.ts +2 -3
- package/lib/types/functions/statistical/function-names.d.ts +107 -1
- package/lib/types/functions/text/function-map.d.ts +3 -1
- package/lib/types/functions/text/function-names.d.ts +47 -0
- package/lib/types/functions/web/function-names.d.ts +3 -0
- package/lib/types/index.d.ts +19 -0
- package/lib/types/models/formula-data.model.d.ts +3 -1
- package/lib/types/plugin.d.ts +4 -0
- package/lib/types/services/current-data.service.d.ts +1 -0
- package/lib/types/services/feature-calculation-manager.service.d.ts +1 -1
- package/lib/types/services/function.service.d.ts +4 -0
- package/lib/types/services/other-formula-manager.service.d.ts +2 -2
- package/lib/types/services/runtime.service.d.ts +11 -5
- package/lib/umd/index.js +1 -1
- package/package.json +7 -7
- /package/lib/types/functions/{array → logical}/makearray/index.d.ts +0 -0
- /package/lib/types/functions/{compatibility → text}/concatenate/index.d.ts +0 -0
|
@@ -13,9 +13,8 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import type { FunctionVariantType } from '../../../engine/reference-object/base-reference-object';
|
|
17
16
|
import { type BaseValueObject } from '../../../engine/value-object/base-value-object';
|
|
18
17
|
import { BaseFunction } from '../../base-function';
|
|
19
18
|
export declare class Divided extends BaseFunction {
|
|
20
|
-
calculate(variant1:
|
|
19
|
+
calculate(variant1: BaseValueObject, variant2: BaseValueObject): BaseValueObject;
|
|
21
20
|
}
|
|
@@ -13,9 +13,8 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import type { FunctionVariantType } from '../../../engine/reference-object/base-reference-object';
|
|
17
16
|
import type { BaseValueObject } from '../../../engine/value-object/base-value-object';
|
|
18
17
|
import { BaseFunction } from '../../base-function';
|
|
19
18
|
export declare class Minus extends BaseFunction {
|
|
20
|
-
calculate(variant1:
|
|
19
|
+
calculate(variant1: BaseValueObject, variant2: BaseValueObject): BaseValueObject;
|
|
21
20
|
}
|
|
@@ -13,9 +13,8 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import type { FunctionVariantType } from '../../../engine/reference-object/base-reference-object';
|
|
17
16
|
import { type BaseValueObject } from '../../../engine/value-object/base-value-object';
|
|
18
17
|
import { BaseFunction } from '../../base-function';
|
|
19
18
|
export declare class Multiply extends BaseFunction {
|
|
20
|
-
calculate(variant1:
|
|
19
|
+
calculate(variant1: BaseValueObject, variant2: BaseValueObject): BaseValueObject;
|
|
21
20
|
}
|
|
@@ -13,9 +13,8 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import type {
|
|
17
|
-
import { type BaseValueObject } from '../../../engine/value-object/base-value-object';
|
|
16
|
+
import type { BaseValueObject } from '../../../engine/value-object/base-value-object';
|
|
18
17
|
import { BaseFunction } from '../../base-function';
|
|
19
18
|
export declare class Plus extends BaseFunction {
|
|
20
|
-
calculate(variant1:
|
|
19
|
+
calculate(variant1: BaseValueObject, variant2: BaseValueObject): BaseValueObject;
|
|
21
20
|
}
|
|
@@ -14,9 +14,115 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
export declare enum FUNCTION_NAMES_STATISTICAL {
|
|
17
|
+
AVEDEV = "AVEDEV",
|
|
17
18
|
AVERAGE = "AVERAGE",
|
|
19
|
+
AVERAGEA = "AVERAGEA",
|
|
20
|
+
AVERAGEIF = "AVERAGEIF",
|
|
21
|
+
AVERAGEIFS = "AVERAGEIFS",
|
|
22
|
+
BETA_DIST = "BETA.DIST",
|
|
23
|
+
BETA_INV = "BETA.INV",
|
|
24
|
+
BINOM_DIST = "BINOM.DIST",
|
|
25
|
+
BINOM_DIST_RANGE = "BINOM.DIST.RANGE",
|
|
26
|
+
BINOM_INV = "BINOM.INV",
|
|
27
|
+
CHISQ_DIST = "CHISQ.DIST",
|
|
28
|
+
CHISQ_DIST_RT = "CHISQ.DIST.RT",
|
|
29
|
+
CHISQ_INV = "CHISQ.INV",
|
|
30
|
+
CHISQ_INV_RT = "CHISQ.INV.RT",
|
|
31
|
+
CHISQ_TEST = "CHISQ.TEST",
|
|
32
|
+
CONFIDENCE_NORM = "CONFIDENCE.NORM",
|
|
33
|
+
CONFIDENCE_T = "CONFIDENCE.T",
|
|
34
|
+
CORREL = "CORREL",
|
|
18
35
|
COUNT = "COUNT",
|
|
36
|
+
COUNTA = "COUNTA",
|
|
37
|
+
COUNTBLANK = "COUNTBLANK",
|
|
38
|
+
COUNTIF = "COUNTIF",
|
|
39
|
+
COUNTIFS = "COUNTIFS",
|
|
40
|
+
COVARIANCE_P = "COVARIANCE.P",
|
|
41
|
+
COVARIANCE_S = "COVARIANCE.S",
|
|
42
|
+
DEVSQ = "DEVSQ",
|
|
43
|
+
EXPON_DIST = "EXPON.DIST",
|
|
44
|
+
F_DIST = "F.DIST",
|
|
45
|
+
F_DIST_RT = "F.DIST.RT",
|
|
46
|
+
F_INV = "F.INV",
|
|
47
|
+
F_INV_RT = "F.INV.RT",
|
|
48
|
+
F_TEST = "F.TEST",
|
|
49
|
+
FISHER = "FISHER",
|
|
50
|
+
FISHERINV = "FISHERINV",
|
|
51
|
+
FORECAST = "FORECAST",
|
|
52
|
+
FORECAST_ETS = "FORECAST.ETS",
|
|
53
|
+
FORECAST_ETS_CONFINT = "FORECAST.ETS.CONFINT",
|
|
54
|
+
FORECAST_ETS_SEASONALITY = "FORECAST.ETS.SEASONALITY",
|
|
55
|
+
FORECAST_ETS_STAT = "FORECAST.ETS.STAT",
|
|
56
|
+
FORECAST_LINEAR = "FORECAST.LINEAR",
|
|
57
|
+
FREQUENCY = "FREQUENCY",
|
|
58
|
+
GAMMA = "GAMMA",
|
|
59
|
+
GAMMA_DIST = "GAMMA.DIST",
|
|
60
|
+
GAMMA_INV = "GAMMA.INV",
|
|
61
|
+
GAMMALN = "GAMMALN",
|
|
62
|
+
GAMMALN_PRECISE = "GAMMALN.PRECISE",
|
|
63
|
+
GAUSS = "GAUSS",
|
|
64
|
+
GEOMEAN = "GEOMEAN",
|
|
65
|
+
GROWTH = "GROWTH",
|
|
66
|
+
HARMEAN = "HARMEAN",
|
|
67
|
+
HYPGEOM_DIST = "HYPGEOM.DIST",
|
|
68
|
+
INTERCEPT = "INTERCEPT",
|
|
69
|
+
KURT = "KURT",
|
|
70
|
+
LARGE = "LARGE",
|
|
71
|
+
LINEST = "LINEST",
|
|
72
|
+
LOGEST = "LOGEST",
|
|
73
|
+
LOGNORM_DIST = "LOGNORM.DIST",
|
|
74
|
+
LOGNORM_INV = "LOGNORM.INV",
|
|
19
75
|
MAX = "MAX",
|
|
76
|
+
MAXA = "MAXA",
|
|
77
|
+
MAXIFS = "MAXIFS",
|
|
78
|
+
MEDIAN = "MEDIAN",
|
|
20
79
|
MIN = "MIN",
|
|
21
|
-
|
|
80
|
+
MINA = "MINA",
|
|
81
|
+
MINIFS = "MINIFS",
|
|
82
|
+
MODE_MULT = "MODE.MULT",
|
|
83
|
+
MODE_SNGL = "MODE.SNGL",
|
|
84
|
+
NEGBINOM_DIST = "NEGBINOM.DIST",
|
|
85
|
+
NORM_DIST = "NORM.DIST",
|
|
86
|
+
NORM_INV = "NORM.INV",
|
|
87
|
+
NORM_S_DIST = "NORM.S.DIST",
|
|
88
|
+
NORM_S_INV = "NORM.S.INV",
|
|
89
|
+
PEARSON = "PEARSON",
|
|
90
|
+
PERCENTILE_EXC = "PERCENTILE.EXC",
|
|
91
|
+
PERCENTILE_INC = "PERCENTILE.INC",
|
|
92
|
+
PERCENTRANK_EXC = "PERCENTRANK.EXC",
|
|
93
|
+
PERCENTRANK_INC = "PERCENTRANK.INC",
|
|
94
|
+
PERMUT = "PERMUT",
|
|
95
|
+
PERMUTATIONA = "PERMUTATIONA",
|
|
96
|
+
PHI = "PHI",
|
|
97
|
+
POISSON_DIST = "POISSON.DIST",
|
|
98
|
+
PROB = "PROB",
|
|
99
|
+
QUARTILE_EXC = "QUARTILE.EXC",
|
|
100
|
+
QUARTILE_INC = "QUARTILE.INC",
|
|
101
|
+
RANK_AVG = "RANK.AVG",
|
|
102
|
+
RANK_EQ = "RANK.EQ",
|
|
103
|
+
RSQ = "RSQ",
|
|
104
|
+
SKEW = "SKEW",
|
|
105
|
+
SKEW_P = "SKEW.P",
|
|
106
|
+
SLOPE = "SLOPE",
|
|
107
|
+
SMALL = "SMALL",
|
|
108
|
+
STANDARDIZE = "STANDARDIZE",
|
|
109
|
+
STDEV_P = "STDEV.P",
|
|
110
|
+
STDEV_S = "STDEV.S",
|
|
111
|
+
STDEVA = "STDEVA",
|
|
112
|
+
STDEVPA = "STDEVPA",
|
|
113
|
+
STEYX = "STEYX",
|
|
114
|
+
T_DIST = "T.DIST",
|
|
115
|
+
T_DIST_2T = "T.DIST.2T",
|
|
116
|
+
T_DIST_RT = "T.DIST.RT",
|
|
117
|
+
T_INV = "T.INV",
|
|
118
|
+
T_INV_2T = "T.INV.2T",
|
|
119
|
+
T_TEST = "T.TEST",
|
|
120
|
+
TREND = "TREND",
|
|
121
|
+
TRIMMEAN = "TRIMMEAN",
|
|
122
|
+
VAR_P = "VAR.P",
|
|
123
|
+
VAR_S = "VAR.S",
|
|
124
|
+
VARA = "VARA",
|
|
125
|
+
VARPA = "VARPA",
|
|
126
|
+
WEIBULL_DIST = "WEIBULL.DIST",
|
|
127
|
+
Z_TEST = "Z.TEST"
|
|
22
128
|
}
|
|
@@ -13,4 +13,6 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
|
|
16
|
+
import { Concatenate } from './concatenate';
|
|
17
|
+
import { FUNCTION_NAMES_TEXT } from './function-names';
|
|
18
|
+
export declare const functionText: (FUNCTION_NAMES_TEXT | typeof Concatenate)[][];
|
|
@@ -14,4 +14,51 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
export declare enum FUNCTION_NAMES_TEXT {
|
|
17
|
+
ASC = "ASC",
|
|
18
|
+
ARRAYTOTEXT = "ARRAYTOTEXT",
|
|
19
|
+
BAHTTEXT = "BAHTTEXT",
|
|
20
|
+
CHAR = "CHAR",
|
|
21
|
+
CLEAN = "CLEAN",
|
|
22
|
+
CODE = "CODE",
|
|
23
|
+
CONCAT = "CONCAT",
|
|
24
|
+
CONCATENATE = "CONCATENATE",
|
|
25
|
+
DBCS = "DBCS",
|
|
26
|
+
DOLLAR = "DOLLAR",
|
|
27
|
+
EXACT = "EXACT",
|
|
28
|
+
FIND = "FIND",
|
|
29
|
+
FINDB = "FINDB",
|
|
30
|
+
FIXED = "FIXED",
|
|
31
|
+
LEFT = "LEFT",
|
|
32
|
+
LEFTB = "LEFTB",
|
|
33
|
+
LEN = "LEN",
|
|
34
|
+
LENB = "LENB",
|
|
35
|
+
LOWER = "LOWER",
|
|
36
|
+
MID = "MID",
|
|
37
|
+
MIDB = "MIDB",
|
|
38
|
+
NUMBERVALUE = "NUMBERVALUE",
|
|
39
|
+
PHONETIC = "PHONETIC",
|
|
40
|
+
PROPER = "PROPER",
|
|
41
|
+
REPLACE = "REPLACE",
|
|
42
|
+
REPLACEB = "REPLACEB",
|
|
43
|
+
REPT = "REPT",
|
|
44
|
+
RIGHT = "RIGHT",
|
|
45
|
+
RIGHTB = "RIGHTB",
|
|
46
|
+
SEARCH = "SEARCH",
|
|
47
|
+
SEARCHB = "SEARCHB",
|
|
48
|
+
SUBSTITUTE = "SUBSTITUTE",
|
|
49
|
+
T = "T",
|
|
50
|
+
TEXT = "TEXT",
|
|
51
|
+
TEXTAFTER = "TEXTAFTER",
|
|
52
|
+
TEXTBEFORE = "TEXTBEFORE",
|
|
53
|
+
TEXTJOIN = "TEXTJOIN",
|
|
54
|
+
TEXTSPLIT = "TEXTSPLIT",
|
|
55
|
+
TRIM = "TRIM",
|
|
56
|
+
UNICHAR = "UNICHAR",
|
|
57
|
+
UNICODE = "UNICODE",
|
|
58
|
+
UPPER = "UPPER",
|
|
59
|
+
VALUE = "VALUE",
|
|
60
|
+
VALUETOTEXT = "VALUETOTEXT",
|
|
61
|
+
CALL = "CALL",
|
|
62
|
+
EUROCONVERT = "EUROCONVERT",
|
|
63
|
+
REGISTER_ID = "REGISTER.ID"
|
|
17
64
|
}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ export { includeFormulaLexerToken, isFormulaLexerToken, normalizeSheetName } fro
|
|
|
22
22
|
export { convertUnitDataToRuntime } from './basics/runtime';
|
|
23
23
|
export { matchToken } from './basics/token';
|
|
24
24
|
export { compareToken } from './basics/token';
|
|
25
|
+
export { RegisterFunctionMutation } from './commands/mutations/register-function.mutation';
|
|
25
26
|
export { type ISetArrayFormulaDataMutationParams, SetArrayFormulaDataMutation, SetArrayFormulaDataUndoMutationFactory, } from './commands/mutations/set-array-formula-data.mutation';
|
|
26
27
|
export { RemoveDefinedNameMutation, SetDefinedNameMutation } from './commands/mutations/set-defined-name.mutation';
|
|
27
28
|
export { RemoveFeatureCalculationMutation, SetFeatureCalculationMutation, } from './commands/mutations/set-feature-calculation.mutation';
|
|
@@ -29,6 +30,7 @@ export { type ISetFormulaCalculationNotificationMutation, type ISetFormulaCalcul
|
|
|
29
30
|
export { type ISetFormulaDataMutationParams, SetFormulaDataMutation, } from './commands/mutations/set-formula-data.mutation';
|
|
30
31
|
export { RemoveOtherFormulaMutation, SetOtherFormulaMutation } from './commands/mutations/set-other-formula.mutation';
|
|
31
32
|
export { RemoveSuperTableMutation, SetSuperTableMutation, SetSuperTableOptionMutation, } from './commands/mutations/set-super-table.mutation';
|
|
33
|
+
export { UnregisterFunctionMutation } from './commands/mutations/unregister-function.mutation';
|
|
32
34
|
export { LexerNode } from './engine/analysis/lexer-node';
|
|
33
35
|
export { LexerTreeBuilder } from './engine/analysis/lexer-tree-builder';
|
|
34
36
|
export { BaseReferenceObject, type FunctionVariantType } from './engine/reference-object/base-reference-object';
|
|
@@ -36,24 +38,41 @@ export { RangeReferenceObject } from './engine/reference-object/range-reference-
|
|
|
36
38
|
export { generateStringWithSequence, type ISequenceNode, sequenceNodeType } from './engine/utils/sequence';
|
|
37
39
|
export { ArrayValueObject, ValueObjectFactory } from './engine/value-object/array-value-object';
|
|
38
40
|
export { BaseValueObject, ErrorValueObject } from './engine/value-object/base-value-object';
|
|
41
|
+
export type { PrimitiveValueType } from './engine/value-object/primitive-object';
|
|
39
42
|
export { NumberValueObject } from './engine/value-object/primitive-object';
|
|
40
43
|
export { BooleanValueObject } from './engine/value-object/primitive-object';
|
|
41
44
|
export { StringValueObject } from './engine/value-object/primitive-object';
|
|
45
|
+
export { functionArray } from './functions/array/function-map';
|
|
42
46
|
export { FUNCTION_NAMES_ARRAY } from './functions/array/function-names';
|
|
43
47
|
export { BaseFunction } from './functions/base-function';
|
|
48
|
+
export { functionCompatibility } from './functions/compatibility/function-map';
|
|
44
49
|
export { FUNCTION_NAMES_COMPATIBILITY } from './functions/compatibility/function-names';
|
|
50
|
+
export { functionCube } from './functions/cube/function-map';
|
|
45
51
|
export { FUNCTION_NAMES_CUBE } from './functions/cube/function-names';
|
|
52
|
+
export { functionDatabase } from './functions/database/function-map';
|
|
46
53
|
export { FUNCTION_NAMES_DATABASE } from './functions/database/function-names';
|
|
54
|
+
export { functionDate } from './functions/date/function-map';
|
|
47
55
|
export { FUNCTION_NAMES_DATE } from './functions/date/function-names';
|
|
56
|
+
export { functionEngineering } from './functions/engineering/function-map';
|
|
48
57
|
export { FUNCTION_NAMES_ENGINEERING } from './functions/engineering/function-names';
|
|
58
|
+
export { functionFinancial } from './functions/financial/function-map';
|
|
49
59
|
export { FUNCTION_NAMES_FINANCIAL } from './functions/financial/function-names';
|
|
60
|
+
export { functionInformation } from './functions/information/function-map';
|
|
50
61
|
export { FUNCTION_NAMES_INFORMATION } from './functions/information/function-names';
|
|
62
|
+
export { functionLogical } from './functions/logical/function-map';
|
|
51
63
|
export { FUNCTION_NAMES_LOGICAL } from './functions/logical/function-names';
|
|
64
|
+
export { functionLookup } from './functions/lookup/function-map';
|
|
52
65
|
export { FUNCTION_NAMES_LOOKUP } from './functions/lookup/function-names';
|
|
66
|
+
export { functionMath } from './functions/math/function-map';
|
|
53
67
|
export { FUNCTION_NAMES_MATH } from './functions/math/function-names';
|
|
68
|
+
export { functionMeta } from './functions/meta/function-map';
|
|
69
|
+
export { functionStatistical } from './functions/statistical/function-map';
|
|
54
70
|
export { FUNCTION_NAMES_STATISTICAL } from './functions/statistical/function-names';
|
|
71
|
+
export { functionText } from './functions/text/function-map';
|
|
55
72
|
export { FUNCTION_NAMES_TEXT } from './functions/text/function-names';
|
|
73
|
+
export { functionUniver } from './functions/univer/function-map';
|
|
56
74
|
export { FUNCTION_NAMES_UNIVER } from './functions/univer/function-names';
|
|
75
|
+
export { functionWeb } from './functions/web/function-map';
|
|
57
76
|
export { FUNCTION_NAMES_WEB } from './functions/web/function-names';
|
|
58
77
|
export { FormulaDataModel } from './models/formula-data.model';
|
|
59
78
|
export { initSheetFormulaData } from './models/formula-data.model';
|
|
@@ -45,8 +45,10 @@ export declare class FormulaDataModel extends Disposable {
|
|
|
45
45
|
unitSheetNameMap: IUnitSheetNameMap;
|
|
46
46
|
};
|
|
47
47
|
updateFormulaData(unitId: string, sheetId: string, cellValue: IObjectMatrixPrimitiveType<Nullable<ICellData>>): void;
|
|
48
|
+
updateArrayFormulaRange(unitId: string, sheetId: string, cellValue: IObjectMatrixPrimitiveType<Nullable<ICellData>>): void;
|
|
49
|
+
updateArrayFormulaCellData(unitId: string, sheetId: string, cellValue: IObjectMatrixPrimitiveType<Nullable<ICellData>>): void;
|
|
48
50
|
getFormulaItemBySId(sId: string, sheetId: string, unitId: string): Nullable<IFormulaDataItem>;
|
|
49
|
-
getFormulaDataItem(row: number, column: number, sheetId: string, unitId: string): IFormulaDataItem;
|
|
51
|
+
getFormulaDataItem(row: number, column: number, sheetId: string, unitId: string): IFormulaDataItem | undefined;
|
|
50
52
|
getFormulaIdMap(unitId: string, sheetId: string): Map<string, IFormulaIdMap>;
|
|
51
53
|
}
|
|
52
54
|
export declare function initSheetFormulaData(formulaData: IFormulaData, unitId: string, sheetId: string, cellMatrix: ObjectMatrix<Nullable<ICellData>>): void;
|
package/lib/types/plugin.d.ts
CHANGED
|
@@ -14,9 +14,13 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import { Plugin } from '@univerjs/core';
|
|
17
|
+
import type { Ctor } from '@wendellhu/redi';
|
|
17
18
|
import { Injector } from '@wendellhu/redi';
|
|
19
|
+
import type { IFunctionNames } from './basics/function';
|
|
20
|
+
import type { BaseFunction } from './functions/base-function';
|
|
18
21
|
interface IUniverFormulaEngine {
|
|
19
22
|
notExecuteFormula?: boolean;
|
|
23
|
+
function: Array<[Ctor<BaseFunction>, IFunctionNames]>;
|
|
20
24
|
}
|
|
21
25
|
export declare class UniverFormulaEnginePlugin extends Plugin {
|
|
22
26
|
private _config;
|
|
@@ -31,6 +31,7 @@ export interface IFormulaCurrentConfigService {
|
|
|
31
31
|
registerSheetNameMap(sheetNameMap: IUnitSheetNameMap): void;
|
|
32
32
|
getExcludedRange(): Nullable<IUnitExcludedCell>;
|
|
33
33
|
loadDirtyRangesAndExcludedCell(dirtyRanges: IUnitRange[], excludedCell?: IUnitExcludedCell): void;
|
|
34
|
+
getArrayFormulaCellData(): IRuntimeUnitDataType;
|
|
34
35
|
}
|
|
35
36
|
export declare class FormulaCurrentConfigService extends Disposable implements IFormulaCurrentConfigService {
|
|
36
37
|
private readonly _currentUniverService;
|
|
@@ -19,7 +19,7 @@ import type { IFeatureDirtyRangeType, IRuntimeUnitDataType } from '../basics/com
|
|
|
19
19
|
import type { FormulaDependencyTree } from '../engine/dependency/dependency-tree';
|
|
20
20
|
export interface IFeatureCalculationManagerParam {
|
|
21
21
|
unitId: string;
|
|
22
|
-
|
|
22
|
+
subUnitId: string;
|
|
23
23
|
dependencyRanges: IUnitRange[];
|
|
24
24
|
getDirtyData: (currentDependencyTree: FormulaDependencyTree) => {
|
|
25
25
|
runtimeCellData: IRuntimeUnitDataType;
|
|
@@ -35,10 +35,12 @@ export interface IFunctionService {
|
|
|
35
35
|
*/
|
|
36
36
|
getExecutor(functionToken: IFunctionNames): Nullable<BaseFunction>;
|
|
37
37
|
hasExecutor(functionToken: IFunctionNames): boolean;
|
|
38
|
+
unregisterExecutors(...functionTokens: IFunctionNames[]): void;
|
|
38
39
|
registerDescriptions(...functions: IFunctionInfo[]): void;
|
|
39
40
|
getDescriptions(): Map<IFunctionNames, IFunctionInfo>;
|
|
40
41
|
getDescription(functionToken: IFunctionNames): Nullable<IFunctionInfo>;
|
|
41
42
|
hasDescription(functionToken: IFunctionNames): boolean;
|
|
43
|
+
unregisterDescriptions(...functionTokens: IFunctionNames[]): void;
|
|
42
44
|
}
|
|
43
45
|
export declare class FunctionService extends Disposable implements IFunctionService {
|
|
44
46
|
private _functionExecutors;
|
|
@@ -48,9 +50,11 @@ export declare class FunctionService extends Disposable implements IFunctionServ
|
|
|
48
50
|
getExecutors(): Map<IFunctionNames, BaseFunction>;
|
|
49
51
|
getExecutor(functionToken: IFunctionNames): BaseFunction | undefined;
|
|
50
52
|
hasExecutor(functionToken: IFunctionNames): boolean;
|
|
53
|
+
unregisterExecutors(...functionTokens: IFunctionNames[]): void;
|
|
51
54
|
registerDescriptions(...descriptions: IFunctionInfo[]): void;
|
|
52
55
|
getDescriptions(): Map<IFunctionNames, IFunctionInfo>;
|
|
53
56
|
getDescription(functionToken: IFunctionNames): IFunctionInfo | undefined;
|
|
54
57
|
hasDescription(functionToken: IFunctionNames): boolean;
|
|
58
|
+
unregisterDescriptions(...functionTokens: IFunctionNames[]): void;
|
|
55
59
|
}
|
|
56
60
|
export declare const IFunctionService: import("@wendellhu/redi").IdentifierDecorator<FunctionService>;
|
|
@@ -18,7 +18,7 @@ import { Disposable } from '@univerjs/core';
|
|
|
18
18
|
import type { IFormulaDataItem, IOtherFormulaData } from '../basics/common';
|
|
19
19
|
export interface IOtherFormulaManagerSearchParam {
|
|
20
20
|
unitId: string;
|
|
21
|
-
|
|
21
|
+
subUnitId: string;
|
|
22
22
|
formulaId: string;
|
|
23
23
|
}
|
|
24
24
|
export interface IOtherFormulaManagerInsertParam extends IOtherFormulaManagerSearchParam {
|
|
@@ -42,7 +42,7 @@ export declare class OtherFormulaManagerService extends Disposable implements IO
|
|
|
42
42
|
private _otherFormulaData;
|
|
43
43
|
dispose(): void;
|
|
44
44
|
remove(searchParam: IOtherFormulaManagerSearchParam): void;
|
|
45
|
-
get(searchParam: IOtherFormulaManagerSearchParam): IFormulaDataItem;
|
|
45
|
+
get(searchParam: IOtherFormulaManagerSearchParam): IFormulaDataItem | undefined;
|
|
46
46
|
has(searchParam: IOtherFormulaManagerSearchParam): boolean;
|
|
47
47
|
register(insertParam: IOtherFormulaManagerInsertParam): void;
|
|
48
48
|
getOtherFormulaData(): IOtherFormulaData;
|
|
@@ -68,11 +68,11 @@ export interface IExecutionInProgressParams {
|
|
|
68
68
|
export interface IFormulaRuntimeService {
|
|
69
69
|
currentRow: number;
|
|
70
70
|
currentColumn: number;
|
|
71
|
-
|
|
71
|
+
currentSubUnitId: string;
|
|
72
72
|
currentUnitId: string;
|
|
73
73
|
dispose(): void;
|
|
74
74
|
reset(): void;
|
|
75
|
-
setCurrent(row: number, column: number, sheetId: string, unitId: string): void;
|
|
75
|
+
setCurrent(row: number, column: number, rowCount: number, columnCount: number, sheetId: string, unitId: string): void;
|
|
76
76
|
registerFunctionDefinitionPrivacyVar(lambdaId: string, lambdaVar: Map<string, Nullable<BaseAstNode>>): void;
|
|
77
77
|
getFunctionDefinitionPrivacyVar(lambdaId: string): Nullable<Map<string, Nullable<BaseAstNode>>>;
|
|
78
78
|
setRuntimeData(functionVariant: FunctionVariantType): void;
|
|
@@ -117,7 +117,9 @@ export declare class FormulaRuntimeService extends Disposable implements IFormul
|
|
|
117
117
|
private _stopState;
|
|
118
118
|
private _currentRow;
|
|
119
119
|
private _currentColumn;
|
|
120
|
-
private
|
|
120
|
+
private _currentRowCount;
|
|
121
|
+
private _currentColumnCount;
|
|
122
|
+
private _currentSubUnitId;
|
|
121
123
|
private _currentUnitId;
|
|
122
124
|
private _runtimeData;
|
|
123
125
|
private _runtimeOtherData;
|
|
@@ -136,7 +138,9 @@ export declare class FormulaRuntimeService extends Disposable implements IFormul
|
|
|
136
138
|
constructor(_currentConfigService: IFormulaCurrentConfigService);
|
|
137
139
|
get currentRow(): number;
|
|
138
140
|
get currentColumn(): number;
|
|
139
|
-
get
|
|
141
|
+
get currentRowCount(): number;
|
|
142
|
+
get currentColumnCount(): number;
|
|
143
|
+
get currentSubUnitId(): string;
|
|
140
144
|
get currentUnitId(): string;
|
|
141
145
|
dispose(): void;
|
|
142
146
|
enableCycleDependency(): void;
|
|
@@ -159,7 +163,7 @@ export declare class FormulaRuntimeService extends Disposable implements IFormul
|
|
|
159
163
|
setFormulaExecuteStage(type: FormulaExecuteStageType): void;
|
|
160
164
|
getFormulaExecuteStage(): FormulaExecuteStageType;
|
|
161
165
|
reset(): void;
|
|
162
|
-
setCurrent(row: number, column: number, sheetId: string, unitId: string): void;
|
|
166
|
+
setCurrent(row: number, column: number, rowCount: number, columnCount: number, sheetId: string, unitId: string): void;
|
|
163
167
|
clearFunctionDefinitionPrivacyVar(): void;
|
|
164
168
|
registerFunctionDefinitionPrivacyVar(lambdaId: string, lambdaVar: Map<string, Nullable<BaseAstNode>>): void;
|
|
165
169
|
getFunctionDefinitionPrivacyVar(lambdaId: string): Nullable<Map<string, Nullable<BaseAstNode>>>;
|
|
@@ -182,6 +186,8 @@ export declare class FormulaRuntimeService extends Disposable implements IFormul
|
|
|
182
186
|
getRuntimeState(): IExecutionInProgressParams;
|
|
183
187
|
private _objectValueToCellValue;
|
|
184
188
|
private _checkIfArrayFormulaRangeHasData;
|
|
189
|
+
private _isInArrayFormulaRange;
|
|
190
|
+
private _checkIfArrayFormulaExceeded;
|
|
185
191
|
private _isInDirtyRange;
|
|
186
192
|
}
|
|
187
193
|
export declare const IFormulaRuntimeService: import("@wendellhu/redi").IdentifierDecorator<FormulaRuntimeService>;
|