@univerjs/engine-formula 0.1.0-alpha.2 → 0.1.0-beta.0
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/README.md +1 -1
- package/lib/cjs/index.js +1 -1
- package/lib/es/index.js +3967 -2502
- package/lib/types/basics/common.d.ts +5 -5
- package/lib/types/basics/error-type.d.ts +1 -1
- package/lib/types/basics/inverted-index-cache.d.ts +40 -0
- package/lib/types/basics/object-class-type.d.ts +2 -2
- package/lib/types/basics/regex.d.ts +2 -2
- package/lib/types/basics/runtime.d.ts +17 -0
- package/lib/types/engine/ast-node/base-ast-node-factory.d.ts +1 -1
- package/lib/types/engine/ast-node/base-ast-node.d.ts +1 -1
- package/lib/types/engine/ast-node/reference-node.d.ts +2 -2
- package/lib/types/engine/reference-object/base-reference-object.d.ts +15 -14
- package/lib/types/engine/reference-object/cell-reference-object.d.ts +1 -1
- package/lib/types/engine/reference-object/column-reference-object.d.ts +1 -1
- package/lib/types/engine/reference-object/row-reference-object.d.ts +1 -1
- package/lib/types/engine/utils/__tests__/compare.spec.d.ts +16 -0
- package/lib/types/engine/utils/compare.d.ts +21 -0
- package/lib/types/engine/utils/math-kit.d.ts +30 -0
- package/lib/types/engine/utils/object-compare.d.ts +26 -0
- package/lib/types/engine/value-object/__tests__/array-value-abs.spec.d.ts +16 -0
- package/lib/types/engine/value-object/__tests__/array-value-acos.spec.d.ts +16 -0
- package/lib/types/engine/value-object/__tests__/array-value-acosh.spec.d.ts +16 -0
- package/lib/types/engine/value-object/__tests__/array-value-asin.spec.d.ts +16 -0
- package/lib/types/engine/value-object/__tests__/array-value-asinh.spec.d.ts +16 -0
- package/lib/types/engine/value-object/__tests__/array-value-atan.spec.d.ts +16 -0
- package/lib/types/engine/value-object/__tests__/array-value-atan2.spec.d.ts +16 -0
- package/lib/types/engine/value-object/__tests__/array-value-atanh.spec.d.ts +16 -0
- package/lib/types/engine/value-object/__tests__/array-value-cbrt.spec.d.ts +16 -0
- package/lib/types/engine/value-object/__tests__/array-value-ceil.spec.d.ts +16 -0
- package/lib/types/engine/value-object/__tests__/array-value-cos.spec.d.ts +16 -0
- package/lib/types/engine/value-object/__tests__/array-value-exp.spec.d.ts +16 -0
- package/lib/types/engine/value-object/__tests__/array-value-floor.spec.d.ts +16 -0
- package/lib/types/engine/value-object/__tests__/array-value-log.spec.d.ts +16 -0
- package/lib/types/engine/value-object/__tests__/array-value-log10.spec.d.ts +16 -0
- package/lib/types/engine/value-object/__tests__/array-value-object.spec.d.ts +16 -0
- package/lib/types/engine/value-object/__tests__/array-value-pow.spec.d.ts +16 -0
- package/lib/types/engine/value-object/__tests__/array-value-round.spec.d.ts +16 -0
- package/lib/types/engine/value-object/__tests__/array-value-sin.spec.d.ts +16 -0
- package/lib/types/engine/value-object/__tests__/array-value-tan.spec.d.ts +16 -0
- package/lib/types/engine/value-object/__tests__/array-value-tanh.spec.d.ts +16 -0
- package/lib/types/engine/value-object/array-value-object.d.ts +108 -17
- package/lib/types/engine/value-object/base-value-object.d.ts +98 -21
- package/lib/types/engine/value-object/primitive-object.d.ts +105 -40
- package/lib/types/functions/base-function.d.ts +1 -3
- package/lib/types/functions/compatibility/concatenate/concatenate.d.ts +1 -1
- package/lib/types/functions/math/power/power.d.ts +1 -1
- package/lib/types/functions/math/sum/sum.d.ts +1 -3
- package/lib/types/functions/math/sumif/sumif.d.ts +2 -3
- package/lib/types/functions/math/sumifs/sumifs.d.ts +1 -1
- package/lib/types/functions/meta/compare/compare.d.ts +2 -1
- package/lib/types/functions/meta/divided/divided.d.ts +2 -1
- package/lib/types/functions/meta/minus/minus.d.ts +2 -1
- package/lib/types/functions/meta/multiply/multiply.d.ts +2 -1
- package/lib/types/functions/meta/plus/plus.d.ts +2 -1
- package/lib/types/functions/statistical/average/average.d.ts +1 -1
- package/lib/types/{engine/other-object/error-value-object.d.ts → functions/statistical/counta/counta.d.ts} +5 -10
- package/lib/types/functions/statistical/function-names.d.ts +2 -1
- package/lib/types/functions/statistical/max/max.d.ts +1 -2
- package/lib/types/index.d.ts +2 -2
- package/lib/types/models/formula-data.model.d.ts +3 -3
- package/lib/types/services/current-data.service.d.ts +0 -1
- package/lib/types/services/runtime.service.d.ts +1 -1
- package/lib/umd/index.js +1 -1
- package/package.json +10 -6
|
@@ -15,9 +15,10 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { compareToken } from '../../../basics/token';
|
|
17
17
|
import type { FunctionVariantType } from '../../../engine/reference-object/base-reference-object';
|
|
18
|
+
import { type BaseValueObject } from '../../../engine/value-object/base-value-object';
|
|
18
19
|
import { BaseFunction } from '../../base-function';
|
|
19
20
|
export declare class Compare extends BaseFunction {
|
|
20
21
|
private _compareType;
|
|
21
22
|
setCompareType(token: compareToken): void;
|
|
22
|
-
calculate(variant1: FunctionVariantType, variant2: FunctionVariantType):
|
|
23
|
+
calculate(variant1: FunctionVariantType, variant2: FunctionVariantType): BaseValueObject;
|
|
23
24
|
}
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import type { FunctionVariantType } from '../../../engine/reference-object/base-reference-object';
|
|
17
|
+
import { type BaseValueObject } from '../../../engine/value-object/base-value-object';
|
|
17
18
|
import { BaseFunction } from '../../base-function';
|
|
18
19
|
export declare class Divided extends BaseFunction {
|
|
19
|
-
calculate(variant1: FunctionVariantType, variant2: FunctionVariantType):
|
|
20
|
+
calculate(variant1: FunctionVariantType, variant2: FunctionVariantType): BaseValueObject;
|
|
20
21
|
}
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import type { FunctionVariantType } from '../../../engine/reference-object/base-reference-object';
|
|
17
|
+
import type { BaseValueObject } from '../../../engine/value-object/base-value-object';
|
|
17
18
|
import { BaseFunction } from '../../base-function';
|
|
18
19
|
export declare class Minus extends BaseFunction {
|
|
19
|
-
calculate(variant1: FunctionVariantType, variant2: FunctionVariantType):
|
|
20
|
+
calculate(variant1: FunctionVariantType, variant2: FunctionVariantType): BaseValueObject;
|
|
20
21
|
}
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import type { FunctionVariantType } from '../../../engine/reference-object/base-reference-object';
|
|
17
|
+
import { type BaseValueObject } from '../../../engine/value-object/base-value-object';
|
|
17
18
|
import { BaseFunction } from '../../base-function';
|
|
18
19
|
export declare class Multiply extends BaseFunction {
|
|
19
|
-
calculate(variant1: FunctionVariantType, variant2: FunctionVariantType):
|
|
20
|
+
calculate(variant1: FunctionVariantType, variant2: FunctionVariantType): BaseValueObject;
|
|
20
21
|
}
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import type { FunctionVariantType } from '../../../engine/reference-object/base-reference-object';
|
|
17
|
+
import { type BaseValueObject } from '../../../engine/value-object/base-value-object';
|
|
17
18
|
import { BaseFunction } from '../../base-function';
|
|
18
19
|
export declare class Plus extends BaseFunction {
|
|
19
|
-
calculate(variant1: FunctionVariantType, variant2: FunctionVariantType):
|
|
20
|
+
calculate(variant1: FunctionVariantType, variant2: FunctionVariantType): BaseValueObject;
|
|
20
21
|
}
|
|
@@ -16,5 +16,5 @@
|
|
|
16
16
|
import type { FunctionVariantType } from '../../../engine/reference-object/base-reference-object';
|
|
17
17
|
import { BaseFunction } from '../../base-function';
|
|
18
18
|
export declare class Average extends BaseFunction {
|
|
19
|
-
calculate(...variants: FunctionVariantType[]):
|
|
19
|
+
calculate(...variants: FunctionVariantType[]): FunctionVariantType;
|
|
20
20
|
}
|
|
@@ -13,14 +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 {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
constructor(_errorType: ErrorType);
|
|
22
|
-
static create(errorType: ErrorType): ErrorValueObject;
|
|
23
|
-
getErrorType(): ErrorType;
|
|
24
|
-
isEqual(object: ObjectClassType): boolean;
|
|
25
|
-
isErrorObject(): boolean;
|
|
16
|
+
import type { FunctionVariantType } from '../../../engine/reference-object/base-reference-object';
|
|
17
|
+
import type { BaseValueObject } from '../../../engine/value-object/base-value-object';
|
|
18
|
+
import { BaseFunction } from '../../base-function';
|
|
19
|
+
export declare class CountA extends BaseFunction {
|
|
20
|
+
calculate(...variants: FunctionVariantType[]): BaseValueObject;
|
|
26
21
|
}
|
|
@@ -14,9 +14,8 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import type { FunctionVariantType } from '../../../engine/reference-object/base-reference-object';
|
|
17
|
-
import type { BaseValueObject } from '../../../engine/value-object/base-value-object';
|
|
18
17
|
import { BaseFunction } from '../../base-function';
|
|
19
18
|
export declare class Max extends BaseFunction {
|
|
20
|
-
calculate(...variants: FunctionVariantType[]):
|
|
19
|
+
calculate(...variants: FunctionVariantType[]): FunctionVariantType;
|
|
21
20
|
private _validator;
|
|
22
21
|
}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export { ErrorType } from './basics/error-type';
|
|
|
19
19
|
export { FunctionType, type IFunctionInfo, type IFunctionParam } from './basics/function';
|
|
20
20
|
export { type IFunctionNames } from './basics/function';
|
|
21
21
|
export { includeFormulaLexerToken, isFormulaLexerToken, normalizeSheetName } from './basics/match-token';
|
|
22
|
+
export { convertUnitDataToRuntime } from './basics/runtime';
|
|
22
23
|
export { matchToken } from './basics/token';
|
|
23
24
|
export { compareToken } from './basics/token';
|
|
24
25
|
export { type ISetArrayFormulaDataMutationParams, SetArrayFormulaDataMutation, SetArrayFormulaDataUndoMutationFactory, } from './commands/mutations/set-array-formula-data.mutation';
|
|
@@ -30,12 +31,11 @@ export { RemoveOtherFormulaMutation, SetOtherFormulaMutation } from './commands/
|
|
|
30
31
|
export { RemoveSuperTableMutation, SetSuperTableMutation, SetSuperTableOptionMutation, } from './commands/mutations/set-super-table.mutation';
|
|
31
32
|
export { LexerNode } from './engine/analysis/lexer-node';
|
|
32
33
|
export { LexerTreeBuilder } from './engine/analysis/lexer-tree-builder';
|
|
33
|
-
export { ErrorValueObject } from './engine/other-object/error-value-object';
|
|
34
34
|
export { BaseReferenceObject, type FunctionVariantType } from './engine/reference-object/base-reference-object';
|
|
35
35
|
export { RangeReferenceObject } from './engine/reference-object/range-reference-object';
|
|
36
36
|
export { generateStringWithSequence, type ISequenceNode, sequenceNodeType } from './engine/utils/sequence';
|
|
37
37
|
export { ArrayValueObject, ValueObjectFactory } from './engine/value-object/array-value-object';
|
|
38
|
-
export { BaseValueObject } from './engine/value-object/base-value-object';
|
|
38
|
+
export { BaseValueObject, ErrorValueObject } from './engine/value-object/base-value-object';
|
|
39
39
|
export { NumberValueObject } from './engine/value-object/primitive-object';
|
|
40
40
|
export { BooleanValueObject } from './engine/value-object/primitive-object';
|
|
41
41
|
export { StringValueObject } from './engine/value-object/primitive-object';
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import type { ICellData,
|
|
16
|
+
import type { ICellData, IObjectMatrixPrimitiveType, Nullable } from '@univerjs/core';
|
|
17
17
|
import { Disposable, IUniverInstanceService, ObjectMatrix } from '@univerjs/core';
|
|
18
18
|
import type { IArrayFormulaRangeType, IArrayFormulaUnitCellType, IFormulaData, IFormulaDataItem, IRuntimeUnitDataType, IUnitData, IUnitSheetNameMap } from '../basics/common';
|
|
19
19
|
import { LexerTreeBuilder } from '../engine/analysis/lexer-tree-builder';
|
|
@@ -44,9 +44,9 @@ export declare class FormulaDataModel extends Disposable {
|
|
|
44
44
|
allUnitData: IUnitData;
|
|
45
45
|
unitSheetNameMap: IUnitSheetNameMap;
|
|
46
46
|
};
|
|
47
|
-
updateFormulaData(unitId: string, sheetId: string, cellValue:
|
|
47
|
+
updateFormulaData(unitId: string, sheetId: string, cellValue: IObjectMatrixPrimitiveType<Nullable<ICellData>>): void;
|
|
48
48
|
getFormulaItemBySId(sId: string, sheetId: string, unitId: string): Nullable<IFormulaDataItem>;
|
|
49
49
|
getFormulaDataItem(row: number, column: number, sheetId: string, unitId: string): IFormulaDataItem;
|
|
50
50
|
getFormulaIdMap(unitId: string, sheetId: string): Map<string, IFormulaIdMap>;
|
|
51
51
|
}
|
|
52
|
-
export declare function initSheetFormulaData(formulaData: IFormulaData, unitId: string, sheetId: string, cellMatrix: ObjectMatrix<ICellData
|
|
52
|
+
export declare function initSheetFormulaData(formulaData: IFormulaData, unitId: string, sheetId: string, cellMatrix: ObjectMatrix<Nullable<ICellData>>): void;
|
|
@@ -59,7 +59,6 @@ export declare class FormulaCurrentConfigService extends Disposable implements I
|
|
|
59
59
|
registerUnitData(unitData: IUnitData): void;
|
|
60
60
|
registerFormulaData(formulaData: IFormulaData): void;
|
|
61
61
|
registerSheetNameMap(sheetNameMap: IUnitSheetNameMap): void;
|
|
62
|
-
private _dataToRuntime;
|
|
63
62
|
private _loadSheetData;
|
|
64
63
|
}
|
|
65
64
|
export declare const IFormulaCurrentConfigService: import("@wendellhu/redi").IdentifierDecorator<FormulaCurrentConfigService>;
|
|
@@ -17,7 +17,7 @@ import type { Nullable } from '@univerjs/core';
|
|
|
17
17
|
import { Disposable } from '@univerjs/core';
|
|
18
18
|
import type { IArrayFormulaRangeType, IFeatureDirtyRangeType, IRuntimeOtherUnitDataType, IRuntimeUnitDataType } from '../basics/common';
|
|
19
19
|
import type { BaseAstNode } from '../engine/ast-node/base-ast-node';
|
|
20
|
-
import type
|
|
20
|
+
import { type FunctionVariantType } from '../engine/reference-object/base-reference-object';
|
|
21
21
|
import { IFormulaCurrentConfigService } from './current-data.service';
|
|
22
22
|
/**
|
|
23
23
|
* IDLE: Idle phase of the formula engine.
|