@univerjs/engine-formula
Advanced tools
Comparing version 0.1.0-alpha.1 to 0.1.0-alpha.2
@@ -0,1 +1,16 @@ | ||
/** | ||
* Copyright 2023-present DreamNum Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
export declare class FormulaAstLRU<T> { | ||
@@ -9,2 +24,1 @@ private _cache; | ||
} | ||
//# sourceMappingURL=cache-lru.d.ts.map |
@@ -0,3 +1,17 @@ | ||
/** | ||
* Copyright 2023-present DreamNum Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
import { compareToken } from './token'; | ||
export declare function reverseCompareOperator(operator: compareToken): compareToken; | ||
//# sourceMappingURL=calculate.d.ts.map |
@@ -0,1 +1,16 @@ | ||
/** | ||
* Copyright 2023-present DreamNum Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
import type { BooleanNumber, ICellData, IRange, IUnitRange, Nullable, ObjectMatrix, ObjectMatrixPrimitiveType } from '@univerjs/core'; | ||
@@ -51,2 +66,9 @@ export declare const ERROR_VALUE_OBJECT_CLASS_TYPE = "errorValueObject"; | ||
} | ||
export interface IDirtyUnitFeatureMap { | ||
[unitId: string]: { | ||
[sheetId: string]: { | ||
[featureId: string]: boolean; | ||
}; | ||
}; | ||
} | ||
export interface IArrayFormulaRangeType { | ||
@@ -57,2 +79,7 @@ [unitId: string]: { | ||
} | ||
export interface IFeatureDirtyRangeType { | ||
[unitId: string]: { | ||
[sheetId: string]: IRange[]; | ||
}; | ||
} | ||
export interface IArrayFormulaUnitCellType { | ||
@@ -108,2 +135,3 @@ [unitId: string]: { | ||
dirtyNameMap: IDirtyUnitSheetNameMap; | ||
dirtyUnitFeatureMap: IDirtyUnitFeatureMap; | ||
excludedCell?: IUnitExcludedCell; | ||
@@ -115,2 +143,1 @@ } | ||
} | ||
//# sourceMappingURL=common.d.ts.map |
@@ -0,3 +1,17 @@ | ||
/** | ||
* Copyright 2023-present DreamNum Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
import type { IUnitRange } from '@univerjs/core'; | ||
export declare function isInDirtyRange(dirtyRanges: IUnitRange[], unitId: string, sheetId: string, row: number, column: number): boolean; | ||
//# sourceMappingURL=dirty.d.ts.map |
/** | ||
* Possible errors returned by our interpreter. | ||
* 18.17.3 Error values | ||
* Copyright 2023-present DreamNum Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
@@ -29,2 +40,1 @@ export declare enum ErrorType { | ||
export declare const ERROR_TYPE_SET: Set<string>; | ||
//# sourceMappingURL=error-type.d.ts.map |
@@ -0,2 +1,33 @@ | ||
/** | ||
* Copyright 2023-present DreamNum Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
import type { BooleanNumber } from '@univerjs/core'; | ||
import type { FUNCTION_NAMES_ARRAY } from '../functions/array/function-names'; | ||
import type { FUNCTION_NAMES_COMPATIBILITY } from '../functions/compatibility/function-names'; | ||
import type { FUNCTION_NAMES_CUBE } from '../functions/cube/function-names'; | ||
import type { FUNCTION_NAMES_DATABASE } from '../functions/database/function-names'; | ||
import type { FUNCTION_NAMES_DATE } from '../functions/date/function-names'; | ||
import type { FUNCTION_NAMES_ENGINEERING } from '../functions/engineering/function-names'; | ||
import type { FUNCTION_NAMES_FINANCIAL } from '../functions/financial/function-names'; | ||
import type { FUNCTION_NAMES_INFORMATION } from '../functions/information/function-names'; | ||
import type { FUNCTION_NAMES_LOGICAL } from '../functions/logical/function-names'; | ||
import type { FUNCTION_NAMES_LOOKUP } from '../functions/lookup/function-names'; | ||
import type { FUNCTION_NAMES_MATH } from '../functions/math/function-names'; | ||
import type { FUNCTION_NAMES_META } from '../functions/meta/function-names'; | ||
import type { FUNCTION_NAMES_STATISTICAL } from '../functions/statistical/function-names'; | ||
import type { FUNCTION_NAMES_TEXT } from '../functions/text/function-names'; | ||
import type { FUNCTION_NAMES_UNIVER } from '../functions/univer/function-names'; | ||
import type { FUNCTION_NAMES_WEB } from '../functions/web/function-names'; | ||
/** | ||
@@ -121,19 +152,2 @@ * Function type, refer to https://support.microsoft.com/en-us/office/excel-functions-by-category-5f91f4e9-7b42-46d2-9bd1-63f26a86c0eb | ||
} | ||
export declare enum FUNCTION_NAMES { | ||
AVERAGE = "AVERAGE", | ||
CONCATENATE = "CONCATENATE", | ||
COUNT = "COUNT", | ||
INDIRECT = "INDIRECT", | ||
MAX = "MAX", | ||
MIN = "MIN", | ||
OFFSET = "OFFSET", | ||
POWER = "POWER", | ||
SUM = "SUM", | ||
COMPARE = "COMPARE", | ||
DIVIDED = "DIVIDED", | ||
MINUS = "MINUS", | ||
MULTIPLY = "MULTIPLY", | ||
PLUS = "PLUS", | ||
UNION = "UNION" | ||
} | ||
//# sourceMappingURL=function.d.ts.map | ||
export type IFunctionNames = string | FUNCTION_NAMES_ARRAY | FUNCTION_NAMES_COMPATIBILITY | FUNCTION_NAMES_CUBE | FUNCTION_NAMES_DATABASE | FUNCTION_NAMES_DATE | FUNCTION_NAMES_ENGINEERING | FUNCTION_NAMES_FINANCIAL | FUNCTION_NAMES_INFORMATION | FUNCTION_NAMES_LOGICAL | FUNCTION_NAMES_LOOKUP | FUNCTION_NAMES_MATH | FUNCTION_NAMES_META | FUNCTION_NAMES_STATISTICAL | FUNCTION_NAMES_TEXT | FUNCTION_NAMES_UNIVER | FUNCTION_NAMES_WEB; |
@@ -0,6 +1,20 @@ | ||
/** | ||
* Copyright 2023-present DreamNum Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
import { compareToken, matchToken, operatorToken, prefixToken, suffixToken } from './token'; | ||
export declare const FORMULA_LEXER_TOKENS: (operatorToken | suffixToken | prefixToken | compareToken | matchToken)[]; | ||
export declare const FORMULA_LEXER_TOKENS: (operatorToken | suffixToken | compareToken | matchToken | prefixToken)[]; | ||
export declare function isFormulaLexerToken(str: string): boolean; | ||
export declare function includeFormulaLexerToken(str: string): boolean; | ||
export declare function normalizeSheetName(sheetName: string): string; | ||
//# sourceMappingURL=match-token.d.ts.map |
@@ -0,1 +1,16 @@ | ||
/** | ||
* Copyright 2023-present DreamNum Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
import { Disposable } from '@univerjs/core'; | ||
@@ -9,2 +24,1 @@ export declare class ObjectClassType extends Disposable { | ||
} | ||
//# sourceMappingURL=object-class-type.d.ts.map |
@@ -0,1 +1,16 @@ | ||
/** | ||
* Copyright 2023-present DreamNum Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
export declare const UNIT_NAME_REGEX = "'?\\[((?![\\/?:\"<>|*\\\\]).)*\\]"; | ||
@@ -18,2 +33,1 @@ export declare const SHEET_NAME_REGEX = "((?![\\[\\]\\/?*\\\\]).)*!"; | ||
export declare function isReferenceString(refString: string): boolean; | ||
//# sourceMappingURL=regex.d.ts.map |
@@ -0,1 +1,16 @@ | ||
/** | ||
* Copyright 2023-present DreamNum Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
export declare const DEFAULT_TOKEN_TYPE_PARAMETER = "P_1"; | ||
@@ -8,2 +23,1 @@ export declare const DEFAULT_TOKEN_TYPE_ROOT = "R_1"; | ||
export declare const DEFAULT_TOKEN_LAMBDA_FUNCTION_NAME = "LAMBDA"; | ||
//# sourceMappingURL=token-type.d.ts.map |
@@ -0,1 +1,16 @@ | ||
/** | ||
* Copyright 2023-present DreamNum Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
export declare enum operatorToken { | ||
@@ -34,3 +49,5 @@ PLUS = "+", | ||
CLOSE_BRACES = "}", | ||
COLON = ":" | ||
COLON = ":", | ||
OPEN_SQUARE_BRACKET = "[", | ||
CLOSE_SQUARE_BRACKET = "]" | ||
} | ||
@@ -46,2 +63,1 @@ export declare enum suffixToken { | ||
} | ||
//# sourceMappingURL=token.d.ts.map |
@@ -0,9 +1,25 @@ | ||
/** | ||
* Copyright 2023-present DreamNum Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
import { Disposable } from '@univerjs/core'; | ||
import type { IAccessor } from '@wendellhu/redi'; | ||
import type { FunctionVariantType, NodeValueType } from '../reference-object/base-reference-object'; | ||
import type { IFunctionNames } from '..'; | ||
import type { FunctionVariantType, NodeValueType } from '../engine/reference-object/base-reference-object'; | ||
export declare class BaseFunction extends Disposable { | ||
readonly accessor: IAccessor; | ||
private _name; | ||
constructor(accessor: IAccessor, _name: string); | ||
get name(): string; | ||
constructor(accessor: IAccessor, _name: IFunctionNames); | ||
get name(): IFunctionNames; | ||
isAsync(): boolean; | ||
@@ -14,2 +30,1 @@ isAddress(): boolean; | ||
} | ||
//# sourceMappingURL=base-function.d.ts.map |
@@ -1,23 +0,67 @@ | ||
export { LexerNode } from './analysis/lexer-node'; | ||
export type { IArrayFormulaRangeType, IArrayFormulaUnitCellType, IDirtyUnitSheetNameMap, IFormulaData, IFormulaDataItem, IFormulaDatasetConfig, IRuntimeUnitDataType, ISheetData, IUnitData, IUnitSheetNameMap, } from './basics/common'; | ||
/** | ||
* Copyright 2023-present DreamNum Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
export type { IArrayFormulaRangeType, IArrayFormulaUnitCellType, IDirtyUnitFeatureMap, IDirtyUnitSheetNameMap, IFormulaData, IFormulaDataItem, IFormulaDatasetConfig, IRuntimeUnitDataType, ISheetData, IUnitData, IUnitSheetNameMap, } from './basics/common'; | ||
export { isInDirtyRange } from './basics/dirty'; | ||
export { ErrorType } from './basics/error-type'; | ||
export { FUNCTION_NAMES, FunctionType, type IFunctionInfo, type IFunctionParam } from './basics/function'; | ||
export { FunctionType, type IFunctionInfo, type IFunctionParam } from './basics/function'; | ||
export { type IFunctionNames } from './basics/function'; | ||
export { includeFormulaLexerToken, isFormulaLexerToken, normalizeSheetName } from './basics/match-token'; | ||
export { generateStringWithSequence, type ISequenceNode, sequenceNodeType } from './basics/sequence'; | ||
export { matchToken } from './basics/token'; | ||
export { compareToken } from './basics/token'; | ||
export { type ISetArrayFormulaDataMutationParams, SetArrayFormulaDataMutation, SetArrayFormulaDataUndoMutationFactory, } from './commands/mutations/set-array-formula-data.mutation'; | ||
export { RemoveDefinedNameMutation, SetDefinedNameMutation } from './commands/mutations/set-defined-name.mutation'; | ||
export { RemoveFeatureCalculationMutation, SetFeatureCalculationMutation, } from './commands/mutations/set-feature-calculation.mutation'; | ||
export { type ISetFormulaCalculationNotificationMutation, type ISetFormulaCalculationResultMutation, type ISetFormulaCalculationStartMutation, SetFormulaCalculationNotificationMutation, SetFormulaCalculationResultMutation, SetFormulaCalculationStartMutation, SetFormulaCalculationStopMutation, } from './commands/mutations/set-formula-calculation.mutation'; | ||
export { type ISetFormulaDataMutationParams, SetFormulaDataMutation, } from './commands/mutations/set-formula-data.mutation'; | ||
export { RemoveOtherFormulaMutation, SetOtherFormulaMutation } from './commands/mutations/set-other-formula.mutation'; | ||
export { RemoveSuperTableMutation, SetSuperTableMutation, SetSuperTableOptionMutation, } from './commands/mutations/set-super-table.mutation'; | ||
export { LexerNode } from './engine/analysis/lexer-node'; | ||
export { LexerTreeBuilder } from './engine/analysis/lexer-tree-builder'; | ||
export { ErrorValueObject } from './engine/other-object/error-value-object'; | ||
export { BaseReferenceObject, type FunctionVariantType } from './engine/reference-object/base-reference-object'; | ||
export { RangeReferenceObject } from './engine/reference-object/range-reference-object'; | ||
export { generateStringWithSequence, type ISequenceNode, sequenceNodeType } from './engine/utils/sequence'; | ||
export { ArrayValueObject, ValueObjectFactory } from './engine/value-object/array-value-object'; | ||
export { BaseValueObject } from './engine/value-object/base-value-object'; | ||
export { NumberValueObject } from './engine/value-object/primitive-object'; | ||
export { BooleanValueObject } from './engine/value-object/primitive-object'; | ||
export { StringValueObject } from './engine/value-object/primitive-object'; | ||
export { FUNCTION_NAMES_ARRAY } from './functions/array/function-names'; | ||
export { BaseFunction } from './functions/base-function'; | ||
export { ErrorValueObject } from './other-object/error-value-object'; | ||
export { BaseFormulaEnginePlugin } from './plugin'; | ||
export { BaseReferenceObject, type FunctionVariantType } from './reference-object/base-reference-object'; | ||
export { RangeReferenceObject } from './reference-object/range-reference-object'; | ||
export { FormulaEngineService } from './services/formula-engine.service'; | ||
export { FUNCTION_NAMES_COMPATIBILITY } from './functions/compatibility/function-names'; | ||
export { FUNCTION_NAMES_CUBE } from './functions/cube/function-names'; | ||
export { FUNCTION_NAMES_DATABASE } from './functions/database/function-names'; | ||
export { FUNCTION_NAMES_DATE } from './functions/date/function-names'; | ||
export { FUNCTION_NAMES_ENGINEERING } from './functions/engineering/function-names'; | ||
export { FUNCTION_NAMES_FINANCIAL } from './functions/financial/function-names'; | ||
export { FUNCTION_NAMES_INFORMATION } from './functions/information/function-names'; | ||
export { FUNCTION_NAMES_LOGICAL } from './functions/logical/function-names'; | ||
export { FUNCTION_NAMES_LOOKUP } from './functions/lookup/function-names'; | ||
export { FUNCTION_NAMES_MATH } from './functions/math/function-names'; | ||
export { FUNCTION_NAMES_STATISTICAL } from './functions/statistical/function-names'; | ||
export { FUNCTION_NAMES_TEXT } from './functions/text/function-names'; | ||
export { FUNCTION_NAMES_UNIVER } from './functions/univer/function-names'; | ||
export { FUNCTION_NAMES_WEB } from './functions/web/function-names'; | ||
export { FormulaDataModel } from './models/formula-data.model'; | ||
export { initSheetFormulaData } from './models/formula-data.model'; | ||
export { UniverFormulaEnginePlugin } from './plugin'; | ||
export { CalculateFormulaService } from './services/calculate-formula.service'; | ||
export { FeatureCalculationManagerService, IFeatureCalculationManagerService, } from './services/feature-calculation-manager.service'; | ||
export { FunctionService } from './services/function.service'; | ||
export { IFunctionService } from './services/function.service'; | ||
export { type IOtherFormulaManagerService, OtherFormulaManagerService } from './services/other-formula-manager.service'; | ||
export { FormulaExecuteStageType, type IExecutionInProgressParams } from './services/runtime.service'; | ||
export { FormulaExecutedStateType, type IAllRuntimeData } from './services/runtime.service'; | ||
export { ArrayValueObject } from './value-object/array-value-object'; | ||
export { BaseValueObject } from './value-object/base-value-object'; | ||
export { NumberValueObject } from './value-object/primitive-object'; | ||
export { BooleanValueObject } from './value-object/primitive-object'; | ||
export { StringValueObject } from './value-object/primitive-object'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -0,8 +1,29 @@ | ||
/** | ||
* Copyright 2023-present DreamNum Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
import { Plugin } from '@univerjs/core'; | ||
import { Injector } from '@wendellhu/redi'; | ||
export declare class BaseFormulaEnginePlugin extends Plugin { | ||
interface IUniverFormulaEngine { | ||
notExecuteFormula?: boolean; | ||
} | ||
export declare class UniverFormulaEnginePlugin extends Plugin { | ||
private _config; | ||
protected _injector: Injector; | ||
constructor(_config: undefined, _injector: Injector); | ||
onStarting(injector: Injector): void; | ||
constructor(_config: IUniverFormulaEngine, _injector: Injector); | ||
onStarting(): void; | ||
private _initialize; | ||
onReady(): void; | ||
} | ||
//# sourceMappingURL=plugin.d.ts.map | ||
export {}; |
@@ -0,12 +1,29 @@ | ||
/** | ||
* Copyright 2023-present DreamNum Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
import type { IUnitRange, Nullable } from '@univerjs/core'; | ||
import { Disposable, IUniverInstanceService } from '@univerjs/core'; | ||
import type { IFormulaData, IFormulaDatasetConfig, IOtherFormulaData, IRuntimeUnitDataType, IUnitData, IUnitExcludedCell, IUnitSheetNameMap } from '../basics/common'; | ||
import type { IDirtyUnitFeatureMap, IDirtyUnitSheetNameMap, IFormulaData, IFormulaDatasetConfig, IRuntimeUnitDataType, IUnitData, IUnitExcludedCell, IUnitSheetNameMap } from '../basics/common'; | ||
export declare const DEFAULT_DOCUMENT_SUB_COMPONENT_ID = "__default_document_sub_component_id20231101__"; | ||
export interface IFormulaCurrentConfigService { | ||
load(config: IFormulaDatasetConfig): void; | ||
getUnitData(): IUnitData; | ||
getFormulaData(): IFormulaData; | ||
getOtherFormulaData(): IOtherFormulaData; | ||
getSheetNameMap(): IUnitSheetNameMap; | ||
isForceCalculate(): boolean; | ||
getDirtyRanges(): IUnitRange[]; | ||
getDirtyNameMap(): IDirtyUnitSheetNameMap; | ||
getDirtyUnitFeatureMap(): IDirtyUnitFeatureMap; | ||
registerUnitData(unitData: IUnitData): void; | ||
@@ -22,3 +39,2 @@ registerFormulaData(formulaData: IFormulaData): void; | ||
private _arrayFormulaCellData; | ||
private _otherFormulaData; | ||
private _formulaData; | ||
@@ -29,2 +45,3 @@ private _sheetNameMap; | ||
private _dirtyNameMap; | ||
private _dirtyUnitFeatureMap; | ||
private _excludedCell; | ||
@@ -37,6 +54,7 @@ constructor(_currentUniverService: IUniverInstanceService); | ||
getArrayFormulaCellData(): IRuntimeUnitDataType; | ||
getOtherFormulaData(): IOtherFormulaData; | ||
getSheetNameMap(): IUnitSheetNameMap; | ||
isForceCalculate(): boolean; | ||
getDirtyRanges(): IUnitRange[]; | ||
getDirtyNameMap(): IDirtyUnitSheetNameMap; | ||
getDirtyUnitFeatureMap(): IDirtyUnitFeatureMap; | ||
load(config: IFormulaDatasetConfig): void; | ||
@@ -48,6 +66,4 @@ loadDirtyRangesAndExcludedCell(dirtyRanges: IUnitRange[], excludedCell?: IUnitExcludedCell): void; | ||
private _dataToRuntime; | ||
private _loadOtherFormulaData; | ||
private _loadSheetData; | ||
} | ||
export declare const IFormulaCurrentConfigService: import("@wendellhu/redi").IdentifierDecorator<FormulaCurrentConfigService>; | ||
//# sourceMappingURL=current-data.service.d.ts.map |
@@ -0,5 +1,24 @@ | ||
/** | ||
* Copyright 2023-present DreamNum Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
import type { Nullable } from '@univerjs/core'; | ||
import { Disposable } from '@univerjs/core'; | ||
export interface IDefinedNamesService { | ||
registerDefinedName(name: string, reference: string): void; | ||
getDefinedNameMap(): Map<string, string>; | ||
registerDefinedName(unitId: string, name: string, formulaOrRefString: string): void; | ||
getDefinedNameMap(unitId: string): Nullable<Map<string, string>>; | ||
getValue(unitId: string, name: string): Nullable<string>; | ||
removeDefinedName(unitId: string, name: string): void; | ||
hasDefinedName(unitId: string): boolean; | ||
} | ||
@@ -9,6 +28,8 @@ export declare class DefinedNamesService extends Disposable implements IDefinedNamesService { | ||
dispose(): void; | ||
registerDefinedName(name: string, reference: string): void; | ||
getDefinedNameMap(): Map<string, string>; | ||
registerDefinedName(unitId: string, name: string, formulaOrRefString: string): void; | ||
removeDefinedName(unitId: string, name: string): void; | ||
getDefinedNameMap(unitId: string): Map<string, string> | undefined; | ||
getValue(unitId: string, name: string): string | undefined; | ||
hasDefinedName(unitId: string): boolean; | ||
} | ||
export declare const IDefinedNamesService: import("@wendellhu/redi").IdentifierDecorator<DefinedNamesService>; | ||
//# sourceMappingURL=defined-names.service.d.ts.map |
@@ -0,14 +1,42 @@ | ||
/** | ||
* Copyright 2023-present DreamNum Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
import type { Nullable } from '@univerjs/core'; | ||
import { Disposable } from '@univerjs/core'; | ||
import type { FUNCTION_NAMES, IFunctionInfo } from '../basics/function'; | ||
import type { IFunctionInfo, IFunctionNames } from '../basics/function'; | ||
import type { BaseFunction } from '../functions/base-function'; | ||
export interface IFunctionService { | ||
/** | ||
* Use register to register a function, new CustomFunction(inject, name) | ||
*/ | ||
registerExecutors(...functions: BaseFunction[]): void; | ||
getExecutors(): Map<string, BaseFunction>; | ||
getExecutor(functionToken: string): Nullable<BaseFunction>; | ||
hasExecutor(functionToken: string): boolean; | ||
getExecutors(): Map<IFunctionNames, BaseFunction>; | ||
/** | ||
* Obtain the operator of the function to reuse the calculation logic. | ||
* The argument type accepted by the function is: FunctionVariantType. | ||
* For instance, the sum formula capability is needed for the statistics bar. | ||
* You can obtain the calculation result by using | ||
* const sum = formulaService.getExecutor(FUNCTION_NAMES_MATH.SUM); | ||
* sum.calculate(new RangeReferenceObject(range, sheetId, unitId), ref2, re3). | ||
* @param functionName Function name, which can be obtained through the FUNCTION_NAMES enumeration. | ||
* @returns | ||
*/ | ||
getExecutor(functionToken: IFunctionNames): Nullable<BaseFunction>; | ||
hasExecutor(functionToken: IFunctionNames): boolean; | ||
registerDescriptions(...functions: IFunctionInfo[]): void; | ||
getDescriptions(): Map<string, IFunctionInfo>; | ||
getDescription(functionToken: string): Nullable<IFunctionInfo>; | ||
hasDescription(functionToken: string): boolean; | ||
getDescriptions(): Map<IFunctionNames, IFunctionInfo>; | ||
getDescription(functionToken: IFunctionNames): Nullable<IFunctionInfo>; | ||
hasDescription(functionToken: IFunctionNames): boolean; | ||
} | ||
@@ -20,11 +48,10 @@ export declare class FunctionService extends Disposable implements IFunctionService { | ||
registerExecutors(...functions: BaseFunction[]): void; | ||
getExecutors(): Map<string, BaseFunction>; | ||
getExecutor(functionToken: string | FUNCTION_NAMES): BaseFunction | undefined; | ||
hasExecutor(functionToken: string | FUNCTION_NAMES): boolean; | ||
getExecutors(): Map<IFunctionNames, BaseFunction>; | ||
getExecutor(functionToken: IFunctionNames): BaseFunction | undefined; | ||
hasExecutor(functionToken: IFunctionNames): boolean; | ||
registerDescriptions(...descriptions: IFunctionInfo[]): void; | ||
getDescriptions(): Map<string, IFunctionInfo>; | ||
getDescription(functionToken: string): IFunctionInfo | undefined; | ||
hasDescription(functionToken: string): boolean; | ||
getDescriptions(): Map<IFunctionNames, IFunctionInfo>; | ||
getDescription(functionToken: IFunctionNames): IFunctionInfo | undefined; | ||
hasDescription(functionToken: IFunctionNames): boolean; | ||
} | ||
export declare const IFunctionService: import("@wendellhu/redi").IdentifierDecorator<FunctionService>; | ||
//# sourceMappingURL=function.service.d.ts.map |
@@ -0,6 +1,21 @@ | ||
/** | ||
* Copyright 2023-present DreamNum Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
import type { Nullable } from '@univerjs/core'; | ||
import { Disposable } from '@univerjs/core'; | ||
import type { BaseAstNode } from '../ast-node/base-ast-node'; | ||
import type { IArrayFormulaRangeType, IRuntimeOtherUnitDataType, IRuntimeUnitDataType } from '../basics/common'; | ||
import type { FunctionVariantType } from '../reference-object/base-reference-object'; | ||
import type { IArrayFormulaRangeType, IFeatureDirtyRangeType, IRuntimeOtherUnitDataType, IRuntimeUnitDataType } from '../basics/common'; | ||
import type { BaseAstNode } from '../engine/ast-node/base-ast-node'; | ||
import type { FunctionVariantType } from '../engine/reference-object/base-reference-object'; | ||
import { IFormulaCurrentConfigService } from './current-data.service'; | ||
@@ -39,2 +54,8 @@ /** | ||
clearArrayFormulaCellData: IRuntimeUnitDataType; | ||
runtimeFeatureRange: { | ||
[featureId: string]: IFeatureDirtyRangeType; | ||
}; | ||
runtimeFeatureCellData: { | ||
[featureId: string]: IRuntimeUnitDataType; | ||
}; | ||
} | ||
@@ -85,2 +106,10 @@ export interface IExecutionInProgressParams { | ||
getRuntimeArrayFormulaCellData(): IRuntimeUnitDataType; | ||
getRuntimeFeatureRange(): { | ||
[featureId: string]: IFeatureDirtyRangeType; | ||
}; | ||
getRuntimeFeatureCellData(): { | ||
[featureId: string]: IRuntimeUnitDataType; | ||
}; | ||
setRuntimeFeatureCellData(featureId: string, featureData: IRuntimeUnitDataType): void; | ||
setRuntimeFeatureRange(featureId: string, featureRange: IFeatureDirtyRangeType): void; | ||
} | ||
@@ -100,2 +129,4 @@ export declare class FormulaRuntimeService extends Disposable implements IFormulaRuntimeService { | ||
private _runtimeClearArrayFormulaCellData; | ||
private _runtimeFeatureRange; | ||
private _runtimeFeatureCellData; | ||
private _functionsExecutedState; | ||
@@ -145,2 +176,10 @@ private _functionDefinitionPrivacyVar; | ||
getRuntimeClearArrayFormulaCellData(): IRuntimeUnitDataType; | ||
getRuntimeFeatureRange(): { | ||
[featureId: string]: IFeatureDirtyRangeType; | ||
}; | ||
setRuntimeFeatureRange(featureId: string, featureRange: IFeatureDirtyRangeType): void; | ||
getRuntimeFeatureCellData(): { | ||
[featureId: string]: IRuntimeUnitDataType; | ||
}; | ||
setRuntimeFeatureCellData(featureId: string, featureData: IRuntimeUnitDataType): void; | ||
getAllRuntimeData(): IAllRuntimeData; | ||
@@ -153,2 +192,1 @@ getRuntimeState(): IExecutionInProgressParams; | ||
export declare const IFormulaRuntimeService: import("@wendellhu/redi").IdentifierDecorator<FormulaRuntimeService>; | ||
//# sourceMappingURL=runtime.service.d.ts.map |
@@ -0,8 +1,29 @@ | ||
/** | ||
* Copyright 2023-present DreamNum Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
import type { Nullable } from '@univerjs/core'; | ||
import { Disposable } from '@univerjs/core'; | ||
import type { ISuperTable, TableOptionType } from '../basics/common'; | ||
export interface ISuperTableOptionParam { | ||
tableOption: string; | ||
tableOptionType: TableOptionType; | ||
} | ||
export interface ISuperTableService { | ||
getTableMap(): Map<string, ISuperTable>; | ||
getTableMap(unitId: string): Nullable<Map<string, ISuperTable>>; | ||
getTableOptionMap(): Map<string, TableOptionType>; | ||
registerTable(tableName: string, reference: ISuperTable): void; | ||
registerTable(unitId: string, tableName: string, reference: ISuperTable): void; | ||
registerTableOptionMap(tableOption: string, tableOptionType: TableOptionType): void; | ||
remove(unitId: string, tableName: string): void; | ||
} | ||
@@ -13,8 +34,8 @@ export declare class SuperTableService extends Disposable implements ISuperTableService { | ||
dispose(): void; | ||
getTableMap(): Map<string, ISuperTable>; | ||
remove(unitId: string, tableName: string): void; | ||
getTableMap(unitId: string): Map<string, ISuperTable> | undefined; | ||
getTableOptionMap(): Map<string, TableOptionType>; | ||
registerTable(tableName: string, reference: ISuperTable): void; | ||
registerTable(unitId: string, tableName: string, reference: ISuperTable): void; | ||
registerTableOptionMap(tableOption: string, tableOptionType: TableOptionType): void; | ||
} | ||
export declare const ISuperTableService: import("@wendellhu/redi").IdentifierDecorator<ISuperTableService>; | ||
//# sourceMappingURL=super-table.service.d.ts.map |
{ | ||
"name": "@univerjs/engine-formula", | ||
"version": "0.1.0-alpha.1", | ||
"version": "0.1.0-alpha.2", | ||
"description": "UniverSheet normal base-formula-engine", | ||
"keywords": [], | ||
"author": "DreamNum <developer@univer.ai>", | ||
"license": "MIT", | ||
"license": "Apache-2.0", | ||
"main": "./lib/cjs/index.js", | ||
"module": "./lib/esm/index.js", | ||
"module": "./lib/es/index.js", | ||
"types": "./lib/types/index.d.ts", | ||
@@ -16,3 +16,3 @@ "publishConfig": { | ||
".": { | ||
"import": "./lib/esm/index.js", | ||
"import": "./lib/es/index.js", | ||
"require": "./lib/cjs/index.js", | ||
@@ -22,3 +22,3 @@ "types": "./lib/types/index.d.ts" | ||
"./*": { | ||
"import": "./lib/esm/*", | ||
"import": "./lib/es/*", | ||
"require": "./lib/cjs/*", | ||
@@ -35,15 +35,19 @@ "types": "./lib/types/index.d.ts" | ||
"private": false, | ||
"dependencies": { | ||
"@wendellhu/redi": "^0.12.11", | ||
"rxjs": "^7.8.1", | ||
"@univerjs/core": "0.1.0-alpha.1" | ||
}, | ||
"devDependencies": { | ||
"@vitest/coverage-istanbul": "^0.34.6", | ||
"esbuild": "^0.19.8", | ||
"@vitest/coverage-istanbul": "^1.0.2", | ||
"@wendellhu/redi": "^0.12.12", | ||
"less": "^4.2.0", | ||
"ts-node": "^10.9.1", | ||
"typescript": "^5.3.2", | ||
"vitest": "^0.34.6" | ||
"rxjs": "^7.8.1", | ||
"typescript": "^5.3.3", | ||
"vite": "^5.0.7", | ||
"vite-plugin-dts": "^3.6.4", | ||
"vite-plugin-externals": "^0.6.2", | ||
"vitest": "^1.0.2", | ||
"@univerjs/core": "0.1.0-alpha.2" | ||
}, | ||
"peerDependencies": { | ||
"@wendellhu/redi": ">=0.12.12", | ||
"rxjs": ">=7.0.0", | ||
"@univerjs/core": "0.1.0-alpha.2" | ||
}, | ||
"scripts": { | ||
@@ -53,4 +57,4 @@ "test": "vitest run", | ||
"coverage": "vitest run --coverage", | ||
"esbuild": "node ./esbuild.config.mjs && tsc -p tsconfig.esbuild.json" | ||
"build": "tsc && vite build" | ||
} | ||
} |
Sorry, the diff of this file is too big to display
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
574771
10
134
10078
4
2
+ Added@univerjs/core@0.1.0-alpha.2(transitive)
+ Added@wendellhu/redi@0.17.1(transitive)
- Removed@univerjs/core@0.1.0-alpha.1
- Removed@wendellhu/redi@^0.12.11
- Removedrxjs@^7.8.1
- Removed@univerjs/core@0.1.0-alpha.1(transitive)
- Removed@wendellhu/redi@0.12.13(transitive)