Developer / Reference / TypeScript APIs / Interfaces / Plugins

SpreadsheetFunctionPlugin

Last updated on 13-May-2020 by Jakob Jakobsen Boysen
Jakob Jakobsen Boysen

Platform Lead
boysen@scifeon.com

This interface defines the methods of a spreadsheet function:

Example

See the spreadsheet function plugin page for an example.

API

getName(): string

This method names the function, i.e. the part before the first parenthesis. E.g. for the sum function this should return just 'SUM'.

Returns

The name of the spreadsheet function.

getValue(params: any[]): any

This method effectively defines how many and which parameters are allowed. Based on the parameters, an appropriate result is returned.

Parameters

  • params: any[] an array of typed parameters accepted in the function.

Returns

An appropriate scalar result, i.e. only primitive data types are allowed.

replaceAutofill(formula: string, direction: string, delta: number): string

This method is optional, and should only be implemented if something should be updated when the drag handle is used for auto filling cells..

Parameters

  • formula: string the formula that are being copied.
  • direction: string the direction of the drag handle. One of the following values: ['up', 'down', 'left', 'right'].
  • delta: number the distance from the root cell. Negative if direction is ['up', 'left'].

Returns

The updated formula.