IWidgetConfiguration interface

Widget authors implement this interface for their configuration.

Properties

listen

Listen to message from host

load

Called by the host to setup the widget configuration, which uses the settings shared with the widget to complete its rendering experience.

onSave

Called by the host when the user clicks on the Save button. Widget author is expected to run validations if needed. If ready to save, then use WidgetHelpers.WidgetConfigurationSave.Valid() to return the serialized custom settings of the widget from the configuraton. If custom settings are not valid and so not ready to save, then use WidgetHelpers.WidgetConfigurationSave.Invalid() to notify the host to stop save.

onSaveComplete

(Optional) Called by the host when the configuration is ready to be saved (when the user clicks the save button on the configuration panel)

Property Details

listen

Listen to message from host

listen?: (event: string, eventArgs: EventArgs<T>) => void

Property Value

(event: string, eventArgs: EventArgs<T>) => void

load

Called by the host to setup the widget configuration, which uses the settings shared with the widget to complete its rendering experience.

load: (widgetSettings: WidgetSettings, widgetConfigurationContext: IWidgetConfigurationContext) => Promise<WidgetStatus>

Property Value

(widgetSettings: WidgetSettings, widgetConfigurationContext: IWidgetConfigurationContext) => Promise<WidgetStatus>

onSave

Called by the host when the user clicks on the Save button. Widget author is expected to run validations if needed. If ready to save, then use WidgetHelpers.WidgetConfigurationSave.Valid() to return the serialized custom settings of the widget from the configuraton. If custom settings are not valid and so not ready to save, then use WidgetHelpers.WidgetConfigurationSave.Invalid() to notify the host to stop save.

onSave: () => Promise<SaveStatus>

Property Value

() => Promise<SaveStatus>

onSaveComplete

(Optional) Called by the host when the configuration is ready to be saved (when the user clicks the save button on the configuration panel)

onSaveComplete?: () => void

Property Value

() => void