Interface: WidgetAPI#

grist-plugin-api.WidgetAPI

API to manage Custom Widget state.

Table of contents#

Methods#

Methods#

clearOptions#

clearOptions(): Promise<void>

Clears all the options.

Returns#

Promise<void>


getOption#

getOption(key): Promise<any>

Get single value from Widget options object.

Parameters#

Name Type
key string

Returns#

Promise<any>


getOptions#

getOptions(): Promise<null | object>

Gets all options stored by the widget. Options are stored as plain JSON object.

Returns#

Promise<null | object>


setOption#

setOption(key, value): Promise<void>

Store single value in the Widget options object (and create it if necessary).

Parameters#

Name Type
key string
value any

Returns#

Promise<void>


setOptions#

setOptions(options): Promise<void>

Replaces all options stored by the widget.

Parameters#

Name Type
options Object

Returns#

Promise<void>