@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.
- package/lib/cjs/index.js +1 -1
- package/lib/es/index.js +4520 -3304
- package/lib/types/basics/calculate.d.ts +1 -15
- package/lib/types/basics/common.d.ts +16 -17
- package/lib/types/basics/date.d.ts +1 -1
- package/lib/types/basics/dirty.d.ts +2 -16
- package/lib/types/basics/format.d.ts +24 -0
- package/lib/types/basics/function.d.ts +18 -32
- package/lib/types/basics/inverted-index-cache.d.ts +2 -2
- package/lib/types/basics/match-token.d.ts +1 -15
- package/lib/types/basics/object-class-type.d.ts +6 -15
- package/lib/types/basics/runtime.d.ts +2 -16
- package/lib/types/commands/mutations/register-function.mutation.d.ts +2 -16
- package/lib/types/commands/mutations/set-array-formula-data.mutation.d.ts +4 -18
- package/lib/types/commands/mutations/set-defined-name.mutation.d.ts +2 -16
- package/lib/types/commands/mutations/set-feature-calculation.mutation.d.ts +3 -17
- package/lib/types/commands/mutations/set-formula-calculation.mutation.d.ts +5 -18
- package/lib/types/commands/mutations/set-formula-data.mutation.d.ts +3 -17
- package/lib/types/commands/mutations/set-numfmt-formula-data.mutation.d.ts +3 -17
- package/lib/types/commands/mutations/set-other-formula.mutation.d.ts +15 -19
- package/lib/types/commands/mutations/set-super-table.mutation.d.ts +4 -18
- package/lib/types/commands/mutations/unregister-function.mutation.d.ts +2 -16
- package/lib/types/controller/calculate.controller.d.ts +3 -17
- package/lib/types/controller/formula.controller.d.ts +5 -20
- package/lib/types/controller/register-function.controller.d.ts +3 -17
- package/lib/types/controller/set-defined-name.controller.d.ts +2 -16
- package/lib/types/controller/set-feature-calculation.controller.d.ts +2 -16
- package/lib/types/controller/set-other-formula.controller.d.ts +2 -16
- package/lib/types/controller/set-super-table.controller.d.ts +2 -16
- package/lib/types/engine/analysis/__tests__/create-command-test-bed.d.ts +11 -26
- package/lib/types/engine/analysis/lexer-node.d.ts +3 -17
- package/lib/types/engine/analysis/lexer-tree-builder.d.ts +5 -19
- package/lib/types/engine/analysis/lexer.d.ts +5 -19
- package/lib/types/engine/analysis/parser.d.ts +14 -29
- package/lib/types/engine/ast-node/ast-root-node.d.ts +4 -18
- package/lib/types/engine/ast-node/base-ast-node-factory.d.ts +3 -18
- package/lib/types/engine/ast-node/base-ast-node.d.ts +6 -21
- package/lib/types/engine/ast-node/function-node.d.ts +10 -24
- package/lib/types/engine/ast-node/lambda-node.d.ts +6 -20
- package/lib/types/engine/ast-node/lambda-parameter-node.d.ts +4 -19
- package/lib/types/engine/ast-node/null-node.d.ts +2 -16
- package/lib/types/engine/ast-node/operator-node.d.ts +6 -20
- package/lib/types/engine/ast-node/prefix-node.d.ts +8 -23
- package/lib/types/engine/ast-node/reference-node.d.ts +10 -25
- package/lib/types/engine/ast-node/suffix-node.d.ts +7 -22
- package/lib/types/engine/ast-node/union-node.d.ts +5 -19
- package/lib/types/engine/ast-node/value-node.d.ts +4 -18
- package/lib/types/engine/dependency/dependency-tree.d.ts +24 -23
- package/lib/types/engine/dependency/formula-dependency.d.ts +11 -31
- package/lib/types/engine/interpreter/interpreter.d.ts +6 -20
- package/lib/types/engine/reference-object/base-reference-object.d.ts +22 -32
- package/lib/types/engine/reference-object/cell-reference-object.d.ts +4 -18
- package/lib/types/engine/reference-object/column-reference-object.d.ts +2 -16
- package/lib/types/engine/reference-object/range-reference-object.d.ts +2 -16
- package/lib/types/engine/reference-object/row-reference-object.d.ts +2 -16
- package/lib/types/engine/reference-object/table-reference-object.d.ts +2 -17
- package/lib/types/engine/utils/array-object.d.ts +3 -17
- package/lib/types/engine/utils/ast-node-tool.d.ts +3 -17
- package/lib/types/engine/utils/cell.d.ts +2 -16
- package/lib/types/engine/utils/char-kit.d.ts +25 -0
- package/lib/types/engine/utils/compare.d.ts +1 -15
- package/lib/types/engine/utils/function-definition.d.ts +1 -15
- package/lib/types/engine/utils/node-type.d.ts +5 -19
- package/lib/types/engine/utils/object-compare.d.ts +2 -17
- package/lib/types/engine/utils/prefixHandler.d.ts +4 -18
- package/lib/types/engine/utils/r1c1-reference.d.ts +2 -16
- package/lib/types/engine/utils/reference.d.ts +3 -18
- package/lib/types/engine/utils/sequence.d.ts +2 -16
- package/lib/types/engine/utils/value-object.d.ts +6 -0
- package/lib/types/engine/{utils/object-covert.d.ts → value-object/__tests__/array-value-divided.spec.d.ts} +1 -3
- package/lib/types/engine/value-object/__tests__/array-value-minus.spec.d.ts +16 -0
- package/lib/types/engine/value-object/__tests__/array-value-multiply.spec.d.ts +16 -0
- package/lib/types/engine/value-object/__tests__/array-value-plus.spec.d.ts +16 -0
- package/lib/types/engine/value-object/array-value-object.d.ts +11 -26
- package/lib/types/engine/value-object/base-value-object.d.ts +12 -23
- package/lib/types/engine/value-object/cube-value-object.d.ts +4 -17
- package/lib/types/engine/value-object/lambda-value-object.d.ts +5 -18
- package/lib/types/engine/value-object/primitive-object.d.ts +26 -19
- package/lib/types/functions/__tests__/create-function-test-bed.d.ts +13 -26
- package/lib/types/functions/base-function.d.ts +10 -31
- package/lib/types/functions/compatibility/function-map.d.ts +2 -16
- package/lib/types/functions/date/date/index.d.ts +2 -16
- package/lib/types/functions/date/day/index.d.ts +2 -16
- package/lib/types/functions/date/edate/index.d.ts +2 -16
- package/lib/types/functions/date/function-map.d.ts +2 -16
- package/lib/types/functions/date/month/index.d.ts +2 -16
- package/lib/types/functions/date/today/index.d.ts +3 -18
- package/lib/types/functions/date/year/index.d.ts +2 -16
- package/lib/types/functions/information/function-map.d.ts +2 -16
- package/lib/types/functions/information/isblank/index.d.ts +2 -16
- package/lib/types/functions/information/iserr/index.d.ts +2 -16
- package/lib/types/functions/information/iserror/index.d.ts +2 -16
- package/lib/types/functions/information/islogical/index.d.ts +2 -16
- package/lib/types/functions/information/isna/index.d.ts +2 -16
- package/lib/types/functions/information/isnontext/index.d.ts +2 -16
- package/lib/types/functions/information/isnumber/index.d.ts +2 -16
- package/lib/types/functions/information/isref/index.d.ts +3 -17
- package/lib/types/functions/information/istext/index.d.ts +2 -16
- package/lib/types/functions/logical/and/index.d.ts +2 -16
- package/lib/types/functions/logical/function-map.d.ts +4 -18
- package/lib/types/functions/logical/if/index.d.ts +2 -16
- package/lib/types/functions/logical/iferror/index.d.ts +3 -17
- package/lib/types/functions/logical/lambda/index.d.ts +2 -16
- package/lib/types/functions/logical/makearray/index.d.ts +3 -17
- package/lib/types/functions/logical/or/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/logical/or/index.d.ts +6 -0
- package/lib/types/functions/lookup/address/index.d.ts +2 -16
- package/lib/types/functions/lookup/column/index.d.ts +3 -17
- package/lib/types/functions/lookup/columns/index.d.ts +2 -16
- package/lib/types/functions/lookup/function-map.d.ts +12 -25
- package/lib/types/functions/lookup/hlookup/index.d.ts +2 -16
- package/lib/types/functions/lookup/index/index.d.ts +8 -15
- package/lib/types/functions/lookup/indirect/index.d.ts +3 -17
- package/lib/types/functions/lookup/lookup/index.d.ts +3 -17
- package/lib/types/functions/lookup/match/index.d.ts +3 -17
- package/lib/types/functions/lookup/offset/index.d.ts +5 -19
- package/lib/types/functions/lookup/row/index.d.ts +3 -17
- package/lib/types/functions/lookup/rows/index.d.ts +2 -16
- package/lib/types/functions/lookup/vlookup/index.d.ts +5 -17
- package/lib/types/functions/lookup/xlookup/index.d.ts +3 -17
- package/lib/types/functions/lookup/xmatch/index.d.ts +3 -17
- package/lib/types/functions/math/abs/index.d.ts +2 -16
- package/lib/types/functions/math/acos/index.d.ts +2 -16
- package/lib/types/functions/math/acosh/index.d.ts +2 -16
- package/lib/types/functions/math/acot/index.d.ts +2 -16
- package/lib/types/functions/math/function-map.d.ts +4 -18
- package/lib/types/functions/math/mod/index.d.ts +2 -16
- package/lib/types/functions/math/power/index.d.ts +2 -16
- package/lib/types/functions/math/product/index.d.ts +2 -16
- package/lib/types/functions/math/subtotal/index.d.ts +3 -17
- package/lib/types/functions/math/sum/index.d.ts +2 -16
- package/lib/types/functions/math/sumif/index.d.ts +2 -16
- package/lib/types/functions/math/sumifs/index.d.ts +3 -18
- package/lib/types/functions/meta/compare/index.d.ts +3 -17
- package/lib/types/functions/meta/cube/index.d.ts +2 -16
- package/lib/types/functions/meta/divided/index.d.ts +2 -16
- package/lib/types/functions/meta/function-map.d.ts +2 -16
- package/lib/types/functions/meta/minus/index.d.ts +2 -16
- package/lib/types/functions/meta/multiply/index.d.ts +2 -16
- package/lib/types/functions/meta/plus/index.d.ts +2 -16
- package/lib/types/functions/statistical/average/index.d.ts +2 -16
- package/lib/types/functions/statistical/count/index.d.ts +2 -16
- package/lib/types/functions/statistical/counta/index.d.ts +2 -16
- package/lib/types/functions/statistical/function-map.d.ts +2 -16
- package/lib/types/functions/statistical/max/index.d.ts +2 -16
- package/lib/types/functions/statistical/min/index.d.ts +2 -16
- package/lib/types/functions/statistical/stdev-p/index.d.ts +3 -17
- package/lib/types/functions/statistical/stdev-s/index.d.ts +3 -17
- package/lib/types/functions/statistical/stdeva/index.d.ts +3 -17
- package/lib/types/functions/statistical/stdevpa/index.d.ts +3 -17
- package/lib/types/functions/statistical/var-p/index.d.ts +3 -17
- package/lib/types/functions/statistical/var-s/index.d.ts +3 -17
- package/lib/types/functions/statistical/vara/index.d.ts +3 -17
- package/lib/types/functions/statistical/varpa/index.d.ts +3 -17
- package/lib/types/functions/text/concatenate/index.d.ts +2 -16
- package/lib/types/functions/text/function-map.d.ts +2 -16
- package/lib/types/functions/text/len/__test__/index.spec.d.ts +16 -0
- package/lib/types/functions/text/len/index.d.ts +7 -0
- package/lib/types/functions/text/lenb/__test__/index.spec.d.ts +16 -0
- package/lib/types/functions/text/lenb/index.d.ts +7 -0
- package/lib/types/functions/text/text/__test__/index.spec.d.ts +16 -0
- package/lib/types/functions/text/text/index.d.ts +6 -0
- package/lib/types/index.d.ts +8 -3
- package/lib/types/models/__tests__/create-command-test-bed.d.ts +10 -25
- package/lib/types/models/formula-data.model.d.ts +3 -18
- package/lib/types/plugin.d.ts +5 -20
- package/lib/types/services/active-dirty-manager.service.d.ts +34 -0
- package/lib/types/services/calculate-formula.service.d.ts +12 -27
- package/lib/types/services/current-data.service.d.ts +10 -19
- package/lib/types/services/defined-names.service.d.ts +3 -18
- package/lib/types/services/feature-calculation-manager.service.d.ts +5 -20
- package/lib/types/services/function.service.d.ts +5 -20
- package/lib/types/services/other-formula-manager.service.d.ts +8 -19
- package/lib/types/services/runtime.service.d.ts +6 -21
- package/lib/types/services/super-table.service.d.ts +4 -19
- package/lib/umd/index.js +1 -1
- package/package.json +12 -10
- /package/lib/types/engine/utils/__tests__/{object-covert.spec.d.ts → value-object.spec.d.ts} +0 -0
|
@@ -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
|
-
*/
|
|
1
|
+
import { BaseValueObject } from '../value-object/base-value-object';
|
|
16
2
|
import { compareToken } from '../../basics/token';
|
|
17
|
-
|
|
3
|
+
|
|
18
4
|
export declare function findCompareToken(str: string): [compareToken, BaseValueObject];
|
|
19
5
|
/**
|
|
20
6
|
* When it contains both comparison characters and wildcard characters
|
|
@@ -27,6 +13,5 @@ export declare function valueObjectCompare(range: BaseValueObject, criteria: Bas
|
|
|
27
13
|
* Find the Boolean intersection of two ArrayValueObjects
|
|
28
14
|
* @param valueObject1
|
|
29
15
|
* @param valueObject2
|
|
30
|
-
* @returns
|
|
31
16
|
*/
|
|
32
17
|
export declare function booleanObjectIntersection(valueObject1: BaseValueObject, valueObject2: BaseValueObject): BaseValueObject;
|
|
@@ -1,22 +1,8 @@
|
|
|
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 { Injector } from '@wendellhu/redi';
|
|
17
|
-
import type { Nullable } from '@univerjs/core';
|
|
18
|
-
import type { IFunctionService } from '../../services/function.service';
|
|
19
1
|
import { PrefixNode } from '../ast-node/prefix-node';
|
|
2
|
+
import { IFunctionService } from '../../services/function.service';
|
|
3
|
+
import { Nullable } from '@univerjs/core';
|
|
4
|
+
import { Injector } from '@wendellhu/redi';
|
|
5
|
+
|
|
20
6
|
export declare function prefixHandler(tokenTrim: string, functionService: IFunctionService, injector: Injector): {
|
|
21
7
|
tokenTrim: string;
|
|
22
8
|
minusPrefixNode: Nullable<PrefixNode>;
|
|
@@ -1,18 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 { IRange, IUnitRangeName } from '@univerjs/core';
|
|
1
|
+
import { IRange, IUnitRangeName } from '@univerjs/core';
|
|
2
|
+
|
|
17
3
|
export declare function deserializeRangeForR1C1(refString: string, currentRow?: number, currentColumn?: number): IUnitRangeName;
|
|
18
4
|
export declare function serializeRangeToR1C1(range: IRange): string;
|
|
@@ -1,20 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 { IRange, IUnitRangeName } from '@univerjs/core';
|
|
17
|
-
import { AbsoluteRefType } from '@univerjs/core';
|
|
1
|
+
import { IRange, IUnitRangeName, AbsoluteRefType } from '@univerjs/core';
|
|
2
|
+
|
|
18
3
|
export interface IAbsoluteRefTypeForRange {
|
|
19
4
|
startAbsoluteRefType: AbsoluteRefType;
|
|
20
5
|
endAbsoluteRefType?: AbsoluteRefType;
|
|
@@ -58,7 +43,7 @@ export declare function deserializeRangeWithSheet(refString: string): IUnitRange
|
|
|
58
43
|
* Determine whether the sheet name needs to be wrapped in quotes
|
|
59
44
|
* Excel will quote the worksheet name if any of the following is true:
|
|
60
45
|
* - It contains any space or punctuation characters, such as ()$,;-{}"'()【】“”‘’%… and many more
|
|
61
|
-
* - It is a valid cell reference in A1 notation, e.g. B1048576 is quoted
|
|
46
|
+
* - It is a valid cell reference in A1 notation, e.g. B1048576 is quoted
|
|
62
47
|
* - It is a valid cell reference in R1C1 notation, e.g. RC, RC2, R5C, R-4C, RC-8, R, C
|
|
63
48
|
* - It starts with a non-letter, e.g. 99, 1.5, 12a, 💩a
|
|
64
49
|
* - Excel will not quote worksheet names if they only contain non-punctuation, non-letter characters in non-initial positions. For example, a💩 remains unquoted.*
|
|
@@ -1,19 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 { LexerNode } from '../analysis/lexer-node';
|
|
1
|
+
import { LexerNode } from '../analysis/lexer-node';
|
|
2
|
+
|
|
17
3
|
export declare enum sequenceNodeType {
|
|
18
4
|
NORMAL = 0,
|
|
19
5
|
NUMBER = 1,
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { NumberValueObject } from '../value-object/primitive-object';
|
|
2
|
+
import { BaseValueObject } from '../value-object/base-value-object';
|
|
3
|
+
import { FunctionVariantType } from '../reference-object/base-reference-object';
|
|
4
|
+
|
|
5
|
+
export declare function convertTonNumber(valueObject: BaseValueObject): NumberValueObject;
|
|
6
|
+
export declare function isSingleValueObject(valueObject: FunctionVariantType): boolean;
|
|
@@ -13,6 +13,4 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
|
|
17
|
-
import { NumberValueObject } from '../value-object/primitive-object';
|
|
18
|
-
export declare function convertTonNumber(valueObject: BaseValueObject): NumberValueObject;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export {};
|
|
@@ -1,28 +1,14 @@
|
|
|
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 { Nullable } from '@univerjs/core';
|
|
17
|
-
import { compareToken } from '../../basics/token';
|
|
18
|
-
import { ArrayBinarySearchType, ArrayOrderSearchType } from '../utils/compare';
|
|
19
|
-
import type { callbackMapFnType, callbackProductFnType, IArrayValueObject } from './base-value-object';
|
|
20
|
-
import { BaseValueObject, ErrorValueObject } from './base-value-object';
|
|
21
1
|
import { BooleanValueObject, NullValueObject, NumberValueObject, StringValueObject } from './primitive-object';
|
|
2
|
+
import { callbackMapFnType, IArrayValueObject, BaseValueObject, ErrorValueObject } from './base-value-object';
|
|
3
|
+
import { ArrayBinarySearchType, ArrayOrderSearchType } from '../utils/compare';
|
|
4
|
+
import { compareToken } from '../../basics/token';
|
|
5
|
+
import { Nullable } from '@univerjs/core';
|
|
6
|
+
|
|
22
7
|
export declare function fromObjectToString(array: IArrayValueObject): string;
|
|
23
8
|
export declare function transformToValueObject(array?: Array<Array<number | string | boolean | null>>): BaseValueObject[][];
|
|
24
|
-
export declare function transformToValue(array?: BaseValueObject[][]): (string | number | boolean | null)[][];
|
|
9
|
+
export declare function transformToValue(array?: Nullable<BaseValueObject>[][]): (string | number | boolean | null)[][];
|
|
25
10
|
export declare class ArrayValueObject extends BaseValueObject {
|
|
11
|
+
static create(rawValue: string | IArrayValueObject): ArrayValueObject;
|
|
26
12
|
private _values;
|
|
27
13
|
private _rowCount;
|
|
28
14
|
private _columnCount;
|
|
@@ -47,12 +33,12 @@ export declare class ArrayValueObject extends BaseValueObject {
|
|
|
47
33
|
getSheetId(): string;
|
|
48
34
|
getCurrentRow(): number;
|
|
49
35
|
getCurrentColumn(): number;
|
|
50
|
-
getArrayValue(): BaseValueObject[][];
|
|
36
|
+
getArrayValue(): Nullable<BaseValueObject>[][];
|
|
51
37
|
setArrayValue(value: BaseValueObject[][]): void;
|
|
52
38
|
isArray(): boolean;
|
|
53
|
-
get(row: number, column: number): BaseValueObject;
|
|
39
|
+
get(row: number, column: number): BaseValueObject | null;
|
|
54
40
|
getRealValue(row: number, column: number): BaseValueObject | null;
|
|
55
|
-
set(row: number, column: number, value: BaseValueObject): void;
|
|
41
|
+
set(row: number, column: number, value: Nullable<BaseValueObject>): void;
|
|
56
42
|
getRangePosition(): {
|
|
57
43
|
startRow: number;
|
|
58
44
|
endRow: number;
|
|
@@ -133,7 +119,6 @@ export declare class ArrayValueObject extends BaseValueObject {
|
|
|
133
119
|
compare(valueObject: BaseValueObject, operator: compareToken): BaseValueObject;
|
|
134
120
|
concatenateFront(valueObject: BaseValueObject): BaseValueObject;
|
|
135
121
|
concatenateBack(valueObject: BaseValueObject): BaseValueObject;
|
|
136
|
-
product(valueObject: BaseValueObject, callbackFn: callbackProductFnType): BaseValueObject;
|
|
137
122
|
map(callbackFn: callbackMapFnType): BaseValueObject;
|
|
138
123
|
mapValue(callbackFn: callbackMapFnType): BaseValueObject;
|
|
139
124
|
pow(valueObject: BaseValueObject): BaseValueObject;
|
|
@@ -210,5 +195,5 @@ export declare class ArrayValueObject extends BaseValueObject {
|
|
|
210
195
|
private _createNewArray;
|
|
211
196
|
}
|
|
212
197
|
export declare class ValueObjectFactory {
|
|
213
|
-
static create(rawValue: string | number | boolean | null): ErrorValueObject | NullValueObject | NumberValueObject |
|
|
198
|
+
static create(rawValue: string | number | boolean | null): ErrorValueObject | NullValueObject | NumberValueObject | BooleanValueObject | StringValueObject | ArrayValueObject;
|
|
214
199
|
}
|
|
@@ -1,26 +1,13 @@
|
|
|
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 { ConcatenateType } from '../../basics/common';
|
|
17
|
-
import { ErrorType } from '../../basics/error-type';
|
|
18
|
-
import { ObjectClassType } from '../../basics/object-class-type';
|
|
19
1
|
import { compareToken } from '../../basics/token';
|
|
2
|
+
import { ObjectClassType } from '../../basics/object-class-type';
|
|
3
|
+
import { ErrorType } from '../../basics/error-type';
|
|
4
|
+
import { ConcatenateType } from '../../basics/common';
|
|
5
|
+
import { FormulaAstLRU } from '../../basics/cache-lru';
|
|
6
|
+
import { Nullable } from '@univerjs/core';
|
|
7
|
+
|
|
20
8
|
export type callbackMapFnType = (currentValue: BaseValueObject, row: number, column: number) => BaseValueObject;
|
|
21
|
-
export type callbackProductFnType = (currentValue: BaseValueObject, operationValue: BaseValueObject) => BaseValueObject;
|
|
22
9
|
export interface IArrayValueObject {
|
|
23
|
-
calculateValueList: BaseValueObject[][];
|
|
10
|
+
calculateValueList: Nullable<BaseValueObject>[][];
|
|
24
11
|
rowCount: number;
|
|
25
12
|
columnCount: number;
|
|
26
13
|
unitId: string;
|
|
@@ -43,11 +30,10 @@ export declare class BaseValueObject extends ObjectClassType {
|
|
|
43
30
|
unitId: string;
|
|
44
31
|
};
|
|
45
32
|
getValue(): string | number | boolean;
|
|
46
|
-
getArrayValue(): BaseValueObject[][];
|
|
33
|
+
getArrayValue(): Nullable<BaseValueObject>[][];
|
|
47
34
|
setValue(value: string | number | boolean): void;
|
|
48
35
|
setArrayValue(value: BaseValueObject[][]): void;
|
|
49
36
|
isCube(): boolean;
|
|
50
|
-
isArray(): boolean;
|
|
51
37
|
isString(): boolean;
|
|
52
38
|
isNumber(): boolean;
|
|
53
39
|
isBoolean(): boolean;
|
|
@@ -79,7 +65,6 @@ export declare class BaseValueObject extends ObjectClassType {
|
|
|
79
65
|
* @returns
|
|
80
66
|
*/
|
|
81
67
|
mapValue(callbackFn: callbackMapFnType): BaseValueObject;
|
|
82
|
-
product(valueObject: BaseValueObject, callbackFn: callbackProductFnType): BaseValueObject;
|
|
83
68
|
compare(valueObject: BaseValueObject, operator: compareToken): BaseValueObject;
|
|
84
69
|
isEqual(valueObject: BaseValueObject): BaseValueObject;
|
|
85
70
|
isNotEqual(valueObject: BaseValueObject): BaseValueObject;
|
|
@@ -148,10 +133,14 @@ export declare class BaseValueObject extends ObjectClassType {
|
|
|
148
133
|
floorInverse(valueObject: BaseValueObject): BaseValueObject;
|
|
149
134
|
ceil(valueObject: BaseValueObject): BaseValueObject;
|
|
150
135
|
ceilInverse(valueObject: BaseValueObject): BaseValueObject;
|
|
136
|
+
convertToNumberObjectValue(): BaseValueObject;
|
|
137
|
+
convertToBooleanObjectValue(): BaseValueObject;
|
|
151
138
|
}
|
|
139
|
+
export declare const ErrorValueObjectCache: FormulaAstLRU<ErrorValueObject>;
|
|
152
140
|
export declare class ErrorValueObject extends BaseValueObject {
|
|
153
141
|
private _errorType;
|
|
154
142
|
private _errorContent;
|
|
143
|
+
static create(errorType: ErrorType, errorContent?: string): ErrorValueObject;
|
|
155
144
|
constructor(_errorType: ErrorType, _errorContent?: string);
|
|
156
145
|
getValue(): ErrorType;
|
|
157
146
|
getErrorType(): ErrorType;
|
|
@@ -1,22 +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 type { ArrayValueObject } from './array-value-object';
|
|
17
|
-
import { BaseValueObject } from './base-value-object';
|
|
18
1
|
import { NumberValueObject } from './primitive-object';
|
|
2
|
+
import { BaseValueObject } from './base-value-object';
|
|
3
|
+
import { ArrayValueObject } from './array-value-object';
|
|
4
|
+
|
|
19
5
|
export declare class CubeValueObject extends BaseValueObject {
|
|
6
|
+
static create(values: ArrayValueObject[]): CubeValueObject;
|
|
20
7
|
isCube(): boolean;
|
|
21
8
|
private _values;
|
|
22
9
|
constructor(values: ArrayValueObject[]);
|
|
@@ -1,26 +1,13 @@
|
|
|
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 { BaseAstNode } from '../ast-node/base-ast-node';
|
|
17
|
-
import type { Interpreter } from '../interpreter/interpreter';
|
|
18
|
-
import { AsyncObject } from '../reference-object/base-reference-object';
|
|
19
1
|
import { BaseValueObject } from './base-value-object';
|
|
2
|
+
import { AsyncObject } from '../reference-object/base-reference-object';
|
|
3
|
+
import { Interpreter } from '../interpreter/interpreter';
|
|
4
|
+
import { BaseAstNode } from '../ast-node/base-ast-node';
|
|
5
|
+
|
|
20
6
|
export declare class LambdaValueObjectObject extends BaseValueObject {
|
|
21
7
|
private _lambdaNode;
|
|
22
8
|
private _interpreter;
|
|
23
9
|
private _lambdaPrivacyVarKeys;
|
|
10
|
+
static create(lambdaNode: BaseAstNode, interpreter: Interpreter, lambdaPrivacyVarKeys: string[]): LambdaValueObjectObject;
|
|
24
11
|
private _lambdaPrivacyValueMap;
|
|
25
12
|
constructor(_lambdaNode: BaseAstNode, _interpreter: Interpreter, _lambdaPrivacyVarKeys: string[]);
|
|
26
13
|
isLambda(): boolean;
|
|
@@ -1,22 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
-
*/
|
|
1
|
+
import { BaseValueObject, ErrorValueObject } from './base-value-object';
|
|
2
|
+
import { FormulaAstLRU } from '../../basics/cache-lru';
|
|
16
3
|
import { compareToken } from '../../basics/token';
|
|
17
|
-
|
|
4
|
+
|
|
18
5
|
export type PrimitiveValueType = string | boolean | number | null;
|
|
19
6
|
export declare class NullValueObject extends BaseValueObject {
|
|
7
|
+
private static _instance;
|
|
8
|
+
static create(): NullValueObject;
|
|
20
9
|
isNull(): boolean;
|
|
21
10
|
plus(valueObject: BaseValueObject): BaseValueObject;
|
|
22
11
|
minus(valueObject: BaseValueObject): BaseValueObject;
|
|
@@ -52,10 +41,15 @@ export declare class NullValueObject extends BaseValueObject {
|
|
|
52
41
|
round(valueObject: BaseValueObject): BaseValueObject;
|
|
53
42
|
floor(valueObject: BaseValueObject): BaseValueObject;
|
|
54
43
|
ceil(valueObject: BaseValueObject): BaseValueObject;
|
|
44
|
+
convertToNumberObjectValue(): NumberValueObject;
|
|
45
|
+
convertToBooleanObjectValue(): BooleanValueObject;
|
|
55
46
|
}
|
|
56
47
|
export declare class BooleanValueObject extends BaseValueObject {
|
|
57
48
|
private _value;
|
|
58
|
-
|
|
49
|
+
private static _instanceTrue;
|
|
50
|
+
private static _instanceFalse;
|
|
51
|
+
static create(value: boolean): BooleanValueObject;
|
|
52
|
+
constructor(rawValue: boolean);
|
|
59
53
|
getValue(): boolean;
|
|
60
54
|
isBoolean(): boolean;
|
|
61
55
|
getNegative(): BaseValueObject;
|
|
@@ -90,10 +84,14 @@ export declare class BooleanValueObject extends BaseValueObject {
|
|
|
90
84
|
round(valueObject: BaseValueObject): BaseValueObject;
|
|
91
85
|
floor(valueObject: BaseValueObject): BaseValueObject;
|
|
92
86
|
ceil(valueObject: BaseValueObject): BaseValueObject;
|
|
87
|
+
convertToNumberObjectValue(): ErrorValueObject | NumberValueObject;
|
|
88
|
+
convertToBooleanObjectValue(): this;
|
|
93
89
|
}
|
|
90
|
+
export declare const NumberValueObjectCache: FormulaAstLRU<NumberValueObject>;
|
|
94
91
|
export declare class NumberValueObject extends BaseValueObject {
|
|
95
92
|
private _value;
|
|
96
|
-
|
|
93
|
+
static create(value: number, pattern?: string): NumberValueObject;
|
|
94
|
+
constructor(rawValue: number);
|
|
97
95
|
getValue(): number;
|
|
98
96
|
setValue(value: number): void;
|
|
99
97
|
isNumber(): boolean;
|
|
@@ -134,16 +132,25 @@ export declare class NumberValueObject extends BaseValueObject {
|
|
|
134
132
|
round(valueObject: BaseValueObject): BaseValueObject;
|
|
135
133
|
floor(valueObject: BaseValueObject): BaseValueObject;
|
|
136
134
|
ceil(valueObject: BaseValueObject): BaseValueObject;
|
|
135
|
+
convertToNumberObjectValue(): this;
|
|
136
|
+
convertToBooleanObjectValue(): BooleanValueObject;
|
|
137
137
|
private _compareInfinity;
|
|
138
138
|
}
|
|
139
|
+
export declare const StringValueObjectCache: FormulaAstLRU<StringValueObject>;
|
|
139
140
|
export declare class StringValueObject extends BaseValueObject {
|
|
140
141
|
private _value;
|
|
141
|
-
|
|
142
|
+
static create(value: string): StringValueObject;
|
|
143
|
+
constructor(rawValue: string);
|
|
142
144
|
getValue(): string;
|
|
143
145
|
isString(): boolean;
|
|
144
146
|
concatenateFront(valueObject: BaseValueObject): BaseValueObject;
|
|
145
147
|
concatenateBack(valueObject: BaseValueObject): BaseValueObject;
|
|
146
148
|
compare(valueObject: BaseValueObject, operator: compareToken): BaseValueObject;
|
|
147
149
|
compareBy(value: string | number | boolean, operator: compareToken): BaseValueObject;
|
|
150
|
+
convertToNumberObjectValue(): ErrorValueObject | NumberValueObject;
|
|
151
|
+
convertToBooleanObjectValue(): BooleanValueObject;
|
|
148
152
|
private _checkWildcard;
|
|
149
153
|
}
|
|
154
|
+
export declare function createBooleanValueObjectByRawValue(rawValue: string | number | boolean): BooleanValueObject;
|
|
155
|
+
export declare function createStringValueObjectByRawValue(rawValue: string | number | boolean): StringValueObject;
|
|
156
|
+
export declare function createNumberValueObjectByRawValue(rawValue: string | number | boolean): ErrorValueObject | NumberValueObject;
|
|
@@ -1,34 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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 { IWorkbookData } from '@univerjs/core';
|
|
17
|
-
import { Univer } from '@univerjs/core';
|
|
18
|
-
import type { Dependency } from '@wendellhu/redi';
|
|
19
|
-
import type { ISheetData } from '../../basics/common';
|
|
1
|
+
import { FunctionVariantType } from '../../engine/reference-object/base-reference-object';
|
|
2
|
+
import { ISheetData } from '../../basics/common';
|
|
3
|
+
import { Dependency } from '@wendellhu/redi';
|
|
4
|
+
import { IWorkbookData, Univer } from '@univerjs/core';
|
|
5
|
+
|
|
20
6
|
export declare function createFunctionTestBed(workbookConfig?: IWorkbookData, dependencies?: Dependency[]): {
|
|
21
7
|
univer: Univer;
|
|
22
8
|
get: {
|
|
23
|
-
<T>(id: import(
|
|
24
|
-
<T_1>(id: import(
|
|
25
|
-
<T_2>(id: import(
|
|
26
|
-
<T_3>(id: import(
|
|
27
|
-
<T_4>(id: import(
|
|
28
|
-
<T_5>(id: import(
|
|
9
|
+
<T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, lookUp?: import('@wendellhu/redi').LookUp | undefined): T;
|
|
10
|
+
<T_1>(id: import('@wendellhu/redi').DependencyIdentifier<T_1>, quantity: import("@wendellhu/redi").Quantity.MANY, lookUp?: import('@wendellhu/redi').LookUp | undefined): T_1[];
|
|
11
|
+
<T_2>(id: import('@wendellhu/redi').DependencyIdentifier<T_2>, quantity: import("@wendellhu/redi").Quantity.OPTIONAL, lookUp?: import('@wendellhu/redi').LookUp | undefined): T_2 | null;
|
|
12
|
+
<T_3>(id: import('@wendellhu/redi').DependencyIdentifier<T_3>, quantity: import("@wendellhu/redi").Quantity.REQUIRED, lookUp?: import('@wendellhu/redi').LookUp | undefined): T_3;
|
|
13
|
+
<T_4>(id: import('@wendellhu/redi').DependencyIdentifier<T_4>, quantity?: import('@wendellhu/redi').Quantity | undefined, lookUp?: import('@wendellhu/redi').LookUp | undefined): T_4 | T_4[] | null;
|
|
14
|
+
<T_5>(id: import('@wendellhu/redi').DependencyIdentifier<T_5>, quantityOrLookup?: import('@wendellhu/redi').Quantity | import('@wendellhu/redi').LookUp | undefined, lookUp?: import('@wendellhu/redi').LookUp | undefined): T_5 | T_5[] | null;
|
|
29
15
|
};
|
|
30
|
-
sheet: import(
|
|
16
|
+
sheet: import('@univerjs/core').Workbook;
|
|
31
17
|
unitId: string;
|
|
32
18
|
sheetId: string;
|
|
33
19
|
sheetData: ISheetData;
|
|
34
20
|
};
|
|
21
|
+
export declare function getObjectValue(result: FunctionVariantType): string | number | boolean | (string | number | boolean | null)[][];
|
|
@@ -1,27 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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 { Nullable } from '@univerjs/core';
|
|
17
|
-
import { Disposable } from '@univerjs/core';
|
|
18
|
-
import type { IFunctionNames } from '../basics/function';
|
|
19
|
-
import type { FunctionVariantType, NodeValueType } from '../engine/reference-object/base-reference-object';
|
|
20
|
-
import type { ArrayBinarySearchType } from '../engine/utils/compare';
|
|
21
|
-
import { ArrayOrderSearchType } from '../engine/utils/compare';
|
|
22
|
-
import type { ArrayValueObject } from '../engine/value-object/array-value-object';
|
|
23
|
-
import { type BaseValueObject, ErrorValueObject } from '../engine/value-object/base-value-object';
|
|
24
|
-
import { type PrimitiveValueType } from '../engine/value-object/primitive-object';
|
|
1
|
+
import { PrimitiveValueType } from '../engine/value-object/primitive-object';
|
|
2
|
+
import { BaseValueObject, ErrorValueObject } from '../engine/value-object/base-value-object';
|
|
3
|
+
import { ArrayValueObject } from '../engine/value-object/array-value-object';
|
|
4
|
+
import { ArrayBinarySearchType, ArrayOrderSearchType } from '../engine/utils/compare';
|
|
5
|
+
import { BaseReferenceObject, FunctionVariantType, NodeValueType } from '../engine/reference-object/base-reference-object';
|
|
6
|
+
import { IFunctionNames } from '../basics/function';
|
|
7
|
+
import { IRange, Nullable, Disposable } from '@univerjs/core';
|
|
8
|
+
|
|
25
9
|
export declare class BaseFunction extends Disposable {
|
|
26
10
|
private _name;
|
|
27
11
|
private _unitId;
|
|
@@ -54,7 +38,6 @@ export declare class BaseFunction extends Disposable {
|
|
|
54
38
|
* For instance, The column number (starting with 1 for the left-most column of table_array) that contains the return value.
|
|
55
39
|
* https://support.microsoft.com/en-us/office/vlookup-function-0bbc8083-26fe-4963-8ab8-93a18ad188a1
|
|
56
40
|
* @param indexNum
|
|
57
|
-
* @returns
|
|
58
41
|
*/
|
|
59
42
|
getIndexNumValue(indexNum: BaseValueObject, defaultValue?: number): number | ErrorValueObject;
|
|
60
43
|
/**
|
|
@@ -68,28 +51,24 @@ export declare class BaseFunction extends Disposable {
|
|
|
68
51
|
* If a1 is FALSE, ref_text is interpreted as an R1C1-style reference.
|
|
69
52
|
* https://support.microsoft.com/zh-cn/office/indirect-%E5%87%BD%E6%95%B0-474b3a3a-8a26-4f44-b491-92b6306fa261
|
|
70
53
|
* @param logicValueObject
|
|
71
|
-
* @returns
|
|
72
54
|
*/
|
|
73
55
|
getZeroOrOneByOneDefault(logicValueObject?: BaseValueObject): number | undefined;
|
|
74
56
|
/**
|
|
75
57
|
* A logical value that specifies 1/TRUE , 0/FALSE, -1, default 1.
|
|
76
58
|
* The difference from getZeroOrOneByOneDefault is that we need to get -1
|
|
77
59
|
* @param logicValueObject
|
|
78
|
-
* @returns
|
|
79
60
|
*/
|
|
80
61
|
getMatchTypeValue(logicValueObject?: BaseValueObject): number | undefined;
|
|
81
62
|
binarySearch(value: BaseValueObject, searchArray: ArrayValueObject, resultArray: ArrayValueObject, searchType?: ArrayBinarySearchType): BaseValueObject;
|
|
82
63
|
equalSearch(value: BaseValueObject, searchArray: ArrayValueObject, resultArray: ArrayValueObject, isFirst?: boolean): BaseValueObject;
|
|
83
64
|
fuzzySearch(value: BaseValueObject, searchArray: ArrayValueObject, resultArray: ArrayValueObject, isFirst?: boolean): BaseValueObject;
|
|
84
65
|
orderSearch(value: BaseValueObject, searchArray: ArrayValueObject, resultArray: ArrayValueObject, searchType?: ArrayOrderSearchType, isDesc?: boolean): BaseValueObject;
|
|
85
|
-
/**
|
|
86
|
-
* @param axis 0 row, 1 column
|
|
87
|
-
* @returns
|
|
88
|
-
*/
|
|
89
66
|
binarySearchExpand(value: BaseValueObject, searchArray: ArrayValueObject, resultArray: ArrayValueObject, axis?: number, searchType?: ArrayBinarySearchType): ErrorValueObject | ArrayValueObject | undefined;
|
|
90
67
|
equalSearchExpand(value: BaseValueObject, searchArray: ArrayValueObject, resultArray: ArrayValueObject, isFirst?: boolean, axis?: number): ErrorValueObject | ArrayValueObject | undefined;
|
|
91
68
|
fuzzySearchExpand(value: BaseValueObject, searchArray: ArrayValueObject, resultArray: ArrayValueObject, isFirst?: boolean, axis?: number): ErrorValueObject | ArrayValueObject | undefined;
|
|
92
69
|
orderSearchExpand(value: BaseValueObject, searchArray: ArrayValueObject, resultArray: ArrayValueObject, searchType?: ArrayOrderSearchType, isDesc?: boolean, axis?: number): ErrorValueObject | ArrayValueObject | undefined;
|
|
93
70
|
flattenArray(variants: BaseValueObject[], ignoreLogicalValuesAndText?: boolean): ArrayValueObject | BaseValueObject;
|
|
94
71
|
private _includingLogicalValuesAndText;
|
|
72
|
+
createReferenceObject(reference: BaseReferenceObject, range: IRange): ErrorValueObject | BaseReferenceObject;
|
|
73
|
+
private _setReferenceDefault;
|
|
95
74
|
}
|
|
@@ -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 { StdevS } from '../statistical/stdev-s';
|
|
17
1
|
import { FUNCTION_NAMES_COMPATIBILITY } from './function-names';
|
|
2
|
+
import { StdevS } from '../statistical/stdev-s';
|
|
3
|
+
|
|
18
4
|
export declare const functionCompatibility: (FUNCTION_NAMES_COMPATIBILITY | typeof StdevS)[][];
|