(core) Exposing WidgetApi methods in a module scope

Summary:
Exposing WidgetApi methods (getOption, setOption, ...) in a module
scope to simplify custom widget code.

Test Plan: manual tests for now, as plugin is not yet on production.

Reviewers: paulfitz

Reviewed By: paulfitz

Differential Revision: https://phab.getgrist.com/D3268
This commit is contained in:
Jarosław Sadziński 2022-02-16 12:27:06 +01:00
parent 3136077636
commit 8d34b70899

View File

@ -73,6 +73,13 @@ export const docApi: GristDocAPI & GristView = {
export const on = rpc.on.bind(rpc); export const on = rpc.on.bind(rpc);
// Exposing widgetApi methods in a module scope.
export const getOption = widgetApi.getOption.bind(widgetApi);
export const setOption = widgetApi.setOption.bind(widgetApi);
export const setOptions = widgetApi.setOptions.bind(widgetApi);
export const getOptions = widgetApi.getOptions.bind(widgetApi);
export const clearOptions = widgetApi.clearOptions.bind(widgetApi);
// For custom widgets that support custom columns mappings store current configuration // For custom widgets that support custom columns mappings store current configuration
// in a memory. // in a memory.