@univerjs/engine-formula v0.4.2 • Docs
Class: FunctionService
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 | packages/core/src/shared/lifecycle.ts:93 (opens in a new tab) |
Methods
dispose()
dispose(): void
Returns
void
Overrides
Defined in
packages/engine-formula/src/services/function.service.ts:64 (opens in a new tab)
disposeWithMe()
disposeWithMe(disposable): IDisposable
Parameters
Parameter | Type |
---|---|
disposable | DisposableLike |
Returns
Inherited from
Defined in
packages/core/src/shared/lifecycle.ts:96 (opens in a new tab)
ensureNotDisposed()
protected ensureNotDisposed(): void
Returns
void
Inherited from
Defined in
packages/core/src/shared/lifecycle.ts:100 (opens in a new tab)
getDescription()
getDescription(functionToken): undefined | IFunctionInfo
Parameters
Parameter | Type |
---|---|
functionToken | IFunctionNames |
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
Parameter | Type |
---|---|
functionToken | IFunctionNames |
Returns
undefined
| BaseFunction
Implementation of
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
Defined in
packages/engine-formula/src/services/function.service.ts:76 (opens in a new tab)
hasDescription()
hasDescription(functionToken): boolean
Parameters
Parameter | Type |
---|---|
functionToken | IFunctionNames |
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
Parameter | Type |
---|---|
functionToken | IFunctionNames |
Returns
boolean
Implementation of
Defined in
packages/engine-formula/src/services/function.service.ts:84 (opens in a new tab)
registerDescriptions()
registerDescriptions(...descriptions): IDisposable
Parameters
Parameter | Type |
---|---|
...descriptions | IFunctionInfo [] |
Returns
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
Parameter | Type |
---|---|
...functions | BaseFunction [] |
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
Parameter | Type |
---|---|
...functionTokens | IFunctionNames [] |
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
Parameter | Type |
---|---|
...functionTokens | IFunctionNames [] |
Returns
void
Implementation of
IFunctionService
.unregisterExecutors
Defined in
packages/engine-formula/src/services/function.service.ts:88 (opens in a new tab)