settings module
Type Aliases
getSettingsCallbackFunctionType |
Get settings callback function type |
registerOnRemoveHandlerFunctionType |
Register on remove handler function type |
registerOnSaveHandlerFunctionType |
Register on save handler function type |
setSettingsOnCompleteFunctionType |
Set settings on complete function type |
Functions
Function Details
getSettings(getSettingsCallbackFunctionType)
Warning
This API is now deprecated.
As of TeamsJS v2.0.0, please use pages.getConfig(): Promise<InstanceConfig> instead.
Gets the settings for the current instance.
function getSettings(callback: getSettingsCallbackFunctionType)
Parameters
- callback
- getSettingsCallbackFunctionType
The callback to invoke when the Settings object is retrieved.
registerOnRemoveHandler(registerOnRemoveHandlerFunctionType)
Warning
This API is now deprecated.
As of TeamsJS v2.0.0, please use pages.config.registerOnRemoveHandler(handler: registerOnRemoveHandlerFunctionType): void instead.
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: registerOnRemoveHandlerFunctionType)
Parameters
The handler to invoke when the user selects the remove button.
registerOnSaveHandler(registerOnSaveHandlerFunctionType)
Warning
This API is now deprecated.
As of TeamsJS v2.0.0, please use pages.config.registerOnSaveHandler(handler: registerOnSaveHandlerFunctionType): void instead.
Registers a handler for when the user attempts to save the settings. 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: registerOnSaveHandlerFunctionType)
Parameters
The handler to invoke when the user selects the save button.
setSettings(InstanceConfig, setSettingsOnCompleteFunctionType)
Warning
This API is now deprecated.
As of TeamsJS v2.0.0, please use pages.config.setConfig(instanceSettings: Config): Promise<void> instead.
Sets the settings for the current instance. This is an asynchronous operation; calls to getSettings are not guaranteed to reflect the changed state.
function setSettings(instanceSettings: InstanceConfig, onComplete?: setSettingsOnCompleteFunctionType)
Parameters
- instanceSettings
- InstanceConfig
- onComplete
- setSettingsOnCompleteFunctionType
setValidityState(boolean)
Warning
This API is now deprecated.
As of TeamsJS v2.0.0, please use pages.config.setValidityState(validityState: boolean): void instead.
Sets the validity state for the settings. The initial value is false, so the user cannot save the settings 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.