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

@univerjs/engine-formula v0.1.17Docs


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:65 (opens in a new tab)


disposeWithMe()

protected 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:114 (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:110 (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:81 (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:77 (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:118 (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:85 (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:96 (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:70 (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:122 (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:89 (opens in a new tab)


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