API Reference
@univerjs
@univerjs/engine-formula
classes
Calculateformulaservice

@univerjs/engine-formula v0.4.2Docs


Class: CalculateFormulaService

Extends

Constructors

new CalculateFormulaService()

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

Parameters

ParameterType
_configServiceIConfigService
_lexerLexer
_currentConfigServiceIFormulaCurrentConfigService
_runtimeServiceIFormulaRuntimeService
_formulaDependencyGeneratorFormulaDependencyGenerator
_interpreterInterpreter
_astTreeBuilderAstTreeBuilder

Returns

CalculateFormulaService

Overrides

Disposable.constructor

Defined in

packages/engine-formula/src/services/calculate-formula.service.ts:66 (opens in a new tab)

Properties

PropertyModifierTypeDefault valueInherited fromDefined in
_disposedprotectedbooleanfalseDisposable._disposedpackages/core/src/shared/lifecycle.ts:93 (opens in a new tab)
executionCompleteListener$readonlyObservable<IAllRuntimeData>undefined-packages/engine-formula/src/services/calculate-formula.service.ts:64 (opens in a new tab)
executionInProgressListener$readonlyObservable<IExecutionInProgressParams>undefined-packages/engine-formula/src/services/calculate-formula.service.ts:60 (opens in a new tab)

Methods

calculate()

calculate(formulaString, transformSuffix): undefined | ErrorNode

Parameters

ParameterTypeDefault value
formulaStringstringundefined
transformSuffixbooleantrue

Returns

undefined | ErrorNode

Defined in

packages/engine-formula/src/services/calculate-formula.service.ts:339 (opens in a new tab)


dispose()

dispose(): void

Returns

void

Inherited from

Disposable.dispose

Defined in

packages/core/src/shared/lifecycle.ts:106 (opens in a new tab)


disposeWithMe()

disposeWithMe(disposable): IDisposable

Parameters

ParameterType
disposableDisposableLike

Returns

IDisposable

Inherited from

Disposable.disposeWithMe

Defined in

packages/core/src/shared/lifecycle.ts:96 (opens in a new tab)


ensureNotDisposed()

protected ensureNotDisposed(): void

Returns

void

Inherited from

Disposable.ensureNotDisposed

Defined in

packages/core/src/shared/lifecycle.ts:100 (opens in a new tab)


execute()

execute(formulaDatasetConfig): Promise<void>

Parameters

ParameterType
formulaDatasetConfigIFormulaDatasetConfig

Returns

Promise<void>

Defined in

packages/engine-formula/src/services/calculate-formula.service.ts:100 (opens in a new tab)


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

packages/engine-formula/src/services/calculate-formula.service.ts:92 (opens in a new tab)


setRuntimeFeatureRange()

setRuntimeFeatureRange(featureId, featureRange): void

Parameters

ParameterType
featureIdstring
featureRangeIFeatureDirtyRangeType

Returns

void

Defined in

packages/engine-formula/src/services/calculate-formula.service.ts:96 (opens in a new tab)


stopFormulaExecution()

stopFormulaExecution(): void

Stop the execution of the formula.

Returns

void

Defined in

packages/engine-formula/src/services/calculate-formula.service.ts:81 (opens in a new tab)


Copyright © 2021-2024 DreamNum Co,Ltd. All Rights Reserved.