settings module
Namespace to interact with the settings-specific part of the SDK. This object is usable only on the settings frame.
Interfaces
RemoveEvent | |
SaveEvent | |
SaveParameters | |
Settings |
Functions
get |
Gets the settings for the current instance. |
initialize() | |
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 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. |
set |
Sets the settings for the current instance. This is an asynchronous operation; calls to getSettings are not guaranteed to reflect the changed state. |
set |
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 Details
getSettings((instanceSettings: Settings) => void)
Gets the settings for the current instance.
function getSettings(callback: (instanceSettings: Settings) => void)
Parameters
- callback
-
(instanceSettings: Settings) => void
The callback to invoke when the Settings object is retrieved.
initialize()
function initialize()
registerOnRemoveHandler((evt: RemoveEvent) => void)
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: (evt: RemoveEvent) => void)
Parameters
- handler
-
(evt: RemoveEvent) => void
The handler to invoke when the user selects the remove button.
registerOnSaveHandler((evt: SaveEvent) => void)
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: (evt: SaveEvent) => void)
Parameters
- handler
-
(evt: SaveEvent) => void
The handler to invoke when the user selects the save button.
setSettings(Settings, (status: boolean, reason?: string) => void)
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: Settings, onComplete?: (status: boolean, reason?: string) => void)
Parameters
- instanceSettings
-
@microsoft/teams-js.@microsoft.teams-js.settings.Settings
- onComplete
-
(status: boolean, reason?: string) => void
setValidityState(boolean)
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.
Commentaires
https://aka.ms/ContentUserFeedback.
Bientôt disponible : Tout au long de 2024, nous allons supprimer progressivement GitHub Issues comme mécanisme de commentaires pour le contenu et le remplacer par un nouveau système de commentaires. Pour plus d’informations, consultezEnvoyer et afficher des commentaires pour