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

@univerjs/engine-formula v0.4.2Docs


Class: FunctionService

Extends

Implements

Constructors

new FunctionService()

new FunctionService(): FunctionService

Returns

FunctionService

Inherited from

Disposable.constructor

Properties

PropertyModifierTypeDefault valueInherited fromDefined in
_disposedprotectedbooleanfalseDisposable._disposedpackages/core/src/shared/lifecycle.ts:93 (opens in a new tab)

Methods

dispose()

dispose(): void

Returns

void

Overrides

Disposable.dispose

Defined in

packages/engine-formula/src/services/function.service.ts:64 (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)


getDescription()

getDescription(functionToken): undefined | IFunctionInfo

Parameters

ParameterType
functionTokenIFunctionNames

Returns

undefined | IFunctionInfo

Implementation of

IFunctionService.getDescription

Defined in

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


getDescriptions()

getDescriptions(): Map<IFunctionNames, IFunctionInfo>

Returns

Map<IFunctionNames, IFunctionInfo>

Implementation of

IFunctionService.getDescriptions

Defined in

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


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

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


getExecutors()

getExecutors(): Map<IFunctionNames, BaseFunction>

Returns

Map<IFunctionNames, BaseFunction>

Implementation of

IFunctionService.getExecutors

Defined in

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


hasDescription()

hasDescription(functionToken): boolean

Parameters

ParameterType
functionTokenIFunctionNames

Returns

boolean

Implementation of

IFunctionService.hasDescription

Defined in

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


hasExecutor()

hasExecutor(functionToken): boolean

Parameters

ParameterType
functionTokenIFunctionNames

Returns

boolean

Implementation of

IFunctionService.hasExecutor

Defined in

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


registerDescriptions()

registerDescriptions(...descriptions): IDisposable

Parameters

ParameterType
...descriptionsIFunctionInfo[]

Returns

IDisposable

Implementation of

IFunctionService.registerDescriptions

Defined in

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


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

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


unregisterDescriptions()

unregisterDescriptions(...functionTokens): void

Parameters

ParameterType
...functionTokensIFunctionNames[]

Returns

void

Implementation of

IFunctionService.unregisterDescriptions

Defined in

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


unregisterExecutors()

unregisterExecutors(...functionTokens): void

Parameters

ParameterType
...functionTokensIFunctionNames[]

Returns

void

Implementation of

IFunctionService.unregisterExecutors

Defined in

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


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