@univerjs/engine-formula v0.5.0-beta.1Docs


Class: CalculateFormulaService

Extends

Constructors

new CalculateFormulaService()

new CalculateFormulaService(
   _configService, 
   _lexer, 
   _currentConfigService, 
   _runtimeService, 
   _formulaDependencyGenerator, 
   _interpreter, 
   _astTreeBuilder): CalculateFormulaService

Parameters

ParameterType
_configServiceIConfigService
_lexerLexer
_currentConfigServiceIFormulaCurrentConfigService
_runtimeServiceIFormulaRuntimeService
_formulaDependencyGeneratorIFormulaDependencyGenerator
_interpreterInterpreter
_astTreeBuilderAstTreeBuilder

Returns

CalculateFormulaService

Overrides

Disposable.constructor

Defined in

submodules/univer/packages/engine-formula/src/services/calculate-formula.service.ts:85

Properties

PropertyModifierTypeDefault valueInherited fromDefined in
_astTreeBuilderreadonlyAstTreeBuilderundefined-submodules/univer/packages/engine-formula/src/services/calculate-formula.service.ts:92
_configServicereadonlyIConfigServiceundefined-submodules/univer/packages/engine-formula/src/services/calculate-formula.service.ts:86
_currentConfigServicereadonlyIFormulaCurrentConfigServiceundefined-submodules/univer/packages/engine-formula/src/services/calculate-formula.service.ts:88
_disposedprotectedbooleanfalseDisposable._disposedsubmodules/univer/packages/core/src/shared/lifecycle.ts:93
_executionCompleteListener$readonlySubject<IAllRuntimeData>undefined-submodules/univer/packages/engine-formula/src/services/calculate-formula.service.ts:81
_executionInProgressListener$readonlySubject<IExecutionInProgressParams>undefined-submodules/univer/packages/engine-formula/src/services/calculate-formula.service.ts:77
_formulaDependencyGeneratorreadonlyIFormulaDependencyGeneratorundefined-submodules/univer/packages/engine-formula/src/services/calculate-formula.service.ts:90
_interpreterreadonlyInterpreterundefined-submodules/univer/packages/engine-formula/src/services/calculate-formula.service.ts:91
_lexerreadonlyLexerundefined-submodules/univer/packages/engine-formula/src/services/calculate-formula.service.ts:87
_runtimeServicereadonlyIFormulaRuntimeServiceundefined-submodules/univer/packages/engine-formula/src/services/calculate-formula.service.ts:89
executionCompleteListener$readonlyObservable<IAllRuntimeData>undefined-submodules/univer/packages/engine-formula/src/services/calculate-formula.service.ts:83
executionInProgressListener$readonlyObservable<IExecutionInProgressParams>undefined-submodules/univer/packages/engine-formula/src/services/calculate-formula.service.ts:79

Methods

_apply()

protected _apply(isArrayFormulaState): Promise<undefined | IAllRuntimeData>

Parameters

ParameterTypeDefault value
isArrayFormulaStatebooleanfalse

Returns

Promise<undefined | IAllRuntimeData>

Defined in

submodules/univer/packages/engine-formula/src/services/calculate-formula.service.ts:241


calculate()

calculate(formulaString, transformSuffix): undefined | ErrorNode

Parameters

ParameterTypeDefault value
formulaStringstringundefined
transformSuffixbooleantrue

Returns

undefined | ErrorNode

Defined in

submodules/univer/packages/engine-formula/src/services/calculate-formula.service.ts:361


dispose()

dispose(): void

Returns

void

Inherited from

Disposable.dispose

Defined in

submodules/univer/packages/core/src/shared/lifecycle.ts:106


disposeWithMe()

disposeWithMe(disposable): IDisposable

Parameters

ParameterType
disposableDisposableLike

Returns

IDisposable

Inherited from

Disposable.disposeWithMe

Defined in

submodules/univer/packages/core/src/shared/lifecycle.ts:96


ensureNotDisposed()

protected ensureNotDisposed(): void

Returns

void

Inherited from

Disposable.ensureNotDisposed

Defined in

submodules/univer/packages/core/src/shared/lifecycle.ts:100


execute()

execute(formulaDatasetConfig): Promise<void>

Parameters

ParameterType
formulaDatasetConfigIFormulaDatasetConfig

Returns

Promise<void>

Defined in

submodules/univer/packages/engine-formula/src/services/calculate-formula.service.ts:119


setRuntimeFeatureCellData()

setRuntimeFeatureCellData(featureId, featureData): void

When the feature is loading, the pre-calculated content needs to be input to the formula engine in advance, so that the formula can read the correct values.

Parameters

ParameterType
featureIdstring
featureDataIRuntimeUnitDataType

Returns

void

Defined in

submodules/univer/packages/engine-formula/src/services/calculate-formula.service.ts:111


setRuntimeFeatureRange()

setRuntimeFeatureRange(featureId, featureRange): void

Parameters

ParameterType
featureIdstring
featureRangeIFeatureDirtyRangeType

Returns

void

Defined in

submodules/univer/packages/engine-formula/src/services/calculate-formula.service.ts:115


stopFormulaExecution()

stopFormulaExecution(): void

Stop the execution of the formula.

Returns

void

Defined in

submodules/univer/packages/engine-formula/src/services/calculate-formula.service.ts:100