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


Interface: IFunctionService

Methods

getDescription()

getDescription(functionToken): Nullable<IFunctionInfo>

Parameters

ParameterType
functionTokenIFunctionNames

Returns

Nullable<IFunctionInfo>

Defined in

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


getDescriptions()

getDescriptions(): Map<IFunctionNames, IFunctionInfo>

Returns

Map<IFunctionNames, IFunctionInfo>

Defined in

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


getExecutor()

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

Nullable<BaseFunction>

Defined in

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


getExecutors()

getExecutors(): Map<IFunctionNames, BaseFunction>

Returns

Map<IFunctionNames, BaseFunction>

Defined in

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


hasDescription()

hasDescription(functionToken): boolean

Parameters

ParameterType
functionTokenIFunctionNames

Returns

boolean

Defined in

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


hasExecutor()

hasExecutor(functionToken): boolean

Parameters

ParameterType
functionTokenIFunctionNames

Returns

boolean

Defined in

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


registerDescriptions()

registerDescriptions(...functions): IDisposable

Parameters

ParameterType
functionsIFunctionInfo[]

Returns

IDisposable

Defined in

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


registerExecutors()

registerExecutors(...functions): void

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

Parameters

ParameterType
functionsBaseFunction[]

Returns

void

Defined in

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


unregisterDescriptions()

unregisterDescriptions(...functionTokens): void

Parameters

ParameterType
functionTokensIFunctionNames[]

Returns

void

Defined in

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


unregisterExecutors()

unregisterExecutors(...functionTokens): void

Parameters

ParameterType
functionTokensIFunctionNames[]

Returns

void

Defined in

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