@univerjs/engine-formula 0.1.0-beta.3 → 0.1.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/lib/cjs/index.js +1 -1
  2. package/lib/es/index.js +3535 -2988
  3. package/lib/types/basics/common.d.ts +1 -1
  4. package/lib/types/basics/error-type.d.ts +1 -1
  5. package/lib/types/engine/ast-node/reference-node.d.ts +2 -1
  6. package/lib/types/engine/utils/array-object.d.ts +19 -0
  7. package/lib/types/engine/utils/compare.d.ts +5 -0
  8. package/lib/types/engine/utils/object-compare.d.ts +7 -0
  9. package/lib/types/engine/value-object/array-value-object.d.ts +37 -3
  10. package/lib/types/engine/value-object/base-value-object.d.ts +1 -0
  11. package/lib/types/functions/__tests__/{create-command-test-bed.d.ts → create-function-test-bed.d.ts} +1 -1
  12. package/lib/types/functions/base-function.d.ts +16 -1
  13. package/lib/types/functions/information/function-map.d.ts +3 -1
  14. package/lib/types/functions/information/isblank/__tests__/index.spec.d.ts +16 -0
  15. package/lib/types/functions/information/isblank/index.d.ts +20 -0
  16. package/lib/types/functions/logical/and/__tests__/index.spec.d.ts +16 -0
  17. package/lib/types/functions/logical/and/index.d.ts +20 -0
  18. package/lib/types/functions/logical/function-map.d.ts +2 -1
  19. package/lib/types/functions/logical/if/__tests__/index.spec.d.ts +16 -0
  20. package/lib/types/functions/logical/if/index.d.ts +22 -0
  21. package/lib/types/functions/logical/iferror/__tests__/index.spec.d.ts +16 -0
  22. package/lib/types/functions/logical/iferror/index.d.ts +20 -0
  23. package/lib/types/functions/lookup/function-map.d.ts +4 -1
  24. package/lib/types/functions/lookup/hlookup/__tests__/index.spec.d.ts +16 -0
  25. package/lib/types/functions/lookup/hlookup/index.d.ts +21 -0
  26. package/lib/types/functions/lookup/lookup/__tests__/index.spec.d.ts +16 -0
  27. package/lib/types/functions/lookup/lookup/index.d.ts +23 -0
  28. package/lib/types/functions/lookup/offset/__tests__/index.spec.d.ts +16 -0
  29. package/lib/types/functions/lookup/offset/index.d.ts +5 -3
  30. package/lib/types/functions/lookup/xlookup/__tests__/index.spec.d.ts +16 -0
  31. package/lib/types/functions/lookup/xlookup/index.d.ts +24 -0
  32. package/lib/types/functions/math/sumifs/index.d.ts +3 -2
  33. package/lib/types/functions/text/concatenate/__tests__/index.spec.d.ts +16 -0
  34. package/lib/types/functions/text/concatenate/index.d.ts +2 -3
  35. package/lib/types/services/current-data.service.d.ts +1 -0
  36. package/lib/umd/index.js +1 -1
  37. package/package.json +4 -4
@@ -60,7 +60,7 @@ export interface IUnitSheetNameMap {
60
60
  }
61
61
  export interface IDirtyUnitSheetNameMap {
62
62
  [unitId: string]: Nullable<{
63
- [sheetId: string]: Nullable<string>;
63
+ [sheetId: string]: string;
64
64
  }>;
65
65
  }
