@univerjs/engine-formula 0.1.0-beta.1 → 0.1.0-beta.3
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/{LICENSE.txt → LICENSE} +0 -2
- package/lib/cjs/index.js +1 -1
- package/lib/es/index.js +4156 -3484
- 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/__tests__/object-compare.spec.d.ts +16 -0
- package/lib/types/engine/utils/__tests__/r1c1-reference.spec.d.ts +16 -0
- package/lib/types/engine/utils/__tests__/reference.spec.d.ts +16 -0
- package/lib/types/engine/utils/compare.d.ts +4 -0
- package/lib/types/engine/utils/object-compare.d.ts +1 -2
- package/lib/types/engine/utils/r1c1-reference.d.ts +19 -0
- package/lib/types/engine/utils/reference.d.ts +80 -0
- package/lib/types/engine/value-object/array-value-object.d.ts +15 -11
- package/lib/types/engine/value-object/base-value-object.d.ts +20 -6
- package/lib/types/engine/value-object/primitive-object.d.ts +1 -1
- 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 +21 -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/math/sumif/index.d.ts +2 -3
- 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 +21 -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 +26 -23
- /package/lib/types/functions/{array → logical}/makearray/index.d.ts +0 -0
- /package/lib/types/functions/{compatibility → text}/concatenate/index.d.ts +0 -0
|
@@ -0,0 +1,80 @@
|
|
|
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 { IRange } from '@univerjs/core';
|
|
17
|
+
import { AbsoluteRefType } from '@univerjs/core';
|
|
18
|
+
export declare const UNIT_NAME_REGEX = "\\[([^\\[\\]\\/?:\"<>|*\\\\]+)\\]";
|
|
19
|
+
export interface IGridRangeName {
|
|
20
|
+
unitId: string;
|
|
21
|
+
sheetName: string;
|
|
22
|
+
range: IRange;
|
|
23
|
+
}
|
|
24
|
+
export interface IAbsoluteRefTypeForRange {
|
|
25
|
+
startAbsoluteRefType: AbsoluteRefType;
|
|
26
|
+
endAbsoluteRefType?: AbsoluteRefType;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @param singleRefString for example A1 or B10, not A1:B10
|
|
31
|
+
*/
|
|
32
|
+
export declare function getAbsoluteRefTypeWithSingleString(singleRefString: string): AbsoluteRefType;
|
|
33
|
+
/**
|
|
34
|
+
*
|
|
35
|
+
* @param refString for example A1:B10
|
|
36
|
+
*/
|
|
37
|
+
export declare function getAbsoluteRefTypeWitString(refString: string): IAbsoluteRefTypeForRange;
|
|
38
|
+
/**
|
|
39
|
+
* Serialize an `IRange` into a string.
|
|
40
|
+
* @param range The `IRange` to be serialized
|
|
41
|
+
*/
|
|
42
|
+
export declare function serializeRange(range: IRange): string;
|
|
43
|
+
/**
|
|
44
|
+
* Serialize an `IRange` and a sheetID into a string.
|
|
45
|
+
* @param sheetName
|
|
46
|
+
* @param range
|
|
47
|
+
* @returns
|
|
48
|
+
*/
|
|
49
|
+
export declare function serializeRangeWithSheet(sheetName: string, range: IRange): string;
|
|
50
|
+
/**
|
|
51
|
+
* Serialize an `IRange` and a sheetID into a string.
|
|
52
|
+
* @param unit unitId or unitName
|
|
53
|
+
* @param sheetName
|
|
54
|
+
* @param range
|
|
55
|
+
* @returns
|
|
56
|
+
*/
|
|
57
|
+
export declare function serializeRangeWithSpreadsheet(unit: string, sheetName: string, range: IRange): string;
|
|
58
|
+
export declare function serializeRangeToRefString(gridRangeName: IGridRangeName): string;
|
|
59
|
+
export declare function handleRefStringInfo(refString: string): {
|
|
60
|
+
refBody: string;
|
|
61
|
+
sheetName: string;
|
|
62
|
+
unitId: string;
|
|
63
|
+
};
|
|
64
|
+
export declare function deserializeRangeWithSheet(refString: string): IGridRangeName;
|
|
65
|
+
/**
|
|
66
|
+
* Determine whether the sheet name needs to be wrapped in quotes
|
|
67
|
+
* Excel will quote the worksheet name if any of the following is true:
|
|
68
|
+
* - It contains any space or punctuation characters, such as ()$,;-{}"'()【】“”‘’%… and many more
|
|
69
|
+
* - It is a valid cell reference in A1 notation, e.g. B1048576 is quoted, B1048577 is not
|
|
70
|
+
* - It is a valid cell reference in R1C1 notation, e.g. RC, RC2, R5C, R-4C, RC-8, R, C
|
|
71
|
+
* - It starts with a non-letter, e.g. 99, 1.5, 12a, 💩a
|
|
72
|
+
* - Excel will not quote worksheet names if they only contain non-punctuation, non-letter characters in non-initial positions. For example, a💩 remains unquoted.*
|
|
73
|
+
* In addition, if a worksheet name contains single quotes, these will be doubled up within the name itself. For example, the sheet name a'b'c becomes 'a''b''c'.
|
|
74
|
+
*
|
|
75
|
+
* reference https://stackoverflow.com/questions/41677779/when-does-excel-surround-sheet-names-with-single-quotes-in-workbook-xml-or-othe
|
|
76
|
+
*
|
|
77
|
+
* @param name Sheet name
|
|
78
|
+
* @returns Result
|
|
79
|
+
*/
|
|
80
|
+
export declare function needsQuoting(name: string): boolean;
|
|
@@ -15,20 +15,23 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { type Nullable } from '@univerjs/core';
|
|
17
17
|
import { compareToken } from '../../basics/token';
|
|
18
|
+
import { ArrayBinarySearchType } from '../utils/compare';
|
|
18
19
|
import type { callbackMapFnType, callbackProductFnType, IArrayValueObject } from './base-value-object';
|
|
19
20
|
import { BaseValueObject, ErrorValueObject } from './base-value-object';
|
|
20
|
-
import { BooleanValueObject, NumberValueObject, StringValueObject } from './primitive-object';
|
|
21
|
+
import { BooleanValueObject, NullValueObject, NumberValueObject, StringValueObject } from './primitive-object';
|
|
21
22
|
export declare function fromObjectToString(array: IArrayValueObject): string;
|
|
22
|
-
export declare function transformToValueObject(array?: Array<Array<number | string | boolean>>): BaseValueObject[][];
|
|
23
|
-
export declare function transformToValue(array?: BaseValueObject[][]): (string | number | boolean)[][];
|
|
23
|
+
export declare function transformToValueObject(array?: Array<Array<number | string | boolean | null>>): BaseValueObject[][];
|
|
24
|
+
export declare function transformToValue(array?: BaseValueObject[][]): (string | number | boolean | null)[][];
|
|
24
25
|
export declare class ArrayValueObject extends BaseValueObject {
|
|
25
|
-
private
|
|
26
|
+
private _values;
|
|
26
27
|
private _rowCount;
|
|
27
28
|
private _columnCount;
|
|
28
29
|
private _unitId;
|
|
29
30
|
private _sheetId;
|
|
30
31
|
private _currentRow;
|
|
31
32
|
private _currentColumn;
|
|
33
|
+
private _sliceCache;
|
|
34
|
+
private _flattenCache;
|
|
32
35
|
constructor(rawValue: string | IArrayValueObject);
|
|
33
36
|
dispose(): void;
|
|
34
37
|
getRowCount(): number;
|
|
@@ -75,16 +78,17 @@ export declare class ArrayValueObject extends BaseValueObject {
|
|
|
75
78
|
* @columnParam start:stop:step
|
|
76
79
|
* @param takeArray
|
|
77
80
|
*/
|
|
78
|
-
slice(rowParam: Nullable<Array<Nullable<number>>>, columnParam: Nullable<Array<Nullable<number>>>): ArrayValueObject;
|
|
81
|
+
slice(rowParam: Nullable<Array<Nullable<number>>>, columnParam: Nullable<Array<Nullable<number>>>): ArrayValueObject | undefined;
|
|
82
|
+
sortByRow(index: number): void;
|
|
83
|
+
sortByColumn(index: number): void;
|
|
84
|
+
transpose(): ArrayValueObject;
|
|
85
|
+
binarySearch(valueObject: BaseValueObject, searchType?: ArrayBinarySearchType): number | null | undefined;
|
|
79
86
|
sum(): BaseValueObject;
|
|
80
87
|
max(): BaseValueObject;
|
|
81
88
|
min(): BaseValueObject;
|
|
82
89
|
count(): BaseValueObject;
|
|
83
90
|
countA(): BaseValueObject;
|
|
84
91
|
countBlank(): BaseValueObject;
|
|
85
|
-
sortByRow(index: number): void;
|
|
86
|
-
sortByColumn(index: number): void;
|
|
87
|
-
transpose(): ArrayValueObject;
|
|
88
92
|
getNegative(): BaseValueObject;
|
|
89
93
|
getReciprocal(): BaseValueObject;
|
|
90
94
|
plus(valueObject: BaseValueObject): BaseValueObject;
|
|
@@ -92,7 +96,6 @@ export declare class ArrayValueObject extends BaseValueObject {
|
|
|
92
96
|
multiply(valueObject: BaseValueObject): BaseValueObject;
|
|
93
97
|
divided(valueObject: BaseValueObject): BaseValueObject;
|
|
94
98
|
compare(valueObject: BaseValueObject, operator: compareToken): BaseValueObject;
|
|
95
|
-
wildcard(valueObject: BaseValueObject, operator: compareToken): BaseValueObject;
|
|
96
99
|
concatenateFront(valueObject: BaseValueObject): BaseValueObject;
|
|
97
100
|
concatenateBack(valueObject: BaseValueObject): BaseValueObject;
|
|
98
101
|
product(valueObject: BaseValueObject, callbackFn: callbackProductFnType): BaseValueObject;
|
|
@@ -132,7 +135,8 @@ export declare class ArrayValueObject extends BaseValueObject {
|
|
|
132
135
|
floorInverse(valueObject: BaseValueObject): BaseValueObject;
|
|
133
136
|
ceil(valueObject: BaseValueObject): BaseValueObject;
|
|
134
137
|
ceilInverse(valueObject: BaseValueObject): BaseValueObject;
|
|
135
|
-
toValue(): (string | number | boolean)[][];
|
|
138
|
+
toValue(): (string | number | boolean | null)[][];
|
|
139
|
+
private _clearCache;
|
|
136
140
|
private _sort;
|
|
137
141
|
private _transposeArray;
|
|
138
142
|
private _batchOperator;
|
|
@@ -143,5 +147,5 @@ export declare class ArrayValueObject extends BaseValueObject {
|
|
|
143
147
|
private _createNewArray;
|
|
144
148
|
}
|
|
145
149
|
export declare class ValueObjectFactory {
|
|
146
|
-
static create(rawValue: string | number | boolean): NumberValueObject | StringValueObject | BooleanValueObject |
|
|
150
|
+
static create(rawValue: string | number | boolean | null): ErrorValueObject | NullValueObject | NumberValueObject | StringValueObject | BooleanValueObject | ArrayValueObject;
|
|
147
151
|
}
|
|
@@ -17,7 +17,6 @@ import { ConcatenateType } from '../../basics/common';
|
|
|
17
17
|
import { ErrorType } from '../../basics/error-type';
|
|
18
18
|
import { ObjectClassType } from '../../basics/object-class-type';
|
|
19
19
|
import { compareToken } from '../../basics/token';
|
|
20
|
-
import type { StringValueObject } from './primitive-object';
|
|
21
20
|
export type callbackMapFnType = (currentValue: BaseValueObject, row: number, column: number) => BaseValueObject;
|
|
22
21
|
export type callbackProductFnType = (currentValue: BaseValueObject, operationValue: BaseValueObject) => BaseValueObject;
|
|
23
22
|
export interface IArrayValueObject {
|
|
@@ -33,6 +32,16 @@ export declare class BaseValueObject extends ObjectClassType {
|
|
|
33
32
|
private _rawValue;
|
|
34
33
|
constructor(_rawValue: string | number | boolean);
|
|
35
34
|
isValueObject(): boolean;
|
|
35
|
+
toUnitRange(): {
|
|
36
|
+
range: {
|
|
37
|
+
startColumn: number;
|
|
38
|
+
startRow: number;
|
|
39
|
+
endRow: number;
|
|
40
|
+
endColumn: number;
|
|
41
|
+
};
|
|
42
|
+
sheetId: string;
|
|
43
|
+
unitId: string;
|
|
44
|
+
};
|
|
36
45
|
getValue(): string | number | boolean;
|
|
37
46
|
getArrayValue(): BaseValueObject[][];
|
|
38
47
|
setValue(value: string | number | boolean): void;
|
|
@@ -44,6 +53,12 @@ export declare class BaseValueObject extends ObjectClassType {
|
|
|
44
53
|
isLambda(): boolean;
|
|
45
54
|
isError(): boolean;
|
|
46
55
|
isNull(): boolean;
|
|
56
|
+
sum(): BaseValueObject;
|
|
57
|
+
max(): BaseValueObject;
|
|
58
|
+
min(): BaseValueObject;
|
|
59
|
+
count(): BaseValueObject;
|
|
60
|
+
countA(): BaseValueObject;
|
|
61
|
+
countBlank(): BaseValueObject;
|
|
47
62
|
getNegative(): BaseValueObject;
|
|
48
63
|
getReciprocal(): BaseValueObject;
|
|
49
64
|
plus(valueObject: BaseValueObject): BaseValueObject;
|
|
@@ -53,7 +68,6 @@ export declare class BaseValueObject extends ObjectClassType {
|
|
|
53
68
|
map(callbackFn: callbackMapFnType): BaseValueObject;
|
|
54
69
|
product(valueObject: BaseValueObject, callbackFn: callbackProductFnType): BaseValueObject;
|
|
55
70
|
compare(valueObject: BaseValueObject, operator: compareToken): BaseValueObject;
|
|
56
|
-
wildcard(valueObject: StringValueObject, operator: compareToken): BaseValueObject;
|
|
57
71
|
isEqual(valueObject: BaseValueObject): BaseValueObject;
|
|
58
72
|
isNotEqual(valueObject: BaseValueObject): BaseValueObject;
|
|
59
73
|
isGreaterThanOrEqual(valueObject: BaseValueObject): BaseValueObject;
|
|
@@ -94,20 +108,20 @@ export declare class BaseValueObject extends ObjectClassType {
|
|
|
94
108
|
/**
|
|
95
109
|
* Calculate the median of the entire array.
|
|
96
110
|
*
|
|
97
|
-
* https://numpy.org/doc/stable/reference/generated/numpy.median.html
|
|
111
|
+
* reference https://numpy.org/doc/stable/reference/generated/numpy.median.html
|
|
98
112
|
*
|
|
99
113
|
*/
|
|
100
114
|
median(): BaseValueObject;
|
|
101
115
|
/**
|
|
102
116
|
* Calculate the variance of the entire array.
|
|
103
117
|
*
|
|
104
|
-
* https://numpy.org/doc/stable/reference/generated/numpy.var.html
|
|
118
|
+
* reference https://numpy.org/doc/stable/reference/generated/numpy.var.html
|
|
105
119
|
*/
|
|
106
120
|
var(): BaseValueObject;
|
|
107
121
|
/**
|
|
108
122
|
* Calculate the standard deviation of the entire array.
|
|
109
123
|
*
|
|
110
|
-
* https://numpy.org/doc/stable/reference/generated/numpy.std.html
|
|
124
|
+
* reference https://numpy.org/doc/stable/reference/generated/numpy.std.html
|
|
111
125
|
*/
|
|
112
126
|
std(): BaseValueObject;
|
|
113
127
|
log(): BaseValueObject;
|
|
@@ -125,7 +139,7 @@ export declare class ErrorValueObject extends BaseValueObject {
|
|
|
125
139
|
private _errorType;
|
|
126
140
|
private _errorContent;
|
|
127
141
|
constructor(_errorType: ErrorType, _errorContent?: string);
|
|
128
|
-
|
|
142
|
+
getValue(): ErrorType;
|
|
129
143
|
getErrorType(): ErrorType;
|
|
130
144
|
getErrorContent(): string;
|
|
131
145
|
isEqualType(object: ObjectClassType): boolean;
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { compareToken } from '../../basics/token';
|
|
17
17
|
import { BaseValueObject } from './base-value-object';
|
|
18
|
+
export type PrimitiveValueType = string | boolean | number | null;
|
|
18
19
|
export declare class NullValueObject extends BaseValueObject {
|
|
19
20
|
isNull(): boolean;
|
|
20
21
|
plus(valueObject: BaseValueObject): BaseValueObject;
|
|
@@ -140,7 +141,6 @@ export declare class StringValueObject extends BaseValueObject {
|
|
|
140
141
|
concatenateFront(valueObject: BaseValueObject): BaseValueObject;
|
|
141
142
|
concatenateBack(valueObject: BaseValueObject): BaseValueObject;
|
|
142
143
|
compare(valueObject: BaseValueObject, operator: compareToken): BaseValueObject;
|
|
143
|
-
wildcard(valueObject: StringValueObject, operator: compareToken): BaseValueObject;
|
|
144
144
|
compareBy(value: string | number | boolean, operator: compareToken): BaseValueObject;
|
|
145
145
|
private _checkWildcard;
|
|
146
146
|
}
|
|
@@ -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 { Makearray } from './makearray';
|
|
18
|
-
export declare const functionArray: (FUNCTION_NAMES_ARRAY | typeof Makearray)[][];
|
|
16
|
+
export declare const functionArray: never[];
|
|
@@ -13,16 +13,51 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
import type { Nullable } from '@univerjs/core';
|
|
16
17
|
import { Disposable } from '@univerjs/core';
|
|
17
|
-
import type { IFunctionNames } from '
|
|
18
|
+
import type { IFunctionNames } from '../basics/function';
|
|
18
19
|
import type { FunctionVariantType, NodeValueType } from '../engine/reference-object/base-reference-object';
|
|
19
|
-
import { type BaseValueObject } from '../engine/value-object/base-value-object';
|
|
20
|
+
import { type BaseValueObject, ErrorValueObject } from '../engine/value-object/base-value-object';
|
|
21
|
+
import type { PrimitiveValueType } from '../engine/value-object/primitive-object';
|
|
20
22
|
export declare class BaseFunction extends Disposable {
|
|
21
23
|
private _name;
|
|
24
|
+
private _unitId;
|
|
25
|
+
private _subUnitId;
|
|
26
|
+
private _row;
|
|
27
|
+
private _column;
|
|
22
28
|
constructor(_name: IFunctionNames);
|
|
23
29
|
get name(): IFunctionNames;
|
|
30
|
+
get unitId(): Nullable<string>;
|
|
31
|
+
get subUnitId(): Nullable<string>;
|
|
32
|
+
get row(): number;
|
|
33
|
+
get column(): number;
|
|
24
34
|
isAsync(): boolean;
|
|
25
35
|
isAddress(): boolean;
|
|
36
|
+
isCustom(): boolean;
|
|
37
|
+
setRefInfo(unitId: string, subUnitId: string, row: number, column: number): void;
|
|
38
|
+
calculateCustom(...arg: Array<PrimitiveValueType | PrimitiveValueType[][]>): PrimitiveValueType | PrimitiveValueType[][];
|
|
26
39
|
calculate(...arg: BaseValueObject[]): NodeValueType;
|
|
27
40
|
checkArrayType(variant: FunctionVariantType): boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Starting with 1
|
|
43
|
+
* For instance, The column number (starting with 1 for the left-most column of table_array) that contains the return value.
|
|
44
|
+
* https://support.microsoft.com/en-us/office/vlookup-function-0bbc8083-26fe-4963-8ab8-93a18ad188a1
|
|
45
|
+
* @param indexNum
|
|
46
|
+
* @returns
|
|
47
|
+
*/
|
|
48
|
+
getIndexNumValue(indexNum: BaseValueObject): number | ErrorValueObject;
|
|
49
|
+
/**
|
|
50
|
+
* A logical value that specifies 1/TRUE , 0/FALSE, default 1
|
|
51
|
+
* For instance range_lookup, A logical value that specifies whether you want VLOOKUP to find an approximate or an exact match
|
|
52
|
+
* Approximate match - 1/TRUE
|
|
53
|
+
* Exact match - 0/FALSE
|
|
54
|
+
* https://support.microsoft.com/en-us/office/vlookup-function-0bbc8083-26fe-4963-8ab8-93a18ad188a1
|
|
55
|
+
* For instance A1, A logical value that specifies what type of reference is contained in the cell ref_text.
|
|
56
|
+
* If a1 is TRUE or omitted, ref_text is interpreted as an A1-style reference.
|
|
57
|
+
* If a1 is FALSE, ref_text is interpreted as an R1C1-style reference.
|
|
58
|
+
* https://support.microsoft.com/zh-cn/office/indirect-%E5%87%BD%E6%95%B0-474b3a3a-8a26-4f44-b491-92b6306fa261
|
|
59
|
+
* @param logicValueObject
|
|
60
|
+
* @returns
|
|
61
|
+
*/
|
|
62
|
+
getZeroOrOneByOneDefault(logicValueObject?: BaseValueObject): number | undefined;
|
|
28
63
|
}
|
|
@@ -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 { FUNCTION_NAMES_COMPATIBILITY } from './function-names';
|
|
18
|
-
export declare const functionCompatibility: (FUNCTION_NAMES_COMPATIBILITY | typeof Concatenate)[][];
|
|
16
|
+
export declare const functionCompatibility: never[];
|
|
@@ -14,5 +14,42 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
export declare enum FUNCTION_NAMES_COMPATIBILITY {
|
|
17
|
-
|
|
17
|
+
BETADIST = "BETADIST",
|
|
18
|
+
BETAINV = "BETAINV",
|
|
19
|
+
BINOMDIST = "BINOMDIST",
|
|
20
|
+
CHIDIST = "CHIDIST",
|
|
21
|
+
CHIINV = "CHIINV",
|
|
22
|
+
CHITEST = "CHITEST",
|
|
23
|
+
CONFIDENCE = "CONFIDENCE",
|
|
24
|
+
COVAR = "COVAR",
|
|
25
|
+
CRITBINOM = "CRITBINOM",
|
|
26
|
+
EXPONDIST = "EXPONDIST",
|
|
27
|
+
FDIST = "FDIST",
|
|
28
|
+
FINV = "FINV",
|
|
29
|
+
FTEST = "FTEST",
|
|
30
|
+
GAMMADIST = "GAMMADIST",
|
|
31
|
+
GAMMAINV = "GAMMAINV",
|
|
32
|
+
HYPGEOMDIST = "HYPGEOMDIST",
|
|
33
|
+
LOGINV = "LOGINV",
|
|
34
|
+
LOGNORMDIST = "LOGNORMDIST",
|
|
35
|
+
MODE = "MODE",
|
|
36
|
+
NEGBINOMDIST = "NEGBINOMDIST",
|
|
37
|
+
NORMDIST = "NORMDIST",
|
|
38
|
+
NORMINV = "NORMINV",
|
|
39
|
+
NORMSDIST = "NORMSDIST",
|
|
40
|
+
NORMSINV = "NORMSINV",
|
|
41
|
+
PERCENTILE = "PERCENTILE",
|
|
42
|
+
PERCENTRANK = "PERCENTRANK",
|
|
43
|
+
POISSON = "POISSON",
|
|
44
|
+
QUARTILE = "QUARTILE",
|
|
45
|
+
RANK = "RANK",
|
|
46
|
+
STDEV = "STDEV",
|
|
47
|
+
STDEVP = "STDEVP",
|
|
48
|
+
TDIST = "TDIST",
|
|
49
|
+
TINV = "TINV",
|
|
50
|
+
TTEST = "TTEST",
|
|
51
|
+
VAR = "VAR",
|
|
52
|
+
VARP = "VARP",
|
|
53
|
+
WEIBULL = "WEIBULL",
|
|
54
|
+
ZTEST = "ZTEST"
|
|
18
55
|
}
|
|
@@ -14,4 +14,11 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
export declare enum FUNCTION_NAMES_CUBE {
|
|
17
|
+
CUBEKPIMEMBER = "CUBEKPIMEMBER",
|
|
18
|
+
CUBEMEMBER = "CUBEMEMBER",
|
|
19
|
+
CUBEMEMBERPROPERTY = "CUBEMEMBERPROPERTY",
|
|
20
|
+
CUBERANKEDMEMBER = "CUBERANKEDMEMBER",
|
|
21
|
+
CUBESET = "CUBESET",
|
|
22
|
+
CUBESETCOUNT = "CUBESETCOUNT",
|
|
23
|
+
CUBEVALUE = "CUBEVALUE"
|
|
17
24
|
}
|
|
@@ -14,4 +14,16 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
export declare enum FUNCTION_NAMES_DATABASE {
|
|
17
|
+
DAVERAGE = "DAVERAGE",
|
|
18
|
+
DCOUNT = "DCOUNT",
|
|
19
|
+
DCOUNTA = "DCOUNTA",
|
|
20
|
+
DGET = "DGET",
|
|
21
|
+
DMAX = "DMAX",
|
|
22
|
+
DMIN = "DMIN",
|
|
23
|
+
DPRODUCT = "DPRODUCT",
|
|
24
|
+
DSTDEV = "DSTDEV",
|
|
25
|
+
DSTDEVP = "DSTDEVP",
|
|
26
|
+
DSUM = "DSUM",
|
|
27
|
+
DVAR = "DVAR",
|
|
28
|
+
DVARP = "DVARP"
|
|
17
29
|
}
|
|
@@ -14,4 +14,29 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
export declare enum FUNCTION_NAMES_DATE {
|
|
17
|
+
DATE = "DATE",
|
|
18
|
+
DATEDIF = "DATEDIF",
|
|
19
|
+
DATEVALUE = "DATEVALUE",
|
|
20
|
+
DAY = "DAY",
|
|
21
|
+
DAYS = "DAYS",
|
|
22
|
+
DAYS360 = "DAYS360",
|
|
23
|
+
EDATE = "EDATE",
|
|
24
|
+
EOMONTH = "EOMONTH",
|
|
25
|
+
HOUR = "HOUR",
|
|
26
|
+
ISOWEEKNUM = "ISOWEEKNUM",
|
|
27
|
+
MINUTE = "MINUTE",
|
|
28
|
+
MONTH = "MONTH",
|
|
29
|
+
NETWORKDAYS = "NETWORKDAYS",
|
|
30
|
+
NETWORKDAYS_INTL = "NETWORKDAYS.INTL",
|
|
31
|
+
NOW = "NOW",
|
|
32
|
+
SECOND = "SECOND",
|
|
33
|
+
TIME = "TIME",
|
|
34
|
+
TIMEVALUE = "TIMEVALUE",
|
|
35
|
+
TODAY = "TODAY",
|
|
36
|
+
WEEKDAY = "WEEKDAY",
|
|
37
|
+
WEEKNUM = "WEEKNUM",
|
|
38
|
+
WORKDAY = "WORKDAY",
|
|
39
|
+
WORKDAY_INTL = "WORKDAY.INTL",
|
|
40
|
+
YEAR = "YEAR",
|
|
41
|
+
YEARFRAC = "YEARFRAC"
|
|
17
42
|
}
|
|
@@ -14,4 +14,58 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
export declare enum FUNCTION_NAMES_ENGINEERING {
|
|
17
|
+
BESSELI = "BESSELI",
|
|
18
|
+
BESSELJ = "BESSELJ",
|
|
19
|
+
BESSELK = "BESSELK",
|
|
20
|
+
BESSELY = "BESSELY",
|
|
21
|
+
BIN2DEC = "BIN2DEC",
|
|
22
|
+
BIN2HEX = "BIN2HEX",
|
|
23
|
+
BIN2OCT = "BIN2OCT",
|
|
24
|
+
BITAND = "BITAND",
|
|
25
|
+
BITLSHIFT = "BITLSHIFT",
|
|
26
|
+
BITOR = "BITOR",
|
|
27
|
+
BITRSHIFT = "BITRSHIFT",
|
|
28
|
+
BITXOR = "BITXOR",
|
|
29
|
+
COMPLEX = "COMPLEX",
|
|
30
|
+
CONVERT = "CONVERT",
|
|
31
|
+
DEC2BIN = "DEC2BIN",
|
|
32
|
+
DEC2HEX = "DEC2HEX",
|
|
33
|
+
DEC2OCT = "DEC2OCT",
|
|
34
|
+
DELTA = "DELTA",
|
|
35
|
+
ERF = "ERF",
|
|
36
|
+
ERF_PRECISE = "ERF.PRECISE",
|
|
37
|
+
ERFC = "ERFC",
|
|
38
|
+
ERFC_PRECISE = "ERFC.PRECISE",
|
|
39
|
+
GESTEP = "GESTEP",
|
|
40
|
+
HEX2BIN = "HEX2BIN",
|
|
41
|
+
HEX2DEC = "HEX2DEC",
|
|
42
|
+
HEX2OCT = "HEX2OCT",
|
|
43
|
+
IMABS = "IMABS",
|
|
44
|
+
IMAGINARY = "IMAGINARY",
|
|
45
|
+
IMARGUMENT = "IMARGUMENT",
|
|
46
|
+
IMCONJUGATE = "IMCONJUGATE",
|
|
47
|
+
IMCOS = "IMCOS",
|
|
48
|
+
IMCOSH = "IMCOSH",
|
|
49
|
+
IMCOT = "IMCOT",
|
|
50
|
+
IMCSC = "IMCSC",
|
|
51
|
+
IMCSCH = "IMCSCH",
|
|
52
|
+
IMDIV = "IMDIV",
|
|
53
|
+
IMEXP = "IMEXP",
|
|
54
|
+
IMLN = "IMLN",
|
|
55
|
+
IMLOG10 = "IMLOG10",
|
|
56
|
+
IMLOG2 = "IMLOG2",
|
|
57
|
+
IMPOWER = "IMPOWER",
|
|
58
|
+
IMPRODUCT = "IMPRODUCT",
|
|
59
|
+
IMREAL = "IMREAL",
|
|
60
|
+
IMSEC = "IMSEC",
|
|
61
|
+
IMSECH = "IMSECH",
|
|
62
|
+
IMSIN = "IMSIN",
|
|
63
|
+
IMSINH = "IMSINH",
|
|
64
|
+
IMSQRT = "IMSQRT",
|
|
65
|
+
IMSUB = "IMSUB",
|
|
66
|
+
IMSUM = "IMSUM",
|
|
67
|
+
IMTAN = "IMTAN",
|
|
68
|
+
OCT2BIN = "OCT2BIN",
|
|
69
|
+
OCT2DEC = "OCT2DEC",
|
|
70
|
+
OCT2HEX = "OCT2HEX"
|
|
17
71
|
}
|
|
@@ -14,4 +14,59 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
export declare enum FUNCTION_NAMES_FINANCIAL {
|
|
17
|
+
ACCRINT = "ACCRINT",
|
|
18
|
+
ACCRINTM = "ACCRINTM",
|
|
19
|
+
AMORDEGRC = "AMORDEGRC",
|
|
20
|
+
AMORLINC = "AMORLINC",
|
|
21
|
+
COUPDAYBS = "COUPDAYBS",
|
|
22
|
+
COUPDAYS = "COUPDAYS",
|
|
23
|
+
COUPDAYSNC = "COUPDAYSNC",
|
|
24
|
+
COUPNCD = "COUPNCD",
|
|
25
|
+
COUPNUM = "COUPNUM",
|
|
26
|
+
COUPPCD = "COUPPCD",
|
|
27
|
+
CUMIPMT = "CUMIPMT",
|
|
28
|
+
CUMPRINC = "CUMPRINC",
|
|
29
|
+
DB = "DB",
|
|
30
|
+
DDB = "DDB",
|
|
31
|
+
DISC = "DISC",
|
|
32
|
+
DOLLARDE = "DOLLARDE",
|
|
33
|
+
DOLLARFR = "DOLLARFR",
|
|
34
|
+
DURATION = "DURATION",
|
|
35
|
+
EFFECT = "EFFECT",
|
|
36
|
+
FV = "FV",
|
|
37
|
+
FVSCHEDULE = "FVSCHEDULE",
|
|
38
|
+
INTRATE = "INTRATE",
|
|
39
|
+
IPMT = "IPMT",
|
|
40
|
+
IRR = "IRR",
|
|
41
|
+
ISPMT = "ISPMT",
|
|
42
|
+
MDURATION = "MDURATION",
|
|
43
|
+
MIRR = "MIRR",
|
|
44
|
+
NOMINAL = "NOMINAL",
|
|
45
|
+
NPER = "NPER",
|
|
46
|
+
NPV = "NPV",
|
|
47
|
+
ODDFPRICE = "ODDFPRICE",
|
|
48
|
+
ODDFYIELD = "ODDFYIELD",
|
|
49
|
+
ODDLPRICE = "ODDLPRICE",
|
|
50
|
+
ODDLYIELD = "ODDLYIELD",
|
|
51
|
+
PDURATION = "PDURATION",
|
|
52
|
+
PMT = "PMT",
|
|
53
|
+
PPMT = "PPMT",
|
|
54
|
+
PRICE = "PRICE",
|
|
55
|
+
PRICEDISC = "PRICEDISC",
|
|
56
|
+
PRICEMAT = "PRICEMAT",
|
|
57
|
+
PV = "PV",
|
|
58
|
+
RATE = "RATE",
|
|
59
|
+
RECEIVED = "RECEIVED",
|
|
60
|
+
RRI = "RRI",
|
|
61
|
+
SLN = "SLN",
|
|
62
|
+
SYD = "SYD",
|
|
63
|
+
TBILLEQ = "TBILLEQ",
|
|
64
|
+
TBILLPRICE = "TBILLPRICE",
|
|
65
|
+
TBILLYIELD = "TBILLYIELD",
|
|
66
|
+
VDB = "VDB",
|
|
67
|
+
XIRR = "XIRR",
|
|
68
|
+
XNPV = "XNPV",
|
|
69
|
+
YIELD = "YIELD",
|
|
70
|
+
YIELDDISC = "YIELDDISC",
|
|
71
|
+
YIELDMAT = "YIELDMAT"
|
|
17
72
|
}
|
|
@@ -14,4 +14,25 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
export declare enum FUNCTION_NAMES_INFORMATION {
|
|
17
|
+
CELL = "CELL",
|
|
18
|
+
ERROR_TYPE = "ERROR.TYPE",
|
|
19
|
+
INFO = "INFO",
|
|
20
|
+
ISBLANK = "ISBLANK",
|
|
21
|
+
ISERR = "ISERR",
|
|
22
|
+
ISERROR = "ISERROR",
|
|
23
|
+
ISEVEN = "ISEVEN",
|
|
24
|
+
ISFORMULA = "ISFORMULA",
|
|
25
|
+
ISLOGICAL = "ISLOGICAL",
|
|
26
|
+
ISNA = "ISNA",
|
|
27
|
+
ISNONTEXT = "ISNONTEXT",
|
|
28
|
+
ISNUMBER = "ISNUMBER",
|
|
29
|
+
ISODD = "ISODD",
|
|
30
|
+
ISOMITTED = "ISOMITTED",
|
|
31
|
+
ISREF = "ISREF",
|
|
32
|
+
ISTEXT = "ISTEXT",
|
|
33
|
+
N = "N",
|
|
34
|
+
NA = "NA",
|
|
35
|
+
SHEET = "SHEET",
|
|
36
|
+
SHEETS = "SHEETS",
|
|
37
|
+
TYPE = "TYPE"
|
|
17
38
|
}
|
|
@@ -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 { FUNCTION_NAMES_LOGICAL } from './function-names';
|
|
17
|
+
import { Makearray } from './makearray';
|
|
18
|
+
export declare const functionLogical: (FUNCTION_NAMES_LOGICAL | typeof Makearray)[][];
|
|
@@ -14,4 +14,23 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
export declare enum FUNCTION_NAMES_LOGICAL {
|
|
17
|
+
AND = "AND",
|
|
18
|
+
BYCOL = "BYCOL",
|
|
19
|
+
BYROW = "BYROW",
|
|
20
|
+
FALSE = "FALSE",
|
|
21
|
+
IF = "IF",
|
|
22
|
+
IFERROR = "IFERROR",
|
|
23
|
+
IFNA = "IFNA",
|
|
24
|
+
IFS = "IFS",
|
|
25
|
+
LAMBDA = "LAMBDA",
|
|
26
|
+
LET = "LET",
|
|
27
|
+
MAKEARRAY = "MAKEARRAY",
|
|
28
|
+
MAP = "MAP",
|
|
29
|
+
NOT = "NOT",
|
|
30
|
+
OR = "OR",
|
|
31
|
+
REDUCE = "REDUCE",
|
|
32
|
+
SCAN = "SCAN",
|
|
33
|
+
SWITCH = "SWITCH",
|
|
34
|
+
TRUE = "TRUE",
|
|
35
|
+
XOR = "XOR"
|
|
17
36
|
}
|
|
@@ -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
|
+
import { type BaseValueObject, ErrorValueObject } from '../../../engine/value-object/base-value-object';
|
|
17
|
+
import { BaseFunction } from '../../base-function';
|
|
18
|
+
/**
|
|
19
|
+
* Lambda functions are unique and are generated directly by the higher level.
|
|
20
|
+
* Please refer to the lambdaNode; here, it serves the purpose of a placeholder for the formula.
|
|
21
|
+
*/
|
|
22
|
+
export declare class Lambda extends BaseFunction {
|
|
23
|
+
calculate(...variants: BaseValueObject[]): ErrorValueObject;
|
|
24
|
+
}
|
|
@@ -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 {};
|