config module
Provides APIs to interact with the configuration-specific part of the SDK. This object is usable only on the configuration frame.
Interfaces
RemoveEvent |
Describes the results of the settings.remove event. Includes notifySuccess, and notifyFailure to indicate the status of whether the settings.save call succeeded or not and why. |
SaveEvent |
Describes the results of the settings.save event. Includes result, notifySuccess, and notifyFailure to indicate the return object (result) and the status of whether the settings.save call succeeded or not and why. |
SaveParameters |
Parameters used in the settings.save event |
Functions
is |
Checks if the pages.config capability is supported by the host |
register |
Registers a handler for when the tab configuration is changed by the user |
register |
Registers a handler for user attempts to remove content. This handler should be used to remove the underlying resource powering the content. The object passed to the handler must be used to indicate whether to proceed with the removal. Only one handler may be registered at a time. Subsequent registrations will override the first. |
register |
Registers a handler for when the user attempts to save the configuration. This handler should be used to create or update the underlying resource powering the content. The object passed to the handler must be used to notify whether to proceed with the save. Only one handler can be registered at a time. A subsequent registration replaces an existing registration. |
set |
Sets the configuration for the current instance. This is an asynchronous operation; calls to getConfig are not guaranteed to reflect the changed state. |
set |
Sets the validity state for the configuration. The initial value is false, so the user cannot save the configuration until this is called with true. |
Function Details
isSupported()
Checks if the pages.config capability is supported by the host
function isSupported(): boolean
Returns
boolean
boolean to represent whether the pages.config capability is supported
registerChangeConfigHandler(handlerFunctionType)
Registers a handler for when the tab configuration is changed by the user
function registerChangeConfigHandler(handler: handlerFunctionType)
Parameters
- handler
- handlerFunctionType
The handler to invoke when the user clicks on Settings.
registerOnRemoveHandler(removeEventType)
Registers a handler for user attempts to remove content. This handler should be used to remove the underlying resource powering the content. The object passed to the handler must be used to indicate whether to proceed with the removal. Only one handler may be registered at a time. Subsequent registrations will override the first.
function registerOnRemoveHandler(handler: removeEventType)
Parameters
- handler
- removeEventType
The handler to invoke when the user selects the Remove button.
registerOnSaveHandler(saveEventType)
Registers a handler for when the user attempts to save the configuration. This handler should be used to create or update the underlying resource powering the content. The object passed to the handler must be used to notify whether to proceed with the save. Only one handler can be registered at a time. A subsequent registration replaces an existing registration.
function registerOnSaveHandler(handler: saveEventType)
Parameters
- handler
- saveEventType
The handler to invoke when the user selects the Save button.
setConfig(InstanceConfig)
Sets the configuration for the current instance. This is an asynchronous operation; calls to getConfig are not guaranteed to reflect the changed state.
function setConfig(instanceConfig: InstanceConfig): Promise<void>
Parameters
- instanceConfig
- InstanceConfig
The desired configuration for this instance.
Returns
Promise<void>
Promise that resolves when the operation has completed.
setValidityState(boolean)
Sets the validity state for the configuration. The initial value is false, so the user cannot save the configuration until this is called with true.
function setValidityState(validityState: boolean)
Parameters
- validityState
-
boolean
Indicates whether the save or remove button is enabled for the user.