@univerjs-pro/engine-formula v0.5.4


Interface: IFunctionService

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

Methods

getDescription()

getDescription(functionToken): Nullable<IFunctionInfo>

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

Parameters

ParameterType
functionTokenIFunctionNames

Returns

Nullable<IFunctionInfo>


getDescriptions()

getDescriptions(): Map<IFunctionNames, IFunctionInfo>

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

Returns

Map<IFunctionNames, IFunctionInfo>


getExecutor()

getExecutor(functionToken): Nullable<BaseFunction>

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

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

Nullable<BaseFunction>


getExecutors()

getExecutors(): Map<IFunctionNames, BaseFunction>

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

Returns

Map<IFunctionNames, BaseFunction>


hasDescription()

hasDescription(functionToken): boolean

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

Parameters

ParameterType
functionTokenIFunctionNames

Returns

boolean


hasExecutor()

hasExecutor(functionToken): boolean

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

Parameters

ParameterType
functionTokenIFunctionNames

Returns

boolean


registerDescriptions()

registerDescriptions(...functions): IDisposable

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

Parameters

ParameterType
functionsIFunctionInfo[]

Returns

IDisposable


registerExecutors()

registerExecutors(...functions): void

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

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

Parameters

ParameterType
functionsBaseFunction[]

Returns

void


unregisterDescriptions()

unregisterDescriptions(...functionTokens): void

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

Parameters

ParameterType
functionTokensIFunctionNames[]

Returns

void


unregisterExecutors()

unregisterExecutors(...functionTokens): void

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

Parameters

ParameterType
functionTokensIFunctionNames[]

Returns

void