@univerjs/engine-formula 0.2.11 → 0.2.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +2 -2
- package/lib/es/index.js +2101 -501
- package/lib/types/basics/__tests__/math.spec.d.ts +16 -0
- package/lib/types/basics/math.d.ts +21 -0
- package/lib/types/controller/config.schema.d.ts +10 -0
- package/lib/types/controller/formula.controller.d.ts +3 -5
- package/lib/types/controller/set-dependency.controller.d.ts +1 -1
- package/lib/types/engine/analysis/__tests__/create-command-test-bed.d.ts +6 -6
- package/lib/types/engine/dependency/dependency-tree.d.ts +22 -2
- package/lib/types/engine/dependency/range-block-util.d.ts +15 -0
- package/lib/types/engine/reference-object/base-reference-object.d.ts +6 -6
- package/lib/types/engine/value-object/array-value-object.d.ts +1 -1
- package/lib/types/engine/value-object/lambda-value-object.d.ts +3 -2
- package/lib/types/functions/__tests__/create-function-test-bed.d.ts +6 -6
- package/lib/types/functions/base-function.d.ts +1 -1
- package/lib/types/functions/information/isformula/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/information/isformula/index.d.ts +9 -0
- package/lib/types/functions/information/n/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/information/n/index.d.ts +7 -0
- package/lib/types/functions/information/na/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/information/na/index.d.ts +7 -0
- package/lib/types/functions/logical/bycol/__test__/index.spec.d.ts +16 -0
- package/lib/types/functions/logical/bycol/index.d.ts +7 -0
- package/lib/types/functions/logical/byrow/__test__/index.spec.d.ts +16 -0
- package/lib/types/functions/logical/byrow/index.d.ts +7 -0
- package/lib/types/functions/logical/function-map.d.ts +1 -1
- package/lib/types/functions/logical/map/__test__/index.spec.d.ts +16 -0
- package/lib/types/functions/logical/map/index.d.ts +8 -0
- package/lib/types/functions/logical/reduce/__test__/index.spec.d.ts +16 -0
- package/lib/types/functions/logical/reduce/index.d.ts +8 -0
- package/lib/types/functions/logical/scan/__test__/index.spec.d.ts +16 -0
- package/lib/types/functions/logical/scan/index.d.ts +8 -0
- package/lib/types/functions/lookup/drop/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/lookup/drop/index.d.ts +9 -0
- package/lib/types/functions/lookup/expand/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/lookup/expand/index.d.ts +9 -0
- package/lib/types/functions/lookup/function-map.d.ts +1 -1
- package/lib/types/functions/lookup/take/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/lookup/take/index.d.ts +9 -0
- package/lib/types/functions/lookup/tocol/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/lookup/tocol/index.d.ts +10 -0
- package/lib/types/functions/lookup/torow/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/lookup/torow/index.d.ts +10 -0
- package/lib/types/functions/lookup/wrapcols/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/lookup/wrapcols/index.d.ts +8 -0
- package/lib/types/functions/lookup/wraprows/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/lookup/wraprows/index.d.ts +8 -0
- package/lib/types/functions/math/combin/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/math/combin/index.d.ts +7 -0
- package/lib/types/functions/math/combina/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/math/combina/index.d.ts +7 -0
- package/lib/types/functions/math/fact/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/math/fact/index.d.ts +8 -0
- package/lib/types/functions/math/factdouble/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/math/factdouble/index.d.ts +8 -0
- package/lib/types/functions/math/gcd/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/math/gcd/index.d.ts +8 -0
- package/lib/types/functions/math/int/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/math/int/index.d.ts +8 -0
- package/lib/types/functions/math/lcm/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/math/lcm/index.d.ts +8 -0
- package/lib/types/functions/math/mdeterm/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/math/mdeterm/index.d.ts +7 -0
- package/lib/types/functions/math/minverse/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/math/minverse/index.d.ts +7 -0
- package/lib/types/functions/math/mmult/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/math/mmult/index.d.ts +9 -0
- package/lib/types/functions/math/mod/index.d.ts +1 -1
- package/lib/types/functions/math/multinomial/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/math/multinomial/index.d.ts +8 -0
- package/lib/types/functions/math/munit/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/math/munit/index.d.ts +8 -0
- package/lib/types/functions/math/quotient/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/math/quotient/index.d.ts +7 -0
- package/lib/types/functions/math/sequence/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/math/sequence/index.d.ts +8 -0
- package/lib/types/functions/math/seriessum/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/math/seriessum/index.d.ts +8 -0
- package/lib/types/functions/math/sign/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/math/sign/index.d.ts +8 -0
- package/lib/types/models/__tests__/create-command-test-bed.d.ts +6 -6
- package/lib/types/models/formula-data.model.d.ts +3 -2
- package/lib/types/plugin.d.ts +5 -10
- package/lib/types/services/active-dirty-manager.service.d.ts +1 -1
- package/lib/types/services/current-data.service.d.ts +1 -1
- package/lib/types/services/defined-names.service.d.ts +1 -1
- package/lib/types/services/dependency-manager.service.d.ts +5 -10
- package/lib/types/services/feature-calculation-manager.service.d.ts +1 -1
- package/lib/types/services/function.service.d.ts +1 -1
- package/lib/types/services/other-formula-manager.service.d.ts +1 -1
- package/lib/types/services/runtime.service.d.ts +1 -1
- package/lib/types/services/super-table.service.d.ts +1 -1
- package/lib/umd/index.js +2 -2
- package/package.json +9 -9
|
@@ -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
|
+
export declare function calculateFactorial(n: number, step?: number): number;
|
|
17
|
+
export declare function calculateCombin(n: number, k: number): number;
|
|
18
|
+
export declare function calculateGcd(a: number, b: number): number;
|
|
19
|
+
export declare function calculateLcm(a: number, b: number): number;
|
|
20
|
+
export declare function calculateMdeterm(matrix: number[][]): number;
|
|
21
|
+
export declare function calculateMinverse(matrix: number[][]): number[][] | null;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Ctor } from '@univerjs/core';
|
|
2
|
+
import { BaseFunction } from '../functions/base-function';
|
|
3
|
+
import { IFunctionNames } from '../basics/function';
|
|
4
|
+
export declare const PLUGIN_CONFIG_KEY = "engine-formula.config";
|
|
5
|
+
export declare const configSymbol: unique symbol;
|
|
6
|
+
export interface IUniverEngineFormulaConfig {
|
|
7
|
+
notExecuteFormula?: boolean;
|
|
8
|
+
function?: Array<[Ctor<BaseFunction>, IFunctionNames]>;
|
|
9
|
+
}
|
|
10
|
+
export declare const defaultPluginConfig: IUniverEngineFormulaConfig;
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import { Disposable, ICommandService,
|
|
1
|
+
import { Disposable, ICommandService, IConfigService } from '@univerjs/core';
|
|
2
2
|
import { DataSyncPrimaryController } from '@univerjs/rpc';
|
|
3
|
-
import { IFunctionNames } from '../basics/function';
|
|
4
|
-
import { BaseFunction } from '../functions/base-function';
|
|
5
3
|
import { IFunctionService } from '../services/function.service';
|
|
6
4
|
export declare class FormulaController extends Disposable {
|
|
7
|
-
private _function;
|
|
8
5
|
private readonly _commandService;
|
|
9
6
|
private readonly _functionService;
|
|
7
|
+
private readonly _configService;
|
|
10
8
|
private readonly _dataSyncPrimaryController?;
|
|
11
|
-
constructor(
|
|
9
|
+
constructor(_commandService: ICommandService, _functionService: IFunctionService, _configService: IConfigService, _dataSyncPrimaryController?: DataSyncPrimaryController | undefined);
|
|
12
10
|
private _initialize;
|
|
13
11
|
private _registerCommands;
|
|
14
12
|
private _registerFunctions;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Disposable, ICommandService } from '@univerjs/core';
|
|
2
|
-
import { IFeatureCalculationManagerService } from '../services/feature-calculation-manager.service';
|
|
3
2
|
import { IDependencyManagerService } from '../services/dependency-manager.service';
|
|
3
|
+
import { IFeatureCalculationManagerService } from '../services/feature-calculation-manager.service';
|
|
4
4
|
export declare class SetDependencyController extends Disposable {
|
|
5
5
|
private readonly _commandService;
|
|
6
6
|
private readonly _dependencyManagerService;
|
|
@@ -3,12 +3,12 @@ import { ISheetData } from '../../../basics/common';
|
|
|
3
3
|
export declare function createCommandTestBed(workbookData?: IWorkbookData, dependencies?: Dependency[]): {
|
|
4
4
|
univer: Univer;
|
|
5
5
|
get: {
|
|
6
|
-
<T>(id: import('@
|
|
7
|
-
<T>(id: import('@
|
|
8
|
-
<T>(id: import('@
|
|
9
|
-
<T>(id: import('@
|
|
10
|
-
<T>(id: import('@
|
|
11
|
-
<T>(id: import('@
|
|
6
|
+
<T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, lookUp?: import('@wendellhu/redi').LookUp): T;
|
|
7
|
+
<T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantity: import("@wendellhu/redi").Quantity.MANY, lookUp?: import('@wendellhu/redi').LookUp): T[];
|
|
8
|
+
<T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantity: import("@wendellhu/redi").Quantity.OPTIONAL, lookUp?: import('@wendellhu/redi').LookUp): T | null;
|
|
9
|
+
<T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantity: import("@wendellhu/redi").Quantity.REQUIRED, lookUp?: import('@wendellhu/redi').LookUp): T;
|
|
10
|
+
<T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantity?: import('@wendellhu/redi').Quantity, lookUp?: import('@wendellhu/redi').LookUp): T[] | T | null;
|
|
11
|
+
<T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantityOrLookup?: import('@wendellhu/redi').Quantity | import('@wendellhu/redi').LookUp, lookUp?: import('@wendellhu/redi').LookUp): T[] | T | null;
|
|
12
12
|
};
|
|
13
13
|
sheet: Workbook;
|
|
14
14
|
unitId: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { IRange, IUnitRange, Nullable
|
|
1
|
+
import { Disposable, IRange, IUnitRange, Nullable } from '@univerjs/core';
|
|
2
2
|
import { IDirtyUnitSheetNameMap, IFeatureDirtyRangeType, IRuntimeUnitDataType, IUnitExcludedCell } from '../../basics/common';
|
|
3
|
-
import { BaseAstNode } from '../ast-node/base-ast-node';
|
|
4
3
|
import { IFormulaDirtyData } from '../../services/current-data.service';
|
|
5
4
|
import { IAllRuntimeData } from '../../services/runtime.service';
|
|
5
|
+
import { BaseAstNode } from '../ast-node/base-ast-node';
|
|
6
6
|
export declare enum FDtreeStateType {
|
|
7
7
|
DEFAULT = 0,
|
|
8
8
|
ADDED = 1,
|
|
@@ -31,11 +31,16 @@ export declare class FormulaDependencyTree extends Disposable {
|
|
|
31
31
|
formulaId: Nullable<string>;
|
|
32
32
|
featureId: Nullable<string>;
|
|
33
33
|
isPassive: boolean;
|
|
34
|
+
_childIds: Set<string>;
|
|
35
|
+
anchorToken: string;
|
|
34
36
|
getDirtyData: Nullable<(dirtyData: IFormulaDirtyData, runtimeData: IAllRuntimeData) => {
|
|
35
37
|
runtimeCellData: IRuntimeUnitDataType;
|
|
36
38
|
dirtyRanges: IFeatureDirtyRangeType;
|
|
37
39
|
}>;
|
|
38
40
|
private _state;
|
|
41
|
+
private _id;
|
|
42
|
+
constructor();
|
|
43
|
+
get id(): string;
|
|
39
44
|
dispose(): void;
|
|
40
45
|
disposeWithChildren(): void;
|
|
41
46
|
resetState(): void;
|
|
@@ -51,6 +56,7 @@ export declare class FormulaDependencyTree extends Disposable {
|
|
|
51
56
|
*/
|
|
52
57
|
dependencyRange(dependencyRangeList: Map<string, Map<string, IRange[]>>, dirtyUnitSheetNameMap: IDirtyUnitSheetNameMap, unitExcludedCell: Nullable<IUnitExcludedCell>): boolean;
|
|
53
58
|
pushChildren(tree: FormulaDependencyTree): void;
|
|
59
|
+
hasChild(tree: FormulaDependencyTree): boolean;
|
|
54
60
|
/**
|
|
55
61
|
* Add the range corresponding to the current ast node.
|
|
56
62
|
* @param range
|
|
@@ -65,13 +71,27 @@ export declare class FormulaDependencyTree extends Disposable {
|
|
|
65
71
|
}
|
|
66
72
|
export declare class FormulaDependencyTreeCache extends Disposable {
|
|
67
73
|
private _cacheItems;
|
|
74
|
+
private _map;
|
|
75
|
+
private _dependencyMap;
|
|
76
|
+
private _parentIdMap;
|
|
77
|
+
private _rangeTokens;
|
|
68
78
|
dispose(): void;
|
|
69
79
|
size(): number;
|
|
80
|
+
getDependencyMap(): Map<string, FormulaDependencyTree>;
|
|
81
|
+
getDependencyTree(id: string): FormulaDependencyTree | undefined;
|
|
70
82
|
get length(): number;
|
|
71
83
|
add(unitRangeWithToken: IUnitRangeWithToken, tree: FormulaDependencyTree): void;
|
|
84
|
+
addDependencyMap(tree: FormulaDependencyTree): void;
|
|
85
|
+
updateParent(tree: FormulaDependencyTree): void;
|
|
72
86
|
clear(): void;
|
|
73
87
|
remove(token: string, tree: FormulaDependencyTree): void;
|
|
74
88
|
delete(token: string): void;
|
|
89
|
+
getDependencyId(dependenceTree: FormulaDependencyTree, ids: Set<string>): void;
|
|
90
|
+
/**
|
|
91
|
+
* Determine whether range is dependent on other trees.
|
|
92
|
+
* @param dependenceTree
|
|
93
|
+
*/
|
|
94
|
+
dependencyUseParentId(dependenceTree: FormulaDependencyTree): void;
|
|
75
95
|
/**
|
|
76
96
|
* Determine whether range is dependent on other trees.
|
|
77
97
|
* @param dependenceTree
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ICellData, IRange, Nullable } from '@univerjs/core';
|
|
2
2
|
import { FormulaAstLRU } from '../../basics/cache-lru';
|
|
3
|
-
import { IRuntimeUnitDataType, IUnitData, IUnitSheetNameMap, IUnitStylesData } from '../../basics/common';
|
|
4
3
|
import { ObjectClassType } from '../../basics/object-class-type';
|
|
5
4
|
import { ArrayValueObject } from '../value-object/array-value-object';
|
|
6
5
|
import { BaseValueObject, ErrorValueObject } from '../value-object/base-value-object';
|
|
7
6
|
import { NullValueObject, NumberValueObject, StringValueObject } from '../value-object/primitive-object';
|
|
7
|
+
import { IRuntimeUnitDataType, IUnitData, IUnitSheetNameMap, IUnitStylesData } from '../../basics/common';
|
|
8
8
|
export type NodeValueType = BaseValueObject | BaseReferenceObject | AsyncObject | AsyncArrayObject;
|
|
9
9
|
export type FunctionVariantType = BaseValueObject | BaseReferenceObject;
|
|
10
10
|
export declare const FORMULA_REF_TO_ARRAY_CACHE: FormulaAstLRU<ArrayValueObject>;
|
|
@@ -42,7 +42,7 @@ export declare class BaseReferenceObject extends ObjectClassType {
|
|
|
42
42
|
};
|
|
43
43
|
isReferenceObject(): boolean;
|
|
44
44
|
iterator(callback: (valueObject: Nullable<BaseValueObject>, rowIndex: number, columnIndex: number) => Nullable<boolean>): Nullable<boolean>;
|
|
45
|
-
getFirstCell(): ErrorValueObject | NullValueObject | NumberValueObject | import('
|
|
45
|
+
getFirstCell(): ErrorValueObject | NullValueObject | NumberValueObject | import('../..').BooleanValueObject | StringValueObject | ArrayValueObject;
|
|
46
46
|
getRangeData(): IRange;
|
|
47
47
|
setRangeData(range: IRange): void;
|
|
48
48
|
getUnitId(): string;
|
|
@@ -87,10 +87,10 @@ export declare class BaseReferenceObject extends ObjectClassType {
|
|
|
87
87
|
isTable(): boolean;
|
|
88
88
|
unionBy(referenceObject: BaseReferenceObject): NodeValueType;
|
|
89
89
|
unionRange(rangeData1: IRange, rangeData2: IRange): IRange;
|
|
90
|
-
getCellValueObject(cell: ICellData): ErrorValueObject | NullValueObject | NumberValueObject | import('
|
|
90
|
+
getCellValueObject(cell: ICellData): ErrorValueObject | NullValueObject | NumberValueObject | import('../..').BooleanValueObject | StringValueObject | ArrayValueObject;
|
|
91
91
|
private _getPatternByCell;
|
|
92
|
-
getCellByRow(row: number): ErrorValueObject | NullValueObject | NumberValueObject | import('
|
|
93
|
-
getCellByColumn(column: number): ErrorValueObject | NullValueObject | NumberValueObject | import('
|
|
92
|
+
getCellByRow(row: number): ErrorValueObject | NullValueObject | NumberValueObject | import('../..').BooleanValueObject | StringValueObject | ArrayValueObject;
|
|
93
|
+
getCellByColumn(column: number): ErrorValueObject | NullValueObject | NumberValueObject | import('../..').BooleanValueObject | StringValueObject | ArrayValueObject;
|
|
94
94
|
getCurrentActiveSheetData(): import('../../basics/common').ISheetItem;
|
|
95
95
|
getCurrentStylesData(): import('@univerjs/core').Styles;
|
|
96
96
|
getCurrentRuntimeSheetData(): import('@univerjs/core').ObjectMatrix<Nullable<ICellData>> | undefined;
|
|
@@ -98,7 +98,7 @@ export declare class BaseReferenceObject extends ObjectClassType {
|
|
|
98
98
|
getCurrentRuntimeActiveArrayFormulaCellData(): import('@univerjs/core').ObjectMatrix<Nullable<ICellData>> | undefined;
|
|
99
99
|
getCellData(row: number, column: number): ICellData;
|
|
100
100
|
getRuntimeFeatureCellValue(row: number, column: number): ICellData | undefined;
|
|
101
|
-
getCellByPosition(row?: number, column?: number): ErrorValueObject | NullValueObject | NumberValueObject | import('
|
|
101
|
+
getCellByPosition(row?: number, column?: number): ErrorValueObject | NullValueObject | NumberValueObject | import('../..').BooleanValueObject | StringValueObject | ArrayValueObject;
|
|
102
102
|
/**
|
|
103
103
|
* Get the pattern of the cell
|
|
104
104
|
* @param unitId
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Nullable } from '@univerjs/core';
|
|
2
2
|
import { compareToken } from '../../basics/token';
|
|
3
3
|
import { ArrayBinarySearchType, ArrayOrderSearchType } from '../utils/compare';
|
|
4
|
-
import {
|
|
4
|
+
import { BaseValueObject, ErrorValueObject, callbackMapFnType, IArrayValueObject } from './base-value-object';
|
|
5
5
|
import { BooleanValueObject, NullValueObject, NumberValueObject, StringValueObject } from './primitive-object';
|
|
6
6
|
export declare function fromObjectToString(array: IArrayValueObject): string;
|
|
7
7
|
export declare function transformToValueObject(array?: Array<Array<number | string | boolean | null>>): BaseValueObject[][];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { BaseAstNode } from '../ast-node/base-ast-node';
|
|
2
|
-
import { Interpreter } from '../interpreter/interpreter';
|
|
3
1
|
import { AsyncObject } from '../reference-object/base-reference-object';
|
|
4
2
|
import { BaseValueObject } from './base-value-object';
|
|
3
|
+
import { BaseAstNode } from '../ast-node/base-ast-node';
|
|
4
|
+
import { Interpreter } from '../interpreter/interpreter';
|
|
5
5
|
export declare class LambdaValueObjectObject extends BaseValueObject {
|
|
6
6
|
private _lambdaNode;
|
|
7
7
|
private _interpreter;
|
|
@@ -13,4 +13,5 @@ export declare class LambdaValueObjectObject extends BaseValueObject {
|
|
|
13
13
|
execute(...variants: BaseValueObject[]): BaseValueObject | AsyncObject;
|
|
14
14
|
private _setLambdaNodeValue;
|
|
15
15
|
private _setLambdaPrivacyValueMap;
|
|
16
|
+
getLambdaPrivacyVarKeys(): string[];
|
|
16
17
|
}
|
|
@@ -4,12 +4,12 @@ import { FunctionVariantType } from '../../engine/reference-object/base-referenc
|
|
|
4
4
|
export declare function createFunctionTestBed(workbookData?: IWorkbookData, dependencies?: Dependency[]): {
|
|
5
5
|
univer: Univer;
|
|
6
6
|
get: {
|
|
7
|
-
<T>(id: import('@
|
|
8
|
-
<T>(id: import('@
|
|
9
|
-
<T>(id: import('@
|
|
10
|
-
<T>(id: import('@
|
|
11
|
-
<T>(id: import('@
|
|
12
|
-
<T>(id: import('@
|
|
7
|
+
<T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, lookUp?: import('@wendellhu/redi').LookUp): T;
|
|
8
|
+
<T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantity: import("@wendellhu/redi").Quantity.MANY, lookUp?: import('@wendellhu/redi').LookUp): T[];
|
|
9
|
+
<T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantity: import("@wendellhu/redi").Quantity.OPTIONAL, lookUp?: import('@wendellhu/redi').LookUp): T | null;
|
|
10
|
+
<T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantity: import("@wendellhu/redi").Quantity.REQUIRED, lookUp?: import('@wendellhu/redi').LookUp): T;
|
|
11
|
+
<T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantity?: import('@wendellhu/redi').Quantity, lookUp?: import('@wendellhu/redi').LookUp): T[] | T | null;
|
|
12
|
+
<T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantityOrLookup?: import('@wendellhu/redi').Quantity | import('@wendellhu/redi').LookUp, lookUp?: import('@wendellhu/redi').LookUp): T[] | T | null;
|
|
13
13
|
};
|
|
14
14
|
sheet: Workbook;
|
|
15
15
|
unitId: string;
|
|
@@ -41,7 +41,7 @@ export declare class BaseFunction extends Disposable {
|
|
|
41
41
|
* you can write it as follows:
|
|
42
42
|
* =INDIRECT("DefinedName1")
|
|
43
43
|
*/
|
|
44
|
-
getDefinedName(name: string): import('
|
|
44
|
+
getDefinedName(name: string): import('..').IDefinedNamesServiceParam | null;
|
|
45
45
|
setDefinedNames(definedNames: IDefinedNameMapItem): void;
|
|
46
46
|
isAsync(): boolean;
|
|
47
47
|
isAddress(): boolean;
|
|
@@ -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,9 @@
|
|
|
1
|
+
import { FunctionVariantType } from '../../../engine/reference-object/base-reference-object';
|
|
2
|
+
import { BaseValueObject } from '../../../engine/value-object/base-value-object';
|
|
3
|
+
import { BaseFunction } from '../../base-function';
|
|
4
|
+
export declare class Isformula extends BaseFunction {
|
|
5
|
+
minParams: number;
|
|
6
|
+
maxParams: number;
|
|
7
|
+
needsReferenceObject: boolean;
|
|
8
|
+
calculate(reference: FunctionVariantType): BaseValueObject;
|
|
9
|
+
}
|
|
@@ -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,7 @@
|
|
|
1
|
+
import { BaseValueObject } from '../../../engine/value-object/base-value-object';
|
|
2
|
+
import { BaseFunction } from '../../base-function';
|
|
3
|
+
export declare class N extends BaseFunction {
|
|
4
|
+
minParams: number;
|
|
5
|
+
maxParams: number;
|
|
6
|
+
calculate(value: BaseValueObject): BaseValueObject;
|
|
7
|
+
}
|
|
@@ -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,7 @@
|
|
|
1
|
+
import { BaseValueObject } from '../../../engine/value-object/base-value-object';
|
|
2
|
+
import { BaseFunction } from '../../base-function';
|
|
3
|
+
export declare class Bycol extends BaseFunction {
|
|
4
|
+
minParams: number;
|
|
5
|
+
maxParams: number;
|
|
6
|
+
calculate(array: BaseValueObject, lambda: BaseValueObject): BaseValueObject;
|
|
7
|
+
}
|
|
@@ -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,7 @@
|
|
|
1
|
+
import { BaseValueObject } from '../../../engine/value-object/base-value-object';
|
|
2
|
+
import { BaseFunction } from '../../base-function';
|
|
3
|
+
export declare class Byrow extends BaseFunction {
|
|
4
|
+
minParams: number;
|
|
5
|
+
maxParams: number;
|
|
6
|
+
calculate(array: BaseValueObject, lambda: BaseValueObject): BaseValueObject;
|
|
7
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FUNCTION_NAMES_LOGICAL } from './function-names';
|
|
2
1
|
import { And } from './and';
|
|
2
|
+
import { FUNCTION_NAMES_LOGICAL } from './function-names';
|
|
3
3
|
import { Iferror } from './iferror';
|
|
4
4
|
import { Makearray } from './makearray';
|
|
5
5
|
export declare const functionLogical: ((FUNCTION_NAMES_LOGICAL | typeof And)[] | (FUNCTION_NAMES_LOGICAL | typeof Iferror)[] | (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,8 @@
|
|
|
1
|
+
import { BaseValueObject } from '../../../engine/value-object/base-value-object';
|
|
2
|
+
import { BaseFunction } from '../../base-function';
|
|
3
|
+
export declare class Map extends BaseFunction {
|
|
4
|
+
minParams: number;
|
|
5
|
+
maxParams: number;
|
|
6
|
+
calculate(...variants: BaseValueObject[]): BaseValueObject;
|
|
7
|
+
private _getResultArray;
|
|
8
|
+
}
|
|
@@ -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,8 @@
|
|
|
1
|
+
import { BaseValueObject } from '../../../engine/value-object/base-value-object';
|
|
2
|
+
import { BaseFunction } from '../../base-function';
|
|
3
|
+
export declare class Reduce extends BaseFunction {
|
|
4
|
+
minParams: number;
|
|
5
|
+
maxParams: number;
|
|
6
|
+
calculate(initialValue: BaseValueObject, array: BaseValueObject, lambda: BaseValueObject): BaseValueObject;
|
|
7
|
+
private _handleSingleValueObject;
|
|
8
|
+
}
|
|
@@ -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,8 @@
|
|
|
1
|
+
import { BaseValueObject } from '../../../engine/value-object/base-value-object';
|
|
2
|
+
import { BaseFunction } from '../../base-function';
|
|
3
|
+
export declare class Scan extends BaseFunction {
|
|
4
|
+
minParams: number;
|
|
5
|
+
maxParams: number;
|
|
6
|
+
calculate(initialValue: BaseValueObject, array: BaseValueObject, lambda: BaseValueObject): BaseValueObject;
|
|
7
|
+
private _getResult;
|
|
8
|
+
}
|
|
@@ -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,9 @@
|
|
|
1
|
+
import { BaseFunction } from '../../base-function';
|
|
2
|
+
import { BaseValueObject } from '../../../engine/value-object/base-value-object';
|
|
3
|
+
export declare class Drop extends BaseFunction {
|
|
4
|
+
minParams: number;
|
|
5
|
+
maxParams: number;
|
|
6
|
+
calculate(array: BaseValueObject, rows: BaseValueObject, columns?: BaseValueObject): BaseValueObject;
|
|
7
|
+
private _checkRowsColumns;
|
|
8
|
+
private _getResultArray;
|
|
9
|
+
}
|
|
@@ -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,9 @@
|
|
|
1
|
+
import { BaseFunction } from '../../base-function';
|
|
2
|
+
import { BaseValueObject } from '../../../engine/value-object/base-value-object';
|
|
3
|
+
export declare class Expand extends BaseFunction {
|
|
4
|
+
minParams: number;
|
|
5
|
+
maxParams: number;
|
|
6
|
+
calculate(array: BaseValueObject, rows: BaseValueObject, columns?: BaseValueObject, padWith?: BaseValueObject): BaseValueObject;
|
|
7
|
+
private _checkRowsColumnsPadWith;
|
|
8
|
+
private _getResultArray;
|
|
9
|
+
}
|
|
@@ -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,9 @@
|
|
|
1
|
+
import { BaseFunction } from '../../base-function';
|
|
2
|
+
import { BaseValueObject } from '../../../engine/value-object/base-value-object';
|
|
3
|
+
export declare class Take extends BaseFunction {
|
|
4
|
+
minParams: number;
|
|
5
|
+
maxParams: number;
|
|
6
|
+
calculate(array: BaseValueObject, rows: BaseValueObject, columns?: BaseValueObject): BaseValueObject;
|
|
7
|
+
private _checkRowsColumns;
|
|
8
|
+
private _getResultArray;
|
|
9
|
+
}
|
|
@@ -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 {};
|