@univerjs/engine-formula v0.5.4
Class: FunctionService
Defined in: submodules/univer/packages/engine-formula/src/services/function.service.ts:59
Extends
Implements
Constructors
new FunctionService()
new FunctionService(): FunctionService
Returns
Inherited from
Properties
Property | Modifier | Type | Default value | Inherited from | Defined in |
---|---|---|---|---|---|
_disposed | protected | boolean | false | Disposable ._disposed | submodules/univer/packages/core/src/shared/lifecycle.ts:96 |
Methods
dispose()
dispose(): void
Defined in: submodules/univer/packages/engine-formula/src/services/function.service.ts:64
Returns
void
Overrides
disposeWithMe()
disposeWithMe(disposable): IDisposable
Defined in: submodules/univer/packages/core/src/shared/lifecycle.ts:99
Parameters
Parameter | Type |
---|---|
disposable | DisposableLike |
Returns
Inherited from
ensureNotDisposed()
protected ensureNotDisposed(): void
Defined in: submodules/univer/packages/core/src/shared/lifecycle.ts:103
Returns
void
Inherited from
getDescription()
getDescription(functionToken): undefined | IFunctionInfo
Defined in: submodules/univer/packages/engine-formula/src/services/function.service.ts:113
Parameters
Parameter | Type |
---|---|
functionToken | IFunctionNames |
Returns
undefined
| IFunctionInfo
Implementation of
IFunctionService
.getDescription
getDescriptions()
getDescriptions(): Map<IFunctionNames, IFunctionInfo>
Defined in: submodules/univer/packages/engine-formula/src/services/function.service.ts:109
Returns
Map
<IFunctionNames
, IFunctionInfo
>
Implementation of
IFunctionService
.getDescriptions
getExecutor()
getExecutor(functionToken): undefined | BaseFunction
Defined in: submodules/univer/packages/engine-formula/src/services/function.service.ts:80
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
Parameter | Type |
---|---|
functionToken | IFunctionNames |
Returns
undefined
| BaseFunction
Implementation of
getExecutors()
getExecutors(): Map<IFunctionNames, BaseFunction>
Defined in: submodules/univer/packages/engine-formula/src/services/function.service.ts:76
Returns
Map
<IFunctionNames
, BaseFunction
>
Implementation of
hasDescription()
hasDescription(functionToken): boolean
Defined in: submodules/univer/packages/engine-formula/src/services/function.service.ts:117
Parameters
Parameter | Type |
---|---|
functionToken | IFunctionNames |
Returns
boolean
Implementation of
IFunctionService
.hasDescription
hasExecutor()
hasExecutor(functionToken): boolean
Defined in: submodules/univer/packages/engine-formula/src/services/function.service.ts:84
Parameters
Parameter | Type |
---|---|
functionToken | IFunctionNames |
Returns
boolean
Implementation of
registerDescriptions()
registerDescriptions(...descriptions): IDisposable
Defined in: submodules/univer/packages/engine-formula/src/services/function.service.ts:95
Parameters
Parameter | Type |
---|---|
…descriptions | IFunctionInfo [] |
Returns
Implementation of
IFunctionService
.registerDescriptions
registerExecutors()
registerExecutors(...functions): void
Defined in: submodules/univer/packages/engine-formula/src/services/function.service.ts:69
Use register to register a function, new CustomFunction(inject, name)
Parameters
Parameter | Type |
---|---|
…functions | BaseFunction [] |
Returns
void
Implementation of
IFunctionService
.registerExecutors
unregisterDescriptions()
unregisterDescriptions(...functionTokens): void
Defined in: submodules/univer/packages/engine-formula/src/services/function.service.ts:121
Parameters
Parameter | Type |
---|---|
…functionTokens | IFunctionNames [] |
Returns
void
Implementation of
IFunctionService
.unregisterDescriptions
unregisterExecutors()
unregisterExecutors(...functionTokens): void
Defined in: submodules/univer/packages/engine-formula/src/services/function.service.ts:88
Parameters
Parameter | Type |
---|---|
…functionTokens | IFunctionNames [] |
Returns
void