66
66
  export interface IDirtyUnitFeatureMap {
@@ -17,7 +17,7 @@ export declare enum ErrorType {
17
17
  /** Division by zero. */
18
18
  DIV_BY_ZERO = "#DIV/0!",
19
19
  /** Function error. */
20
- NAME = "#NAME!",
20
+ NAME = "#NAME?",
21
21
  VALUE = "#VALUE!",
22
22
  NUM = "#NUM!",
23
23
  NA = "#N/A",
@@ -28,7 +28,8 @@ export declare class ReferenceNode extends BaseAstNode {
28
28
  private _accessor;
29
29
  private _operatorString;
30
30
  private _referenceObject;
31
- constructor(_accessor: IAccessor, _operatorString: string, _referenceObject: BaseReferenceObject);
31
+ private _isPrepareMerge;
32
+ constructor(_accessor: IAccessor, _operatorString: string, _referenceObject: BaseReferenceObject, _isPrepareMerge?: boolean);
32
33
  get nodeType(): NodeType;
33
34
  execute(): void;
34
35
  }
@@ -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 { ArrayValueObject } from '../value-object/array-value-object';
17
+ import type { BaseValueObject } from '../value-object/base-value-object';
18
+ export declare function expandArrayValueObject(rowCount: number, columnCount: number, valueObject: BaseValueObject, defaultValue?: BaseValueObject): ArrayValueObject;
19
+ export declare function createNewArray(result: BaseValueObject[][], rowCount: number, columnCount: number): ArrayValueObject;
@@ -18,6 +18,11 @@ export declare enum ArrayBinarySearchType {
18
18
  MIN = 0,
19
19
  MAX = 1
20
20
  }
21
+ export declare enum ArrayOrderSearchType {
22
+ NORMAL = 0,
23
+ MIN = 1,
24
+ MAX = 2
25
+ }
21
26
  export declare function getCompare(): (x: string, y: string) => number;
22
27
  export declare function isWildcard(str: string): boolean;
23
28
  export declare function isMatchWildcard(currentValue: string, value: string): boolean;
@@ -23,3 +23,10 @@ export declare function findCompareToken(str: string): [compareToken, BaseValueO
23
23
  * 3. <apple*: normal value, <=apple: obtains the same effect as <apple*
24
24
  */
25
25
  export declare function valueObjectCompare(range: BaseValueObject, criteria: BaseValueObject, operator?: compareToken): BaseValueObject;
26
+ /**
27
+ * Find the Boolean intersection of two ArrayValueObjects
28
+ * @param valueObject1
29
+ * @param valueObject2
30
+ * @returns
31
+ */
32
+ export declare function booleanObjectIntersection(valueObject1: BaseValueObject, valueObject2: BaseValueObject): BaseValueObject;
@@ -13,9 +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 Nullable } from '@univerjs/core';
16
+ import type { Nullable } from '@univerjs/core';
17
17
  import { compareToken } from '../../basics/token';
18
- import { ArrayBinarySearchType } from '../utils/compare';
18
+ import { ArrayBinarySearchType, ArrayOrderSearchType } from '../utils/compare';
19
19
  import type { callbackMapFnType, callbackProductFnType, IArrayValueObject } from './base-value-object';
20
20
  import { BaseValueObject, ErrorValueObject } from './base-value-object';
21
21
  import { BooleanValueObject, NullValueObject, NumberValueObject, StringValueObject } from './primitive-object';
@@ -32,8 +32,10 @@ export declare class ArrayValueObject extends BaseValueObject {
32
32
  private _currentColumn;
33
33
  private _sliceCache;
34
34
  private _flattenCache;
35
+ private _flattenPosition;
35
36
  constructor(rawValue: string | IArrayValueObject);
36
37
  dispose(): void;
38
+ clone(): ArrayValueObject;
37
39
  getRowCount(): number;
38
40
  setRowCount(rowCount: number): void;
39
41
  getColumnCount(): number;
@@ -49,6 +51,7 @@ export declare class ArrayValueObject extends BaseValueObject {
49
51
  setArrayValue(value: BaseValueObject[][]): void;
50
52
  isArray(): boolean;
51
53
  get(row: number, column: number): BaseValueObject;
54
+ getRealValue(row: number, column: number): BaseValueObject | null;
52
55
  set(row: number, column: number, value: BaseValueObject): void;
53
56
  getRangePosition(): {
54
57
  startRow: number;
@@ -57,7 +60,17 @@ export declare class ArrayValueObject extends BaseValueObject {
57
60
  endColumn: number;
58
61
  };
59
62
  iterator(callback: (valueObject: Nullable<BaseValueObject>, rowIndex: number, columnIndex: number) => Nullable<boolean>): void;
63
+ iteratorReverse(callback: (valueObject: Nullable<BaseValueObject>, rowIndex: number, columnIndex: number) => Nullable<boolean>): void;
64
+ getLastTruePosition(): Nullable<{
65
+ row: number;
66
+ column: number;
67
+ }>;
68
+ getFirstTruePosition(): Nullable<{
69
+ row: number;
70
+ column: number;
71
+ }>;
60
72
  getFirstCell(): BaseValueObject;
73
+ getLastCell(): BaseValueObject;
61
74
  /**
62
75
  * Referring to matrix calculations,
63
76
  * extract the matching values from a true/false matrix based on parameters and store them in a two-dimensional array.
@@ -71,6 +84,16 @@ export declare class ArrayValueObject extends BaseValueObject {
71
84
  * https://numpy.org/doc/stable/reference/generated/numpy.chararray.flatten.html#numpy.chararray.flatten
72
85
  */
73
86
  flatten(): ArrayValueObject;
87
+ /**
88
+ * Flatten a 2D array.
89
+ * In Excel, errors and blank cells are ignored, which results in a binary search that cannot strictly adhere to the number of cells.
90
+ */
91
+ flattenPosition(): {
92
+ stringArray: BaseValueObject[];
93
+ stringPosition: number[];
94
+ numberArray: BaseValueObject[];
95
+ numberPosition: number[];
96
+ };
74
97
  /**
75
98
  * I'm looking to perform slicing operations on 2D arrays, similar to the functionality provided by NumPy.
76
99
  * https://numpy.org/doc/stable/user/basics.indexing.html
@@ -82,7 +105,17 @@ export declare class ArrayValueObject extends BaseValueObject {
82
105
  sortByRow(index: number): void;
83
106
  sortByColumn(index: number): void;
84
107
  transpose(): ArrayValueObject;
85
- binarySearch(valueObject: BaseValueObject, searchType?: ArrayBinarySearchType): number | null | undefined;
108
+ /**
109
+ * Due to the inability to effectively utilize the cache,
110
+ * the sequential matching approach is only used for special matches in XLOOKUP and XMATCH.
111
+ * For example, when match_mode is set to 1 and -1 for an exact match. If not found, it returns the next smaller item.
112
+ */
113
+ orderSearch(valueObject: BaseValueObject, searchType?: ArrayOrderSearchType, isDesc?: boolean, isFuzzyMatching?: boolean): void | {
114
+ row: number;
115
+ column: number;
116
+ } | null;
117
+ binarySearch(valueObject: BaseValueObject, searchType?: ArrayBinarySearchType): number | undefined;
118
+ private _binarySearch;
86
119
  sum(): BaseValueObject;
87
120
  max(): BaseValueObject;
88
121
  min(): BaseValueObject;
@@ -100,6 +133,7 @@ export declare class ArrayValueObject extends BaseValueObject {
100
133
  concatenateBack(valueObject: BaseValueObject): BaseValueObject;
101
134
  product(valueObject: BaseValueObject, callbackFn: callbackProductFnType): BaseValueObject;
102
135
  map(callbackFn: callbackMapFnType): BaseValueObject;
136
+ mapValue(callbackFn: callbackMapFnType): BaseValueObject;
103
137
  pow(valueObject: BaseValueObject): BaseValueObject;
104
138
  /**
105
139
  *
@@ -66,6 +66,7 @@ export declare class BaseValueObject extends ObjectClassType {
66
66
  multiply(valueObject: BaseValueObject): BaseValueObject;
67
67
  divided(valueObject: BaseValueObject): BaseValueObject;
68
68
  map(callbackFn: callbackMapFnType): BaseValueObject;
69
+ mapValue(callbackFn: callbackMapFnType): BaseValueObject;
69
70
  product(valueObject: BaseValueObject, callbackFn: callbackProductFnType): BaseValueObject;
70
71
  compare(valueObject: BaseValueObject, operator: compareToken): BaseValueObject;
71
72
  isEqual(valueObject: BaseValueObject): BaseValueObject;
@@ -17,7 +17,7 @@ import type { IWorkbookData } from '@univerjs/core';
17
17
  import { Univer } from '@univerjs/core';
18
18
  import type { Dependency } from '@wendellhu/redi';
19
19
  import type { ISheetData } from '../../basics/common';
20
- export declare function createCommandTestBed(workbookConfig?: IWorkbookData, dependencies?: Dependency[]): {
20
+ export declare function createFunctionTestBed(workbookConfig?: IWorkbookData, dependencies?: Dependency[]): {
21
21
  univer: Univer;
22
22
  get: {
23
23
  <T>(id: import("@wendellhu/redi").DependencyIdentifier<T>, lookUp?: import("@wendellhu/redi").LookUp | undefined): T;
@@ -17,6 +17,9 @@ import type { Nullable } from '@univerjs/core';
17
17
  import { Disposable } from '@univerjs/core';
18
18
  import type { IFunctionNames } from '../basics/function';
19
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';
20
23
  import { type BaseValueObject, ErrorValueObject } from '../engine/value-object/base-value-object';
21
24
  import type { PrimitiveValueType } from '../engine/value-object/primitive-object';
22
25
  export declare class BaseFunction extends Disposable {
@@ -45,7 +48,7 @@ export declare class BaseFunction extends Disposable {
45
48
  * @param indexNum
46
49
  * @returns
47
50
  */
48
- getIndexNumValue(indexNum: BaseValueObject): number | ErrorValueObject;
51
+ getIndexNumValue(indexNum: BaseValueObject, defaultValue?: number): number | ErrorValueObject;
49
52
  /**
50
53
  * A logical value that specifies 1/TRUE , 0/FALSE, default 1
51
54
  * For instance range_lookup, A logical value that specifies whether you want VLOOKUP to find an approximate or an exact match
@@ -60,4 +63,16 @@ export declare class BaseFunction extends Disposable {
60
63
  * @returns
61
64
  */
62
65
  getZeroOrOneByOneDefault(logicValueObject?: BaseValueObject): number | undefined;
66
+ binarySearch(value: BaseValueObject, searchArray: ArrayValueObject, resultArray: ArrayValueObject, searchType?: ArrayBinarySearchType): BaseValueObject;
67
+ equalSearch(value: BaseValueObject, searchArray: ArrayValueObject, resultArray: ArrayValueObject, isFirst?: boolean): BaseValueObject;
68
+ fuzzySearch(value: BaseValueObject, searchArray: ArrayValueObject, resultArray: ArrayValueObject, isFirst?: boolean): BaseValueObject;
69
+ orderSearch(value: BaseValueObject, searchArray: ArrayValueObject, resultArray: ArrayValueObject, searchType?: ArrayOrderSearchType, isDesc?: boolean): BaseValueObject;
70
+ /**
71
+ * @param axis 0 row, 1 column
72
+ * @returns
73
+ */
74
+ binarySearchExpand(value: BaseValueObject, searchArray: ArrayValueObject, resultArray: ArrayValueObject, axis?: number, searchType?: ArrayBinarySearchType): ErrorValueObject | ArrayValueObject | undefined;
75
+ equalSearchExpand(value: BaseValueObject, searchArray: ArrayValueObject, resultArray: ArrayValueObject, isFirst?: boolean, axis?: number): ErrorValueObject | ArrayValueObject | undefined;
76
+ fuzzySearchExpand(value: BaseValueObject, searchArray: ArrayValueObject, resultArray: ArrayValueObject, isFirst?: boolean, axis?: number): ErrorValueObject | ArrayValueObject | undefined;
77
+ orderSearchExpand(value: BaseValueObject, searchArray: ArrayValueObject, resultArray: ArrayValueObject, searchType?: ArrayOrderSearchType, isDesc?: boolean, axis?: number): ErrorValueObject | ArrayValueObject | undefined;
63
78
  }
@@ -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
- export declare const functionInformation: never[];
16
+ import { FUNCTION_NAMES_INFORMATION } from './function-names';
17
+ import { Isblank } from './isblank';
18
+ export declare const functionInformation: (FUNCTION_NAMES_INFORMATION | typeof Isblank)[][];
@@ -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,20 @@
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 } from '../../../engine/value-object/base-value-object';
17
+ import { BaseFunction } from '../../base-function';
18
+ export declare class Isblank extends BaseFunction {
19
+ calculate(value: BaseValueObject): BaseValueObject;
20
+ }
@@ -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,20 @@
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 } from '../../../engine/value-object/base-value-object';
17
+ import { BaseFunction } from '../../base-function';
18
+ export declare class And extends BaseFunction {
19
+ calculate(...logicalValues: BaseValueObject[]): BaseValueObject;
20
+ }
@@ -13,6 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+ import { And } from './and';
16
17
  import { FUNCTION_NAMES_LOGICAL } from './function-names';
17
18
  import { Makearray } from './makearray';
18
- export declare const functionLogical: (FUNCTION_NAMES_LOGICAL | typeof Makearray)[][];
19
+ export declare const functionLogical: ((FUNCTION_NAMES_LOGICAL | typeof And)[] | (FUNCTION_NAMES_LOGICAL | typeof Makearray)[])[];
@@ -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,22 @@
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 } from '../../../engine/value-object/base-value-object';
17
+ import { BaseFunction } from '../../base-function';
18
+ export declare class If extends BaseFunction {
19
+ calculate(logicalTest: BaseValueObject, valueIfTrue: BaseValueObject, valueIfFalse?: BaseValueObject): BaseValueObject;
20
+ private _getSingleValueObject;
21
+ private _calculateSingleCell;
22
+ }
@@ -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,20 @@
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 } from '../../../engine/value-object/base-value-object';
17
+ import { BaseFunction } from '../../base-function';
18
+ export declare class Iferror extends BaseFunction {
19
+ calculate(value: BaseValueObject, valueIfError: BaseValueObject): BaseValueObject;
20
+ }
@@ -15,7 +15,10 @@
15
15
  */
16
16
  import { Address } from './address';
17
17
  import { FUNCTION_NAMES_LOOKUP } from './function-names';
18
+ import { Hlookup } from './hlookup';
18
19
  import { Indirect } from './indirect';
20
+ import { Lookup } from './lookup';
19
21
  import { Offset } from './offset';
20
22
  import { Vlookup } from './vlookup';
21
- export declare const functionLookup: ((FUNCTION_NAMES_LOOKUP | typeof Address)[] | (FUNCTION_NAMES_LOOKUP | typeof Indirect)[] | (FUNCTION_NAMES_LOOKUP | typeof Offset)[] | (FUNCTION_NAMES_LOOKUP | typeof Vlookup)[])[];
23
+ import { Xlookup } from './xlookup';
24
+ export declare const functionLookup: ((FUNCTION_NAMES_LOOKUP | typeof Address)[] | (FUNCTION_NAMES_LOOKUP | typeof Indirect)[] | (FUNCTION_NAMES_LOOKUP | typeof Offset)[] | (FUNCTION_NAMES_LOOKUP | typeof Vlookup)[] | (FUNCTION_NAMES_LOOKUP | typeof Lookup)[] | (FUNCTION_NAMES_LOOKUP | typeof Hlookup)[] | (FUNCTION_NAMES_LOOKUP | typeof Xlookup)[])[];
@@ -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,21 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Inc.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type { BaseValueObject } from '../../../engine/value-object/base-value-object';
17
+ import { BaseFunction } from '../../base-function';
18
+ export declare class Hlookup extends BaseFunction {
19
+ calculate(lookupValue: BaseValueObject, tableArray: BaseValueObject, rowIndexNum: BaseValueObject, rangeLookup?: BaseValueObject): BaseValueObject;
20
+ private _handleSingleObject;
21
+ }
@@ -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,23 @@
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 '../../..';
17
+ import type { BaseValueObject } from '../../../engine/value-object/base-value-object';
18
+ import { BaseFunction } from '../../base-function';
19
+ export declare class Lookup extends BaseFunction {
20
+ calculate(lookupValue: BaseValueObject, lookupVectorOrArray: ArrayValueObject, resultVector?: BaseValueObject): BaseValueObject;
21
+ private _handleVector;
22
+ private _handleArray;
23
+ }
@@ -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 {};
@@ -13,9 +13,11 @@
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
- import { CellReferenceObject } from '../../../engine/reference-object/cell-reference-object';
16
+ import type { BaseReferenceObject } from '../../../engine/reference-object/base-reference-object';
17
+ import type { BaseValueObject } from '../../../engine/value-object/base-value-object';
18
+ import { ErrorValueObject } from '../../../engine/value-object/base-value-object';
18
19
  import { BaseFunction } from '../../base-function';
19
20
  export declare class Offset extends BaseFunction {
20
- calculate(reference: FunctionVariantType, rows: FunctionVariantType, columns: FunctionVariantType, height?: FunctionVariantType, width?: FunctionVariantType): CellReferenceObject;
21
+ calculate(reference: BaseValueObject, rows: BaseValueObject, columns: BaseValueObject, height?: BaseValueObject, width?: BaseValueObject): ErrorValueObject | BaseReferenceObject;
22
+ private _setDefault;
21
23
  }
@@ -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,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 { ArrayValueObject } from '../../../engine/value-object/array-value-object';
17
+ import type { BaseValueObject } from '../../../engine/value-object/base-value-object';
18
+ import { BaseFunction } from '../../base-function';
19
+ export declare class Xlookup extends BaseFunction {
20
+ calculate(lookupValue: BaseValueObject, lookupArray: ArrayValueObject, returnArray: ArrayValueObject, ifNotFound?: BaseValueObject, matchMode?: BaseValueObject, searchMode?: BaseValueObject): BaseValueObject;
21
+ private _handleExpandObject;
22
+ private _handleSingleObject;
23
+ private _getSearchModeValue;
24
+ }
@@ -13,9 +13,10 @@
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';
16
+ import { ArrayValueObject } from '../../../engine/value-object/array-value-object';
17
+ import type { BaseValueObject } from '../../../engine/value-object/base-value-object';
17
18
  import { ErrorValueObject } from '../../../engine/value-object/base-value-object';
18
19
  import { BaseFunction } from '../../base-function';
19
20
  export declare class Sumifs extends BaseFunction {
20
- calculate(...variants: FunctionVariantType[]): ErrorValueObject;
21
+ calculate(sumRange: BaseValueObject, ...variants: BaseValueObject[]): ErrorValueObject | ArrayValueObject;
21
22
  }
@@ -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 {};
@@ -13,9 +13,8 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import type { FunctionVariantType } from '../../../engine/reference-object/base-reference-object';
17
- import { ErrorValueObject } from '../../../engine/value-object/base-value-object';
16
+ import type { BaseValueObject } from '../../../engine/value-object/base-value-object';
18
17
  import { BaseFunction } from '../../base-function';
19
18
  export declare class Concatenate extends BaseFunction {
20
- calculate(numberVar: FunctionVariantType, powerVar: FunctionVariantType): ErrorValueObject;
19
+ calculate(...textValues: BaseValueObject[]): BaseValueObject;
21
20
  }
@@ -60,6 +60,7 @@ export declare class FormulaCurrentConfigService extends Disposable implements I
60
60
  registerUnitData(unitData: IUnitData): void;
61
61
  registerFormulaData(formulaData: IFormulaData): void;
62
62
  registerSheetNameMap(sheetNameMap: IUnitSheetNameMap): void;
63
+ private _mergeNameMap;
63
64
  private _loadSheetData;
64
65
  }
65
66
  export declare const IFormulaCurrentConfigService: import("@wendellhu/redi").IdentifierDecorator<FormulaCurrentConfigService>;