@univerjs/engine-formula 0.1.0-beta.2 → 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 +3154 -2982
- package/lib/types/basics/regex.d.ts +9 -9
- package/lib/types/engine/reference-object/base-reference-object.d.ts +5 -5
- 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/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 +5 -6
- package/lib/types/engine/value-object/base-value-object.d.ts +9 -9
- package/lib/types/engine/value-object/primitive-object.d.ts +0 -1
- package/lib/types/functions/lookup/address/index.d.ts +2 -3
- package/lib/types/functions/math/sumif/index.d.ts +2 -3
- package/lib/types/index.d.ts +2 -0
- package/lib/umd/index.js +1 -1
- package/package.json +26 -23
|
@@ -17,15 +17,15 @@ export declare const SHEET_NAME_REGEX = "((?![\\[\\]\\/?*\\\\]).)*!";
|
|
|
17
17
|
export declare const ABSOLUTE_SYMBOL = "$";
|
|
18
18
|
export declare const RANGE_SYMBOL = "\\s*?:\\s*?";
|
|
19
19
|
export declare const SIMPLE_SINGLE_RANGE_REGEX = "\\$?[A-Za-z]+\\$?[0-9]+";
|
|
20
|
-
export declare const REFERENCE_MULTIPLE_RANGE_REGEX = "^(@)?(
|
|
21
|
-
export declare const REFERENCE_SINGLE_RANGE_REGEX = "^(
|
|
22
|
-
export declare const REFERENCE_REGEX_ROW = "^(
|
|
23
|
-
export declare const REFERENCE_REGEX_COLUMN = "^(
|
|
24
|
-
export declare const REFERENCE_REGEX_SINGLE_ROW = "^(
|
|
25
|
-
export declare const REFERENCE_REGEX_SINGLE_COLUMN = "^(
|
|
26
|
-
export declare const REFERENCE_TABLE_ALL_COLUMN_REGEX = "^(
|
|
27
|
-
export declare const REFERENCE_TABLE_SINGLE_COLUMN_REGEX = "^(
|
|
28
|
-
export declare const REFERENCE_TABLE_MULTIPLE_COLUMN_REGEX = "^(
|
|
20
|
+
export declare const REFERENCE_MULTIPLE_RANGE_REGEX = "^(@)?(\\[([^\\[\\]\\/?:\"<>|*\\\\]+)\\])?(((?![\\[\\]\\/?*\\\\]).)*!)?\\$?[A-Za-z]+\\$?[0-9]+\\s*?:\\s*?\\$?[A-Za-z]+\\$?[0-9]+$";
|
|
21
|
+
export declare const REFERENCE_SINGLE_RANGE_REGEX = "^(\\[([^\\[\\]\\/?:\"<>|*\\\\]+)\\])?(((?![\\[\\]\\/?*\\\\]).)*!)?\\s*?\\$?[A-Za-z]+\\$?[0-9]+(#)?$";
|
|
22
|
+
export declare const REFERENCE_REGEX_ROW = "^(\\[([^\\[\\]\\/?:\"<>|*\\\\]+)\\])?(((?![\\[\\]\\/?*\\\\]).)*!)?\\$?[0-9]+\\s*?:\\s*?\\$?[0-9]+$";
|
|
23
|
+
export declare const REFERENCE_REGEX_COLUMN = "^(\\[([^\\[\\]\\/?:\"<>|*\\\\]+)\\])?(((?![\\[\\]\\/?*\\\\]).)*!)?\\$?[A-Za-z]+\\s*?:\\s*?\\$?[A-Za-z]+$";
|
|
24
|
+
export declare const REFERENCE_REGEX_SINGLE_ROW = "^(\\[([^\\[\\]\\/?:\"<>|*\\\\]+)\\])?(((?![\\[\\]\\/?*\\\\]).)*!)?\\s*?\\$?[0-9]+$";
|
|
25
|
+
export declare const REFERENCE_REGEX_SINGLE_COLUMN = "^(\\[([^\\[\\]\\/?:\"<>|*\\\\]+)\\])?(((?![\\[\\]\\/?*\\\\]).)*!)?\\s*?\\$?[A-Za-z]+$";
|
|
26
|
+
export declare const REFERENCE_TABLE_ALL_COLUMN_REGEX = "^(\\[([^\\[\\]\\/?:\"<>|*\\\\]+)\\])?((?![~!@#$%^&*()_+<>?:,./;\u2019\uFF0C\u3002\u3001\u2018\uFF1A\u201C\u300A\u300B\uFF1F~\uFF01@#\uFFE5%\u2026\u2026\uFF08\uFF09\u3010\u3011\\[\\]\\/\\\\]).)+$";
|
|
27
|
+
export declare const REFERENCE_TABLE_SINGLE_COLUMN_REGEX = "^(\\[([^\\[\\]\\/?:\"<>|*\\\\]+)\\])?((?![~!@#$%^&*()_+<>?:,./;\u2019\uFF0C\u3002\u3001\u2018\uFF1A\u201C\u300A\u300B\uFF1F~\uFF01@#\uFFE5%\u2026\u2026\uFF08\uFF09\u3010\u3011\\[\\]\\/\\\\]).)+(\\[((?<!#).)*\\]|\\[\\[#.+\\]\\s*?,\\s*?\\[((?<!#).)*\\]\\])+$";
|
|
28
|
+
export declare const REFERENCE_TABLE_MULTIPLE_COLUMN_REGEX = "^(\\[([^\\[\\]\\/?:\"<>|*\\\\]+)\\])?((?![~!@#$%^&*()_+<>?:,./;\u2019\uFF0C\u3002\u3001\u2018\uFF1A\u201C\u300A\u300B\uFF1F~\uFF01@#\uFFE5%\u2026\u2026\uFF08\uFF09\u3010\u3011\\[\\]\\/\\\\]).)+(\\[\\[((?<!#).)*\\]\\s*?:\\s*?\\[((?<!#).)*\\]\\])?$|^((?![~!@#$%^&*()_+<>?:,./;\u2019\uFF0C\u3002\u3001\u2018\uFF1A\u201C\u300A\u300B\uFF1F~\uFF01@#\uFFE5%\u2026\u2026\uFF08\uFF09\u3010\u3011\\[\\]\\/\\\\]).)+(\\[\\[#.+\\]\\s*?,\\s*?\\[((?<!#).)*\\]\\s*?:\\s*?\\[((?<!#).)*\\]\\])?$";
|
|
29
29
|
export declare const $SUPER_TABLE_COLUMN_REGEX = "[.*?]";
|
|
30
30
|
export declare const $ARRAY_VALUE_REGEX = "{.*?}";
|
|
31
31
|
export declare function isReferenceString(refString: string): boolean;
|
|
@@ -54,7 +54,7 @@ export declare class BaseReferenceObject extends ObjectClassType {
|
|
|
54
54
|
};
|
|
55
55
|
isReferenceObject(): boolean;
|
|
56
56
|
iterator(callback: (valueObject: Nullable<BaseValueObject>, rowIndex: number, columnIndex: number) => Nullable<boolean>): Nullable<boolean>;
|
|
57
|
-
getFirstCell(): NullValueObject | NumberValueObject | StringValueObject | BooleanValueObject |
|
|
57
|
+
getFirstCell(): ErrorValueObject | NullValueObject | NumberValueObject | StringValueObject | BooleanValueObject | ArrayValueObject;
|
|
58
58
|
getRangeData(): IRange;
|
|
59
59
|
setRangeData(range: IRange): void;
|
|
60
60
|
getUnitId(): string;
|
|
@@ -93,16 +93,16 @@ export declare class BaseReferenceObject extends ObjectClassType {
|
|
|
93
93
|
isTable(): boolean;
|
|
94
94
|
unionBy(referenceObject: BaseReferenceObject): NodeValueType;
|
|
95
95
|
unionRange(rangeData1: IRange, rangeData2: IRange): IRange;
|
|
96
|
-
getCellValueObject(cell: ICellData): NullValueObject | NumberValueObject | StringValueObject | BooleanValueObject |
|
|
97
|
-
getCellByRow(row: number): NullValueObject | NumberValueObject | StringValueObject | BooleanValueObject |
|
|
98
|
-
getCellByColumn(column: number): NullValueObject | NumberValueObject | StringValueObject | BooleanValueObject |
|
|
96
|
+
getCellValueObject(cell: ICellData): ErrorValueObject | NullValueObject | NumberValueObject | StringValueObject | BooleanValueObject | ArrayValueObject;
|
|
97
|
+
getCellByRow(row: number): ErrorValueObject | NullValueObject | NumberValueObject | StringValueObject | BooleanValueObject | ArrayValueObject;
|
|
98
|
+
getCellByColumn(column: number): ErrorValueObject | NullValueObject | NumberValueObject | StringValueObject | BooleanValueObject | ArrayValueObject;
|
|
99
99
|
getCurrentActiveSheetData(): import("../../basics/common").ISheetItem;
|
|
100
100
|
getCurrentRuntimeSheetData(): import("@univerjs/core").ObjectMatrix<Nullable<ICellData>> | undefined;
|
|
101
101
|
getCurrentActiveArrayFormulaCellData(): import("@univerjs/core").ObjectMatrix<Nullable<ICellData>> | undefined;
|
|
102
102
|
getCurrentRuntimeActiveArrayFormulaCellData(): import("@univerjs/core").ObjectMatrix<Nullable<ICellData>> | undefined;
|
|
103
103
|
getCellData(row: number, column: number): ICellData;
|
|
104
104
|
getRuntimeFeatureCellValue(row: number, column: number): ICellData | undefined;
|
|
105
|
-
getCellByPosition(row?: number, column?: number): NullValueObject | NumberValueObject | StringValueObject | BooleanValueObject |
|
|
105
|
+
getCellByPosition(row?: number, column?: number): ErrorValueObject | NullValueObject | NumberValueObject | StringValueObject | BooleanValueObject | ArrayValueObject;
|
|
106
106
|
toArrayValueObject(useCache?: boolean): ArrayValueObject;
|
|
107
107
|
toUnitRange(): {
|
|
108
108
|
range: {
|
|
@@ -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 {};
|
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import { compareToken } from '../../basics/token';
|
|
17
|
-
import type { BaseReferenceObject } from '../reference-object/base-reference-object';
|
|
18
17
|
import type { BaseValueObject } from '../value-object/base-value-object';
|
|
19
18
|
export declare function findCompareToken(str: string): [compareToken, BaseValueObject];
|
|
20
19
|
/**
|
|
@@ -23,4 +22,4 @@ export declare function findCompareToken(str: string): [compareToken, BaseValueO
|
|
|
23
22
|
* 2. >=apple*: normal value, >apple: obtains the same effect as >=apple*
|
|
24
23
|
* 3. <apple*: normal value, <=apple: obtains the same effect as <apple*
|
|
25
24
|
*/
|
|
26
|
-
export declare function valueObjectCompare(range:
|
|
25
|
+
export declare function valueObjectCompare(range: BaseValueObject, criteria: BaseValueObject, operator?: compareToken): BaseValueObject;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { type IRange } from '@univerjs/core';
|
|
17
|
+
import type { IGridRangeName } from './reference';
|
|
18
|
+
export declare function deserializeRangeForR1C1(refString: string, currentRow?: number, currentColumn?: number): IGridRangeName;
|
|
19
|
+
export declare function serializeRangeToR1C1(range: IRange): string;
|
|
@@ -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;
|
|
@@ -79,16 +79,16 @@ export declare class ArrayValueObject extends BaseValueObject {
|
|
|
79
79
|
* @param takeArray
|
|
80
80
|
*/
|
|
81
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;
|
|
82
86
|
sum(): BaseValueObject;
|
|
83
87
|
max(): BaseValueObject;
|
|
84
88
|
min(): BaseValueObject;
|
|
85
89
|
count(): BaseValueObject;
|
|
86
90
|
countA(): BaseValueObject;
|
|
87
91
|
countBlank(): BaseValueObject;
|
|
88
|
-
sortByRow(index: number): void;
|
|
89
|
-
sortByColumn(index: number): void;
|
|
90
|
-
transpose(): ArrayValueObject;
|
|
91
|
-
binarySearch(valueObject: BaseValueObject, searchType?: ArrayBinarySearchType): number | null | undefined;
|
|
92
92
|
getNegative(): BaseValueObject;
|
|
93
93
|
getReciprocal(): BaseValueObject;
|
|
94
94
|
plus(valueObject: BaseValueObject): BaseValueObject;
|
|
@@ -96,7 +96,6 @@ export declare class ArrayValueObject extends BaseValueObject {
|
|
|
96
96
|
multiply(valueObject: BaseValueObject): BaseValueObject;
|
|
97
97
|
divided(valueObject: BaseValueObject): BaseValueObject;
|
|
98
98
|
compare(valueObject: BaseValueObject, operator: compareToken): BaseValueObject;
|
|
99
|
-
wildcard(valueObject: BaseValueObject, operator: compareToken): BaseValueObject;
|
|
100
99
|
concatenateFront(valueObject: BaseValueObject): BaseValueObject;
|
|
101
100
|
concatenateBack(valueObject: BaseValueObject): BaseValueObject;
|
|
102
101
|
product(valueObject: BaseValueObject, callbackFn: callbackProductFnType): BaseValueObject;
|
|
@@ -148,5 +147,5 @@ export declare class ArrayValueObject extends BaseValueObject {
|
|
|
148
147
|
private _createNewArray;
|
|
149
148
|
}
|
|
150
149
|
export declare class ValueObjectFactory {
|
|
151
|
-
static create(rawValue: string | number | boolean | null): NullValueObject | NumberValueObject | StringValueObject | BooleanValueObject |
|
|
150
|
+
static create(rawValue: string | number | boolean | null): ErrorValueObject | NullValueObject | NumberValueObject | StringValueObject | BooleanValueObject | ArrayValueObject;
|
|
152
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 {
|
|
@@ -54,6 +53,12 @@ export declare class BaseValueObject extends ObjectClassType {
|
|
|
54
53
|
isLambda(): boolean;
|
|
55
54
|
isError(): boolean;
|
|
56
55
|
isNull(): boolean;
|
|
56
|
+
sum(): BaseValueObject;
|
|
57
|
+
max(): BaseValueObject;
|
|
58
|
+
min(): BaseValueObject;
|
|
59
|
+
count(): BaseValueObject;
|
|
60
|
+
countA(): BaseValueObject;
|
|
61
|
+
countBlank(): BaseValueObject;
|
|
57
62
|
getNegative(): BaseValueObject;
|
|
58
63
|
getReciprocal(): BaseValueObject;
|
|
59
64
|
plus(valueObject: BaseValueObject): BaseValueObject;
|
|
@@ -63,7 +68,6 @@ export declare class BaseValueObject extends ObjectClassType {
|
|
|
63
68
|
map(callbackFn: callbackMapFnType): BaseValueObject;
|
|
64
69
|
product(valueObject: BaseValueObject, callbackFn: callbackProductFnType): BaseValueObject;
|
|
65
70
|
compare(valueObject: BaseValueObject, operator: compareToken): BaseValueObject;
|
|
66
|
-
wildcard(valueObject: StringValueObject, operator: compareToken): BaseValueObject;
|
|
67
71
|
isEqual(valueObject: BaseValueObject): BaseValueObject;
|
|
68
72
|
isNotEqual(valueObject: BaseValueObject): BaseValueObject;
|
|
69
73
|
isGreaterThanOrEqual(valueObject: BaseValueObject): BaseValueObject;
|
|
@@ -104,20 +108,20 @@ export declare class BaseValueObject extends ObjectClassType {
|
|
|
104
108
|
/**
|
|
105
109
|
* Calculate the median of the entire array.
|
|
106
110
|
*
|
|
107
|
-
* https://numpy.org/doc/stable/reference/generated/numpy.median.html
|
|
111
|
+
* reference https://numpy.org/doc/stable/reference/generated/numpy.median.html
|
|
108
112
|
*
|
|
109
113
|
*/
|
|
110
114
|
median(): BaseValueObject;
|
|
111
115
|
/**
|
|
112
116
|
* Calculate the variance of the entire array.
|
|
113
117
|
*
|
|
114
|
-
* https://numpy.org/doc/stable/reference/generated/numpy.var.html
|
|
118
|
+
* reference https://numpy.org/doc/stable/reference/generated/numpy.var.html
|
|
115
119
|
*/
|
|
116
120
|
var(): BaseValueObject;
|
|
117
121
|
/**
|
|
118
122
|
* Calculate the standard deviation of the entire array.
|
|
119
123
|
*
|
|
120
|
-
* https://numpy.org/doc/stable/reference/generated/numpy.std.html
|
|
124
|
+
* reference https://numpy.org/doc/stable/reference/generated/numpy.std.html
|
|
121
125
|
*/
|
|
122
126
|
std(): BaseValueObject;
|
|
123
127
|
log(): BaseValueObject;
|
|
@@ -135,10 +139,6 @@ export declare class ErrorValueObject extends BaseValueObject {
|
|
|
135
139
|
private _errorType;
|
|
136
140
|
private _errorContent;
|
|
137
141
|
constructor(_errorType: ErrorType, _errorContent?: string);
|
|
138
|
-
/**
|
|
139
|
-
* @deprecated use 'new' to replace.
|
|
140
|
-
*/
|
|
141
|
-
static create(errorType: ErrorType, errorContent?: string): ErrorValueObject;
|
|
142
142
|
getValue(): ErrorType;
|
|
143
143
|
getErrorType(): ErrorType;
|
|
144
144
|
getErrorContent(): string;
|
|
@@ -141,7 +141,6 @@ export declare class StringValueObject extends BaseValueObject {
|
|
|
141
141
|
concatenateFront(valueObject: BaseValueObject): BaseValueObject;
|
|
142
142
|
concatenateBack(valueObject: BaseValueObject): BaseValueObject;
|
|
143
143
|
compare(valueObject: BaseValueObject, operator: compareToken): BaseValueObject;
|
|
144
|
-
wildcard(valueObject: StringValueObject, operator: compareToken): BaseValueObject;
|
|
145
144
|
compareBy(value: string | number | boolean, operator: compareToken): BaseValueObject;
|
|
146
145
|
private _checkWildcard;
|
|
147
146
|
}
|
|
@@ -13,10 +13,9 @@
|
|
|
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 { ErrorValueObject } from '../../../engine/value-object/base-value-object';
|
|
16
|
+
import { type BaseValueObject, ErrorValueObject } from '../../../engine/value-object/base-value-object';
|
|
18
17
|
import { StringValueObject } from '../../../engine/value-object/primitive-object';
|
|
19
18
|
import { BaseFunction } from '../../base-function';
|
|
20
19
|
export declare class Address extends BaseFunction {
|
|
21
|
-
calculate(rowNumber:
|
|
20
|
+
calculate(rowNumber: BaseValueObject, columnNumber: BaseValueObject, absNumber?: BaseValueObject, a1?: BaseValueObject, sheetText?: BaseValueObject): ErrorValueObject | StringValueObject;
|
|
22
21
|
}
|
|
@@ -13,10 +13,9 @@
|
|
|
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 Sumif extends BaseFunction {
|
|
20
|
-
calculate(
|
|
21
|
-
private
|
|
19
|
+
calculate(range: BaseValueObject, criteria: BaseValueObject, sumRange?: BaseValueObject): BaseValueObject;
|
|
20
|
+
private _handleSingleObject;
|
|
22
21
|
}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -35,6 +35,8 @@ export { LexerNode } from './engine/analysis/lexer-node';
|
|
|
35
35
|
export { LexerTreeBuilder } from './engine/analysis/lexer-tree-builder';
|
|
36
36
|
export { BaseReferenceObject, type FunctionVariantType } from './engine/reference-object/base-reference-object';
|
|
37
37
|
export { RangeReferenceObject } from './engine/reference-object/range-reference-object';
|
|
38
|
+
export { deserializeRangeForR1C1 } from './engine/utils/r1c1-reference';
|
|
39
|
+
export { deserializeRangeWithSheet, getAbsoluteRefTypeWithSingleString, getAbsoluteRefTypeWitString, type IAbsoluteRefTypeForRange, serializeRange, serializeRangeToRefString, serializeRangeWithSheet, serializeRangeWithSpreadsheet, UNIT_NAME_REGEX, } from './engine/utils/reference';
|
|
38
40
|
export { generateStringWithSequence, type ISequenceNode, sequenceNodeType } from './engine/utils/sequence';
|
|
39
41
|
export { ArrayValueObject, ValueObjectFactory } from './engine/value-object/array-value-object';
|
|
40
42
|
export { BaseValueObject, ErrorValueObject } from './engine/value-object/base-value-object';
|