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


Class: FunctionService

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:93

Methods

dispose()

dispose(): void

Returns

void

Overrides

Disposable.dispose

Defined in

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


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


getDescription()

getDescription(functionToken): undefined | IFunctionInfo

Parameters

ParameterType
functionTokenIFunctionNames

Returns

undefined | IFunctionInfo

Implementation of

IFunctionService.getDescription

Defined in

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


getDescriptions()

getDescriptions(): Map<IFunctionNames, IFunctionInfo>

Returns

Map<IFunctionNames, IFunctionInfo>

Implementation of

IFunctionService.getDescriptions

Defined in

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


getExecutor()

getExecutor(functionToken): undefined | 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).

Parameters

ParameterType
functionTokenIFunctionNames

Returns

undefined | BaseFunction

Implementation of

IFunctionService.getExecutor

Defined in

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


getExecutors()

getExecutors(): Map<IFunctionNames, BaseFunction>

Returns

Map<IFunctionNames, BaseFunction>

Implementation of

IFunctionService.getExecutors

Defined in

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


hasDescription()

hasDescription(functionToken): boolean

Parameters

ParameterType
functionTokenIFunctionNames

Returns

boolean

Implementation of

IFunctionService.hasDescription

Defined in

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


hasExecutor()

hasExecutor(functionToken): boolean

Parameters

ParameterType
functionTokenIFunctionNames

Returns

boolean

Implementation of

IFunctionService.hasExecutor

Defined in

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


registerDescriptions()

registerDescriptions(...descriptions): IDisposable

Parameters

ParameterType
descriptionsIFunctionInfo[]

Returns

IDisposable

Implementation of

IFunctionService.registerDescriptions

Defined in

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


registerExecutors()

registerExecutors(...functions): void

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

Parameters

ParameterType
functionsBaseFunction[]

Returns

void

Implementation of

IFunctionService.registerExecutors

Defined in

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


unregisterDescriptions()

unregisterDescriptions(...functionTokens): void

Parameters

ParameterType
functionTokensIFunctionNames[]

Returns

void

Implementation of

IFunctionService.unregisterDescriptions

Defined in

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


unregisterExecutors()

unregisterExecutors(...functionTokens): void

Parameters

ParameterType
functionTokensIFunctionNames[]

Returns

void

Implementation of

IFunctionService.unregisterExecutors

Defined in

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