tasks module
Type Aliases
startTaskSubmitHandlerFunctionType |
Function type that is used to receive the result when a task module is submitted by calling tasks.submitTask(result?: string | object, appIds?: string | string[]): void |
Functions
get |
Sets the height and width of the TaskInfo object to the original height and width, if initially specified, otherwise uses the height and width values corresponding to TaskModuleDimension.Small |
start |
|
submit |
|
update |
Function Details
getDefaultSizeIfNotProvided(DialogInfo)
Sets the height and width of the TaskInfo object to the original height and width, if initially specified, otherwise uses the height and width values corresponding to TaskModuleDimension.Small
function getDefaultSizeIfNotProvided(taskInfo: DialogInfo): TaskInfo
Parameters
- taskInfo
- DialogInfo
TaskInfo object from which to extract size info, if specified
Returns
TaskInfo with height and width specified
startTask(DialogInfo, startTaskSubmitHandlerFunctionType)
Warning
This API is now deprecated.
As of 2.8.0:
- For url-based dialogs, please use dialog.url.open(urlDialogInfo: UrlDialogInfo, submitHandler?: DialogSubmitHandler, messageFromChildHandler?: PostMessageChannel): void .
- For url-based dialogs with bot interaction, please use dialog.url.bot.open(botUrlDialogInfo: BotUrlDialogInfo, submitHandler?: DialogSubmitHandler, messageFromChildHandler?: PostMessageChannel): void
- For Adaptive Card-based dialogs:
- In Teams, please continue to use this function until the new functions in adaptiveCard have been fully implemented. You can tell at runtime when they are implemented in Teams by checking the return value of the isSupported function. This documentation line will also be removed once they have been fully implemented in Teams.
- In all other hosts, please use dialog.adaptiveCard.open(cardDialogInfo: CardDialogInfo, submitHandler?: DialogSubmitHandler, messageFromChildHandler?: PostMessageChannel): void
Allows an app to open the task module.
function startTask(taskInfo: DialogInfo, submitHandler?: startTaskSubmitHandlerFunctionType): IAppWindow
Parameters
- taskInfo
- DialogInfo
An object containing the parameters of the task module
- submitHandler
- startTaskSubmitHandlerFunctionType
Handler to call when the task module is completed
Returns
submitTask(string | object, string | string[])
function submitTask(result?: string | object, appIds?: string | string[])
Parameters
- result
-
string | object
Contains the result to be sent to the bot or the app. Typically a JSON object or a serialized version of it
- appIds
-
string | string[]
Valid application(s) that can receive the result of the submitted dialogs. Specifying this parameter helps prevent malicious apps from retrieving the dialog result. Multiple app IDs can be specified because a web app from a single underlying domain can power multiple apps across different environments and branding schemes.
updateTask(DialogInfo)
Warning
This API is now deprecated.
As of TeamsJS v2.0.0, please use dialog.update.resize(dimensions: DialogSize): void instead.
Update height/width task info properties.
function updateTask(taskInfo: DialogInfo)
Parameters
- taskInfo
- DialogInfo
An object containing width and height properties