@univerjs/engine-formula v0.5.4


Class: FunctionService

Defined in: submodules/univer/packages/engine-formula/src/services/function.service.ts:59

Extends

Implements

Constructors

new FunctionService()

new FunctionService(): FunctionService

Returns

FunctionService

Inherited from

Disposable.constructor

Properties

PropertyModifierTypeDefault valueInherited fromDefined in
_disposedprotectedbooleanfalseDisposable._disposedsubmodules/univer/packages/core/src/shared/lifecycle.ts:96

Methods

dispose()

dispose(): void

Defined in: submodules/univer/packages/engine-formula/src/services/function.service.ts:64

Returns

void

Overrides

Disposable.dispose


disposeWithMe()

disposeWithMe(disposable): IDisposable

Defined in: submodules/univer/packages/core/src/shared/lifecycle.ts:99

Parameters

ParameterType
disposableDisposableLike

Returns

IDisposable

Inherited from

Disposable.disposeWithMe


ensureNotDisposed()

protected ensureNotDisposed(): void

Defined in: submodules/univer/packages/core/src/shared/lifecycle.ts:103

Returns

void

Inherited from

Disposable.ensureNotDisposed


getDescription()

getDescription(functionToken): undefined | IFunctionInfo

Defined in: submodules/univer/packages/engine-formula/src/services/function.service.ts:113

Parameters

ParameterType
functionTokenIFunctionNames

Returns

undefined | IFunctionInfo

Implementation of

IFunctionService.getDescription


getDescriptions()

getDescriptions(): Map<IFunctionNames, IFunctionInfo>

Defined in: submodules/univer/packages/engine-formula/src/services/function.service.ts:109

Returns

Map<IFunctionNames, IFunctionInfo>

Implementation of

IFunctionService.getDescriptions


getExecutor()

getExecutor(functionToken): undefined | BaseFunction

Defined in: submodules/univer/packages/engine-formula/src/services/function.service.ts:80

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).

Parameters

ParameterType
functionTokenIFunctionNames

Returns

undefined | BaseFunction

Implementation of

IFunctionService.getExecutor


getExecutors()

getExecutors(): Map<IFunctionNames, BaseFunction>

Defined in: submodules/univer/packages/engine-formula/src/services/function.service.ts:76

Returns

Map<IFunctionNames, BaseFunction>

Implementation of

IFunctionService.getExecutors


hasDescription()

hasDescription(functionToken): boolean

Defined in: submodules/univer/packages/engine-formula/src/services/function.service.ts:117

Parameters

ParameterType
functionTokenIFunctionNames

Returns

boolean

Implementation of

IFunctionService.hasDescription


hasExecutor()

hasExecutor(functionToken): boolean

Defined in: submodules/univer/packages/engine-formula/src/services/function.service.ts:84

Parameters

ParameterType
functionTokenIFunctionNames

Returns

boolean

Implementation of

IFunctionService.hasExecutor


registerDescriptions()

registerDescriptions(...descriptions): IDisposable

Defined in: submodules/univer/packages/engine-formula/src/services/function.service.ts:95

Parameters

ParameterType
descriptionsIFunctionInfo[]

Returns

IDisposable

Implementation of

IFunctionService.registerDescriptions


registerExecutors()

registerExecutors(...functions): void

Defined in: submodules/univer/packages/engine-formula/src/services/function.service.ts:69

Use register to register a function, new CustomFunction(inject, name)

Parameters

ParameterType
functionsBaseFunction[]

Returns

void

Implementation of

IFunctionService.registerExecutors


unregisterDescriptions()

unregisterDescriptions(...functionTokens): void

Defined in: submodules/univer/packages/engine-formula/src/services/function.service.ts:121

Parameters

ParameterType
functionTokensIFunctionNames[]

Returns

void

Implementation of

IFunctionService.unregisterDescriptions


unregisterExecutors()

unregisterExecutors(...functionTokens): void

Defined in: submodules/univer/packages/engine-formula/src/services/function.service.ts:88

Parameters

ParameterType
functionTokensIFunctionNames[]

Returns

void

Implementation of

IFunctionService.unregisterExecutors