Defines a delegate to implement a function.
Implements: IFunction
Description
The DelegatedFunction class allows you to define a delegate to implement a function.
Constructors
Constructs this function class with the specified parameters.
public
constructor(name: string, calculator: (params: Variant[], variantOperations: IVariantOperations) => Promise<Variant>, context?: any)
- name: string - name of this function.
- calculator:(params: Variant[], variantOperations: IVariantOperations) => Promise<Variant> - function calculator delegate.
- context: any - context
Properties
name
Function’s name.
public
name(): string
- retuns: string - function’s name.
Instance methods
calculate
Function’s calculation method.
public
calculate(params: Variant[], variantOperations: IVariantOperations): Promise<Variant>
- params: Variant[] - array with function parameters.
- variantOperations: IVariantOperations - variants operations manager.
- returns: Promise<Variant> - returned function’s result.