@microsoft/teams-js 2.31.0-beta.0 → 2.31.0-beta.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/esm/packages/teams-js/dts/internal/appHelpers.d.ts +1 -1
- package/dist/esm/packages/teams-js/dts/internal/dialogHelpers.d.ts +32 -0
- package/dist/esm/packages/teams-js/dts/internal/marketplaceUtils.d.ts +1 -1
- package/dist/esm/packages/teams-js/dts/internal/mediaUtil.d.ts +2 -2
- package/dist/esm/packages/teams-js/dts/public/{app.d.ts → app/app.d.ts} +13 -44
- package/dist/esm/packages/teams-js/dts/public/app/lifecycle.d.ts +40 -0
- package/dist/esm/packages/teams-js/dts/public/appInitialization.d.ts +1 -1
- package/dist/esm/packages/teams-js/dts/public/chat.d.ts +26 -28
- package/dist/esm/packages/teams-js/dts/public/dialog/adaptiveCard/adaptiveCard.d.ts +30 -0
- package/dist/esm/packages/teams-js/dts/public/dialog/adaptiveCard/bot.d.ts +26 -0
- package/dist/esm/packages/teams-js/dts/public/dialog/dialog.d.ts +69 -0
- package/dist/esm/packages/teams-js/dts/public/dialog/update.d.ts +23 -0
- package/dist/esm/packages/teams-js/dts/public/dialog/url/bot.d.ts +29 -0
- package/dist/esm/packages/teams-js/dts/public/dialog/url/parentCommunication.d.ts +49 -0
- package/dist/esm/packages/teams-js/dts/public/dialog/url/url.d.ts +60 -0
- package/dist/esm/packages/teams-js/dts/public/geoLocation/geoLocation.d.ts +67 -0
- package/dist/esm/packages/teams-js/dts/public/geoLocation/map.d.ts +27 -0
- package/dist/esm/packages/teams-js/dts/public/index.d.ts +20 -18
- package/dist/esm/packages/teams-js/dts/public/interfaces.d.ts +12 -1
- package/dist/esm/packages/teams-js/dts/public/liveShareHost.d.ts +134 -136
- package/dist/esm/packages/teams-js/dts/public/location.d.ts +72 -74
- package/dist/esm/packages/teams-js/dts/public/mail.d.ts +79 -81
- package/dist/esm/packages/teams-js/dts/public/marketplace.d.ts +314 -316
- package/dist/esm/packages/teams-js/dts/public/media.d.ts +425 -427
- package/dist/esm/packages/teams-js/dts/public/menus.d.ts +164 -166
- package/dist/esm/packages/teams-js/dts/public/monetization.d.ts +48 -50
- package/dist/esm/packages/teams-js/dts/public/nestedAppAuth.d.ts +9 -11
- package/dist/esm/packages/teams-js/dts/public/people.d.ts +61 -63
- package/dist/esm/packages/teams-js/dts/public/search.d.ts +76 -86
- package/dist/esm/packages/teams-js/dts/public/secondaryBrowser.d.ts +25 -27
- package/dist/esm/packages/teams-js/dts/public/tasks.d.ts +52 -54
- package/dist/esm/packages/teams-js/dts/public/teamsAPIs.d.ts +74 -76
- package/dist/esm/packages/teams-js/dts/public/thirdPartyCloudStorage.d.ts +96 -98
- package/dist/esm/packages/teams-js/src/index.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/appHelpers.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/deepLinkUtilities.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/dialogHelpers.js +1 -0
- package/dist/esm/packages/teams-js/src/internal/marketplaceUtils.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/mediaUtil.js +1 -1
- package/dist/esm/packages/teams-js/src/public/app/app.js +1 -0
- package/dist/esm/packages/teams-js/src/public/app/lifecycle.js +1 -0
- package/dist/esm/packages/teams-js/src/public/appInitialization.js +1 -1
- package/dist/esm/packages/teams-js/src/public/chat.js +1 -1
- package/dist/esm/packages/teams-js/src/public/dialog/adaptiveCard/adaptiveCard.js +1 -0
- package/dist/esm/packages/teams-js/src/public/dialog/adaptiveCard/bot.js +1 -0
- package/dist/esm/packages/teams-js/src/public/dialog/dialog.js +1 -0
- package/dist/esm/packages/teams-js/src/public/dialog/update.js +1 -0
- package/dist/esm/packages/teams-js/src/public/dialog/url/bot.js +1 -0
- package/dist/esm/packages/teams-js/src/public/dialog/url/parentCommunication.js +1 -0
- package/dist/esm/packages/teams-js/src/public/dialog/url/url.js +1 -0
- package/dist/esm/packages/teams-js/src/public/geoLocation/geoLocation.js +1 -0
- package/dist/esm/packages/teams-js/src/public/geoLocation/map.js +1 -0
- package/dist/esm/packages/teams-js/src/public/liveShareHost.js +1 -1
- package/dist/esm/packages/teams-js/src/public/location.js +1 -1
- package/dist/esm/packages/teams-js/src/public/mail.js +1 -1
- package/dist/esm/packages/teams-js/src/public/marketplace.js +1 -1
- package/dist/esm/packages/teams-js/src/public/media.js +1 -1
- package/dist/esm/packages/teams-js/src/public/menus.js +1 -1
- package/dist/esm/packages/teams-js/src/public/monetization.js +1 -1
- package/dist/esm/packages/teams-js/src/public/nestedAppAuth.js +1 -1
- package/dist/esm/packages/teams-js/src/public/people.js +1 -1
- package/dist/esm/packages/teams-js/src/public/publicAPIs.js +1 -1
- package/dist/esm/packages/teams-js/src/public/search.js +1 -1
- package/dist/esm/packages/teams-js/src/public/secondaryBrowser.js +1 -1
- package/dist/esm/packages/teams-js/src/public/tasks.js +1 -1
- package/dist/esm/packages/teams-js/src/public/teamsAPIs.js +1 -1
- package/dist/esm/packages/teams-js/src/public/thirdPartyCloudStorage.js +1 -1
- package/dist/esm/packages/teams-js/src/public/version.js +1 -1
- package/dist/esm/packages/teams-js/src/public/webStorage.js +1 -1
- package/dist/umd/MicrosoftTeams.d.ts +2219 -2022
- package/dist/umd/MicrosoftTeams.js +2397 -2244
- package/dist/umd/MicrosoftTeams.js.map +1 -1
- package/dist/umd/MicrosoftTeams.min.js +1 -1
- package/dist/umd/MicrosoftTeams.min.js.map +1 -1
- package/package.json +1 -1
- package/dist/esm/packages/teams-js/dts/public/dialog.d.ts +0 -286
- package/dist/esm/packages/teams-js/dts/public/geoLocation.d.ts +0 -100
- package/dist/esm/packages/teams-js/src/public/app.js +0 -1
- package/dist/esm/packages/teams-js/src/public/dialog.js +0 -1
- package/dist/esm/packages/teams-js/src/public/geoLocation.js +0 -1
@@ -1,4 +1,4 @@
|
|
1
|
-
import * as app from '../public/app';
|
1
|
+
import * as app from '../public/app/app';
|
2
2
|
export declare function appInitializeHelper(apiVersionTag: string, validMessageOrigins?: string[]): Promise<void>;
|
3
3
|
export declare function notifyAppLoadedHelper(apiVersionTag: string): void;
|
4
4
|
export declare function notifyExpectedFailureHelper(apiVersionTag: string, expectedFailureRequest: app.IExpectedFailureRequest): void;
|
@@ -0,0 +1,32 @@
|
|
1
|
+
import * as dialog from '../public/dialog/dialog';
|
2
|
+
import { AdaptiveCardDialogInfo, BotAdaptiveCardDialogInfo } from '../public/interfaces';
|
3
|
+
import { BotUrlDialogInfo, DialogInfo, DialogSize, UrlDialogInfo } from '../public/interfaces';
|
4
|
+
import { ApiVersionNumber } from './telemetry';
|
5
|
+
/**
|
6
|
+
* v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY
|
7
|
+
*/
|
8
|
+
export declare const dialogTelemetryVersionNumber: ApiVersionNumber;
|
9
|
+
export declare function updateResizeHelper(apiVersionTag: string, dimensions: DialogSize): void;
|
10
|
+
export declare function urlOpenHelper(apiVersionTag: string, urlDialogInfo: UrlDialogInfo, submitHandler?: dialog.DialogSubmitHandler, messageFromChildHandler?: dialog.PostMessageChannel): void;
|
11
|
+
export declare function botUrlOpenHelper(apiVersionTag: string, urlDialogInfo: BotUrlDialogInfo, submitHandler?: dialog.DialogSubmitHandler, messageFromChildHandler?: dialog.PostMessageChannel): void;
|
12
|
+
export declare function urlSubmitHelper(apiVersionTag: string, result?: string | object, appIds?: string | string[]): void;
|
13
|
+
/**
|
14
|
+
* @hidden
|
15
|
+
* Hide from docs
|
16
|
+
* --------
|
17
|
+
* Convert AdaptiveCardDialogInfo to DialogInfo to send the information to host in {@linkcode adaptiveCard.open} API.
|
18
|
+
*
|
19
|
+
* @internal
|
20
|
+
*/
|
21
|
+
export declare function getDialogInfoFromAdaptiveCardDialogInfo(adaptiveCardDialogInfo: AdaptiveCardDialogInfo): DialogInfo;
|
22
|
+
/**
|
23
|
+
* @hidden
|
24
|
+
* Hide from docs
|
25
|
+
* --------
|
26
|
+
* Convert BotAdaptiveCardDialogInfo to DialogInfo to send the information to host in {@linkcode adaptiveCard.open} API.
|
27
|
+
*
|
28
|
+
* @internal
|
29
|
+
*/
|
30
|
+
export declare function getDialogInfoFromBotAdaptiveCardDialogInfo(botAdaptiveCardDialogInfo: BotAdaptiveCardDialogInfo): DialogInfo;
|
31
|
+
export declare const storedMessages: string[];
|
32
|
+
export declare function handleDialogMessage(message: string): void;
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import
|
2
|
-
import
|
1
|
+
import * as media from '../public/media';
|
2
|
+
import * as people from '../public/people';
|
3
3
|
/**
|
4
4
|
* @hidden
|
5
5
|
* Helper function to create a blob from media chunks based on their sequence
|
@@ -1,5 +1,6 @@
|
|
1
|
-
import { ChannelType, FrameContexts, HostClientType, HostName, TeamType, UserTeamRole } from '
|
2
|
-
import { ActionInfo, FileOpenPreference, LocaleInfo
|
1
|
+
import { ChannelType, FrameContexts, HostClientType, HostName, TeamType, UserTeamRole } from '../constants';
|
2
|
+
import { ActionInfo, FileOpenPreference, LocaleInfo } from '../interfaces';
|
3
|
+
import * as lifecycle from './lifecycle';
|
3
4
|
/** App Initialization Messages */
|
4
5
|
export declare const Messages: {
|
5
6
|
/** App loaded. */
|
@@ -112,9 +113,17 @@ export interface AppInfo {
|
|
112
113
|
*/
|
113
114
|
iconPositionVertical?: number;
|
114
115
|
/**
|
115
|
-
* Time when the user clicked on the tab
|
116
|
+
* Time when the user clicked on the tab using the date.
|
117
|
+
*
|
118
|
+
* For measuring elapsed time between the moment the user click the tab, use {@link app.AppInfo.userClickTimeV2 | app.Context.app.userClickTimeV2} instead as it uses the performance timer API.
|
116
119
|
*/
|
117
120
|
userClickTime?: number;
|
121
|
+
/**
|
122
|
+
* Time when the user click on the app by using the performance timer API. Useful for measuring elapsed time accurately.
|
123
|
+
*
|
124
|
+
* For displaying the time when the user clicked on the app, please use {@link app.AppInfo.userClickTime | app.Context.app.userClickTime} as it uses the date.
|
125
|
+
*/
|
126
|
+
userClickTimeV2?: number;
|
118
127
|
/**
|
119
128
|
* The ID of the parent message from which this task module was launched.
|
120
129
|
* This is only available in task modules launched from bot cards.
|
@@ -549,44 +558,4 @@ export declare function registerOnThemeChangeHandler(handler: themeHandler): voi
|
|
549
558
|
* does not necessarily indicate whether the target loaded successfully.
|
550
559
|
*/
|
551
560
|
export declare function openLink(deepLink: string): Promise<void>;
|
552
|
-
|
553
|
-
* A namespace for enabling the suspension or delayed termination of an app when the user navigates away.
|
554
|
-
* When an app registers for the registerBeforeSuspendOrTerminateHandler, it chooses to delay termination.
|
555
|
-
* When an app registers for both registerBeforeSuspendOrTerminateHandler and registerOnResumeHandler, it chooses the suspension of the app .
|
556
|
-
* Please note that selecting suspension doesn't guarantee prevention of background termination.
|
557
|
-
* The outcome is influenced by factors such as available memory and the number of suspended apps.
|
558
|
-
*
|
559
|
-
* @beta
|
560
|
-
*/
|
561
|
-
export declare namespace lifecycle {
|
562
|
-
/**
|
563
|
-
* Register on resume handler function type
|
564
|
-
*
|
565
|
-
* @param context - Data structure to be used to pass the context to the app.
|
566
|
-
*/
|
567
|
-
type registerOnResumeHandlerFunctionType = (context: ResumeContext) => void;
|
568
|
-
/**
|
569
|
-
* Register before suspendOrTerminate handler function type
|
570
|
-
*
|
571
|
-
* @returns void
|
572
|
-
*/
|
573
|
-
type registerBeforeSuspendOrTerminateHandlerFunctionType = () => Promise<void>;
|
574
|
-
/**
|
575
|
-
* Registers a handler to be called before the page is suspended or terminated. Once a user navigates away from an app,
|
576
|
-
* the handler will be invoked. App developers can use this handler to save unsaved data, pause sync calls etc.
|
577
|
-
*
|
578
|
-
* @param handler - The handler to invoke before the page is suspended or terminated. When invoked, app can perform tasks like cleanups, logging etc.
|
579
|
-
* Upon returning, the app will be suspended or terminated.
|
580
|
-
*
|
581
|
-
*/
|
582
|
-
function registerBeforeSuspendOrTerminateHandler(handler: registerBeforeSuspendOrTerminateHandlerFunctionType): void;
|
583
|
-
/**
|
584
|
-
* Registers a handler to be called when the page has been requested to resume from being suspended.
|
585
|
-
*
|
586
|
-
* @param handler - The handler to invoke when the page is requested to be resumed. The app is supposed to navigate to
|
587
|
-
* the appropriate page using the ResumeContext. Once done, the app should then call {@link notifySuccess}.
|
588
|
-
*
|
589
|
-
* @beta
|
590
|
-
*/
|
591
|
-
function registerOnResumeHandler(handler: registerOnResumeHandlerFunctionType): void;
|
592
|
-
}
|
561
|
+
export { lifecycle };
|
@@ -0,0 +1,40 @@
|
|
1
|
+
import { ResumeContext } from '../interfaces';
|
2
|
+
/**
|
3
|
+
* A namespace for enabling the suspension or delayed termination of an app when the user navigates away.
|
4
|
+
* When an app registers for the registerBeforeSuspendOrTerminateHandler, it chooses to delay termination.
|
5
|
+
* When an app registers for both registerBeforeSuspendOrTerminateHandler and registerOnResumeHandler, it chooses the suspension of the app .
|
6
|
+
* Please note that selecting suspension doesn't guarantee prevention of background termination.
|
7
|
+
* The outcome is influenced by factors such as available memory and the number of suspended apps.
|
8
|
+
*
|
9
|
+
* @beta
|
10
|
+
*/
|
11
|
+
/**
|
12
|
+
* Register on resume handler function type
|
13
|
+
*
|
14
|
+
* @param context - Data structure to be used to pass the context to the app.
|
15
|
+
*/
|
16
|
+
export type registerOnResumeHandlerFunctionType = (context: ResumeContext) => void;
|
17
|
+
/**
|
18
|
+
* Register before suspendOrTerminate handler function type
|
19
|
+
*
|
20
|
+
* @returns void
|
21
|
+
*/
|
22
|
+
export type registerBeforeSuspendOrTerminateHandlerFunctionType = () => Promise<void>;
|
23
|
+
/**
|
24
|
+
* Registers a handler to be called before the page is suspended or terminated. Once a user navigates away from an app,
|
25
|
+
* the handler will be invoked. App developers can use this handler to save unsaved data, pause sync calls etc.
|
26
|
+
*
|
27
|
+
* @param handler - The handler to invoke before the page is suspended or terminated. When invoked, app can perform tasks like cleanups, logging etc.
|
28
|
+
* Upon returning, the app will be suspended or terminated.
|
29
|
+
*
|
30
|
+
*/
|
31
|
+
export declare function registerBeforeSuspendOrTerminateHandler(handler: registerBeforeSuspendOrTerminateHandlerFunctionType): void;
|
32
|
+
/**
|
33
|
+
* Registers a handler to be called when the page has been requested to resume from being suspended.
|
34
|
+
*
|
35
|
+
* @param handler - The handler to invoke when the page is requested to be resumed. The app is supposed to navigate to
|
36
|
+
* the appropriate page using the ResumeContext. Once done, the app should then call {@link notifySuccess}.
|
37
|
+
*
|
38
|
+
* @beta
|
39
|
+
*/
|
40
|
+
export declare function registerOnResumeHandler(handler: registerOnResumeHandlerFunctionType): void;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { ExpectedFailureReason, FailedReason, IExpectedFailureRequest, IFailedRequest, Messages } from './app';
|
1
|
+
import { ExpectedFailureReason, FailedReason, IExpectedFailureRequest, IFailedRequest, Messages } from './app/app';
|
2
2
|
/**
|
3
3
|
* @deprecated
|
4
4
|
* As of TeamsJS v2.0.0, please use {@link app.Messages} instead.
|
@@ -35,32 +35,30 @@ export interface OpenGroupChatRequest extends OpenChatRequest {
|
|
35
35
|
/**
|
36
36
|
* Contains functionality to start chat with others
|
37
37
|
*/
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
function isSupported(): boolean;
|
65
|
-
}
|
38
|
+
/**
|
39
|
+
* Allows the user to open a chat with a single user and allows
|
40
|
+
* for the user to specify the message they wish to send.
|
41
|
+
*
|
42
|
+
* @param openChatRequest: {@link OpenSingleChatRequest}- a request object that contains a user's email as well as an optional message parameter.
|
43
|
+
*
|
44
|
+
* @returns Promise resolved upon completion
|
45
|
+
*/
|
46
|
+
export declare function openChat(openChatRequest: OpenSingleChatRequest): Promise<void>;
|
47
|
+
/**
|
48
|
+
* Allows the user to create a chat with multiple users (2+) and allows
|
49
|
+
* for the user to specify a message and name the topic of the conversation. If
|
50
|
+
* only 1 user is provided into users array default back to origin openChat.
|
51
|
+
*
|
52
|
+
* @param openChatRequest: {@link OpenGroupChatRequest} - a request object that contains a list of user emails as well as optional parameters for message and topic (display name for the group chat).
|
53
|
+
*
|
54
|
+
* @returns Promise resolved upon completion
|
55
|
+
*/
|
56
|
+
export declare function openGroupChat(openChatRequest: OpenGroupChatRequest): Promise<void>;
|
57
|
+
/**
|
58
|
+
* Checks if the chat capability is supported by the host
|
59
|
+
* @returns boolean to represent whether the chat capability is supported
|
60
|
+
*
|
61
|
+
* @throws Error if {@linkcode app.initialize} has not successfully completed
|
62
|
+
*/
|
63
|
+
export declare function isSupported(): boolean;
|
66
64
|
export {};
|
@@ -0,0 +1,30 @@
|
|
1
|
+
import { AdaptiveCardDialogInfo } from '../../interfaces';
|
2
|
+
import { DialogSubmitHandler } from '../dialog';
|
3
|
+
import * as bot from './bot';
|
4
|
+
/**
|
5
|
+
* Subcapability for interacting with adaptive card dialogs
|
6
|
+
* @beta
|
7
|
+
*/
|
8
|
+
/**
|
9
|
+
* Allows app to open an adaptive card based dialog.
|
10
|
+
*
|
11
|
+
* @remarks
|
12
|
+
* This function cannot be called from inside of a dialog
|
13
|
+
*
|
14
|
+
* @param adaptiveCardDialogInfo - An object containing the parameters of the dialog module {@link AdaptiveCardDialogInfo}.
|
15
|
+
* @param submitHandler - Handler that triggers when a dialog fires an [Action.Submit](https://adaptivecards.io/explorer/Action.Submit.html) or when the user closes the dialog.
|
16
|
+
*
|
17
|
+
* @beta
|
18
|
+
*/
|
19
|
+
export declare function open(adaptiveCardDialogInfo: AdaptiveCardDialogInfo, submitHandler?: DialogSubmitHandler): void;
|
20
|
+
/**
|
21
|
+
* Checks if dialog.adaptiveCard module is supported by the host
|
22
|
+
*
|
23
|
+
* @returns boolean to represent whether dialog.adaptiveCard module is supported
|
24
|
+
*
|
25
|
+
* @throws Error if {@linkcode app.initialize} has not successfully completed
|
26
|
+
*
|
27
|
+
* @beta
|
28
|
+
*/
|
29
|
+
export declare function isSupported(): boolean;
|
30
|
+
export { bot };
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import { BotAdaptiveCardDialogInfo } from '../../interfaces';
|
2
|
+
import { DialogSubmitHandler } from '../dialog';
|
3
|
+
/**
|
4
|
+
* Module for interaction with adaptive card dialogs that need to communicate with the bot framework
|
5
|
+
*
|
6
|
+
* @beta
|
7
|
+
*/
|
8
|
+
/**
|
9
|
+
* Allows an app to open an adaptive card-based dialog module using bot.
|
10
|
+
*
|
11
|
+
* @param botAdaptiveCardDialogInfo - An object containing the parameters of the dialog module including completionBotId.
|
12
|
+
* @param submitHandler - Handler that triggers when the dialog has been submitted or closed.
|
13
|
+
*
|
14
|
+
* @beta
|
15
|
+
*/
|
16
|
+
export declare function open(botAdaptiveCardDialogInfo: BotAdaptiveCardDialogInfo, submitHandler?: DialogSubmitHandler): void;
|
17
|
+
/**
|
18
|
+
* Checks if dialog.adaptiveCard.bot capability is supported by the host
|
19
|
+
*
|
20
|
+
* @returns boolean to represent whether dialog.adaptiveCard.bot is supported
|
21
|
+
*
|
22
|
+
* @throws Error if {@linkcode app.initialize} has not successfully completed
|
23
|
+
*
|
24
|
+
* @beta
|
25
|
+
*/
|
26
|
+
export declare function isSupported(): boolean;
|
@@ -0,0 +1,69 @@
|
|
1
|
+
import * as adaptiveCard from './adaptiveCard/adaptiveCard';
|
2
|
+
import * as update from './update';
|
3
|
+
import * as url from './url/url';
|
4
|
+
/**
|
5
|
+
* This group of capabilities enables apps to show modal dialogs. There are two primary types of dialogs: URL-based dialogs and [Adaptive Card](https://learn.microsoft.com/adaptive-cards/) dialogs.
|
6
|
+
* Both types of dialogs are shown on top of your app, preventing interaction with your app while they are displayed.
|
7
|
+
* - URL-based dialogs allow you to specify a URL from which the contents will be shown inside the dialog.
|
8
|
+
* - For URL dialogs, use the functions and interfaces in the {@link url} module.
|
9
|
+
* - Adaptive Card-based dialogs allow you to provide JSON describing an Adaptive Card that will be shown inside the dialog.
|
10
|
+
* - For Adaptive Card dialogs, use the functions and interfaces in the {@link adaptiveCard} module.
|
11
|
+
*
|
12
|
+
* @remarks Note that dialogs were previously called "task modules". While they have been renamed for clarity, the functionality has been maintained.
|
13
|
+
* For more details, see [Dialogs](https://learn.microsoft.com/microsoftteams/platform/task-modules-and-cards/what-are-task-modules)
|
14
|
+
*
|
15
|
+
* @beta
|
16
|
+
*/
|
17
|
+
/**
|
18
|
+
* Data Structure to represent the SDK response when dialog closes
|
19
|
+
*
|
20
|
+
* @beta
|
21
|
+
*/
|
22
|
+
export interface ISdkResponse {
|
23
|
+
/**
|
24
|
+
* Error in case there is a failure before dialog submission
|
25
|
+
*/
|
26
|
+
err?: string;
|
27
|
+
/**
|
28
|
+
* Value provided in the `result` parameter by the dialog when the {@linkcode url.submit} function
|
29
|
+
* was called.
|
30
|
+
* If the dialog was closed by the user without submitting (e.g., using a control in the corner
|
31
|
+
* of the dialog), this value will be `undefined` here.
|
32
|
+
*/
|
33
|
+
result?: string | object;
|
34
|
+
}
|
35
|
+
/**
|
36
|
+
* Handler used to receive and process messages sent between a dialog and the app that launched it
|
37
|
+
* @beta
|
38
|
+
*/
|
39
|
+
export type PostMessageChannel = (message: any) => void;
|
40
|
+
/**
|
41
|
+
* Handler used for receiving results when a dialog closes, either the value passed by {@linkcode url.submit}
|
42
|
+
* or an error if the dialog was closed by the user.
|
43
|
+
*
|
44
|
+
* @see {@linkcode ISdkResponse}
|
45
|
+
*
|
46
|
+
* @beta
|
47
|
+
*/
|
48
|
+
export type DialogSubmitHandler = (result: ISdkResponse) => void;
|
49
|
+
/**
|
50
|
+
* @hidden
|
51
|
+
* Hide from docs because this function is only used during initialization
|
52
|
+
*
|
53
|
+
* Adds register handlers for messageForChild upon initialization and only in the tasks FrameContext. {@link FrameContexts.task}
|
54
|
+
* Function is called during app initialization
|
55
|
+
* @internal
|
56
|
+
* Limited to Microsoft-internal use
|
57
|
+
*
|
58
|
+
* @beta
|
59
|
+
*/
|
60
|
+
export declare function initialize(): void;
|
61
|
+
/**
|
62
|
+
* This function currently serves no purpose and should not be used. All functionality that used
|
63
|
+
* to be covered by this method is now in subcapabilities and those isSupported methods should be
|
64
|
+
* used directly.
|
65
|
+
*
|
66
|
+
* @hidden
|
67
|
+
*/
|
68
|
+
export declare function isSupported(): boolean;
|
69
|
+
export { adaptiveCard, url, update };
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import { DialogSize } from '../interfaces';
|
2
|
+
/**
|
3
|
+
* Module to update the dialog
|
4
|
+
*
|
5
|
+
* @beta
|
6
|
+
*/
|
7
|
+
/**
|
8
|
+
* Update dimensions - height/width of a dialog.
|
9
|
+
*
|
10
|
+
* @param dimensions - An object containing width and height properties.
|
11
|
+
*
|
12
|
+
* @beta
|
13
|
+
*/
|
14
|
+
export declare function resize(dimensions: DialogSize): void;
|
15
|
+
/**
|
16
|
+
* Checks if dialog.update capability is supported by the host
|
17
|
+
* @returns boolean to represent whether dialog.update capabilty is supported
|
18
|
+
*
|
19
|
+
* @throws Error if {@linkcode app.initialize} has not successfully completed
|
20
|
+
*
|
21
|
+
* @beta
|
22
|
+
*/
|
23
|
+
export declare function isSupported(): boolean;
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import { BotUrlDialogInfo } from '../../interfaces';
|
2
|
+
import { DialogSubmitHandler, PostMessageChannel } from '../dialog';
|
3
|
+
/**
|
4
|
+
* Module to open a dialog that sends results to the bot framework
|
5
|
+
*
|
6
|
+
* @beta
|
7
|
+
*/
|
8
|
+
/**
|
9
|
+
* Allows an app to open a dialog that sends submitted data to a bot.
|
10
|
+
*
|
11
|
+
* @param botUrlDialogInfo - An object containing the parameters of the dialog module including completionBotId.
|
12
|
+
* @param submitHandler - Handler that triggers when the dialog has been submitted or closed.
|
13
|
+
* @param messageFromChildHandler - Handler that triggers if dialog sends a message to the app.
|
14
|
+
*
|
15
|
+
* @returns a function that can be used to send messages to the dialog.
|
16
|
+
*
|
17
|
+
* @beta
|
18
|
+
*/
|
19
|
+
export declare function open(botUrlDialogInfo: BotUrlDialogInfo, submitHandler?: DialogSubmitHandler, messageFromChildHandler?: PostMessageChannel): void;
|
20
|
+
/**
|
21
|
+
* Checks if dialog.url.bot capability is supported by the host
|
22
|
+
*
|
23
|
+
* @returns boolean to represent whether dialog.url.bot is supported
|
24
|
+
*
|
25
|
+
* @throws Error if {@linkcode app.initialize} has not successfully completed
|
26
|
+
*
|
27
|
+
* @beta
|
28
|
+
*/
|
29
|
+
export declare function isSupported(): boolean;
|
@@ -0,0 +1,49 @@
|
|
1
|
+
import { PostMessageChannel } from '../dialog';
|
2
|
+
/**
|
3
|
+
* Subcapability that allows communication between the dialog and the parent app.
|
4
|
+
*
|
5
|
+
* @remarks
|
6
|
+
* Note that dialog can be invoked from parentless scenarios e.g. Search Message Extensions. The subcapability `parentCommunication` is not supported in such scenarios.
|
7
|
+
*
|
8
|
+
* @beta
|
9
|
+
*/
|
10
|
+
/**
|
11
|
+
* Send message to the parent from dialog
|
12
|
+
*
|
13
|
+
* @remarks
|
14
|
+
* This function is only intended to be called from code running within the dialog. Calling it from outside the dialog will have no effect.
|
15
|
+
*
|
16
|
+
* @param message - The message to send to the parent
|
17
|
+
*
|
18
|
+
* @beta
|
19
|
+
*/
|
20
|
+
export declare function sendMessageToParentFromDialog(message: any): void;
|
21
|
+
/**
|
22
|
+
* Send message to the dialog from the parent
|
23
|
+
*
|
24
|
+
* @param message - The message to send
|
25
|
+
*
|
26
|
+
* @beta
|
27
|
+
*/
|
28
|
+
export declare function sendMessageToDialog(message: any): void;
|
29
|
+
/**
|
30
|
+
* Register a listener that will be triggered when a message is received from the app that opened the dialog.
|
31
|
+
*
|
32
|
+
* @remarks
|
33
|
+
* This function is only intended to be called from code running within the dialog. Calling it from outside the dialog will have no effect.
|
34
|
+
*
|
35
|
+
* @param listener - The listener that will be triggered.
|
36
|
+
*
|
37
|
+
* @beta
|
38
|
+
*/
|
39
|
+
export declare function registerOnMessageFromParent(listener: PostMessageChannel): void;
|
40
|
+
/**
|
41
|
+
* Checks if dialog.url.parentCommunication capability is supported by the host
|
42
|
+
*
|
43
|
+
* @returns boolean to represent whether dialog.url.parentCommunication capability is supported
|
44
|
+
*
|
45
|
+
* @throws Error if {@linkcode app.initialize} has not successfully completed
|
46
|
+
*
|
47
|
+
* @beta
|
48
|
+
*/
|
49
|
+
export declare function isSupported(): boolean;
|
@@ -0,0 +1,60 @@
|
|
1
|
+
import { BotUrlDialogInfo, DialogInfo, UrlDialogInfo } from '../../interfaces';
|
2
|
+
import { DialogSubmitHandler, PostMessageChannel } from '../dialog';
|
3
|
+
import * as bot from './bot';
|
4
|
+
import * as parentCommunication from './parentCommunication';
|
5
|
+
/**
|
6
|
+
* Allows app to open a url based dialog.
|
7
|
+
*
|
8
|
+
* @remarks
|
9
|
+
* This function cannot be called from inside of a dialog
|
10
|
+
*
|
11
|
+
* @param urlDialogInfo - An object containing the parameters of the dialog module.
|
12
|
+
* @param submitHandler - Handler that triggers when a dialog calls the {@linkcode submit} function or when the user closes the dialog.
|
13
|
+
* @param messageFromChildHandler - Handler that triggers if dialog sends a message to the app.
|
14
|
+
*
|
15
|
+
* @beta
|
16
|
+
*/
|
17
|
+
export declare function open(urlDialogInfo: UrlDialogInfo, submitHandler?: DialogSubmitHandler, messageFromChildHandler?: PostMessageChannel): void;
|
18
|
+
/**
|
19
|
+
* Submit the dialog module and close the dialog
|
20
|
+
*
|
21
|
+
* @remarks
|
22
|
+
* This function is only intended to be called from code running within the dialog. Calling it from outside the dialog will have no effect.
|
23
|
+
*
|
24
|
+
* @param result - The result to be sent to the bot or the app. Typically a JSON object or a serialized version of it,
|
25
|
+
* If this function is called from a dialog while {@link M365ContentAction} is set in the context object by the host, result will be ignored
|
26
|
+
*
|
27
|
+
* @param appIds - 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.
|
28
|
+
*
|
29
|
+
* @beta
|
30
|
+
*/
|
31
|
+
export declare function submit(result?: string | object, appIds?: string | string[]): void;
|
32
|
+
/**
|
33
|
+
* Checks if dialog.url module is supported by the host
|
34
|
+
*
|
35
|
+
* @returns boolean to represent whether dialog.url module is supported
|
36
|
+
*
|
37
|
+
* @throws Error if {@linkcode app.initialize} has not successfully completed
|
38
|
+
*
|
39
|
+
* @beta
|
40
|
+
*/
|
41
|
+
export declare function isSupported(): boolean;
|
42
|
+
/**
|
43
|
+
* @hidden
|
44
|
+
*
|
45
|
+
* Convert UrlDialogInfo to DialogInfo to send the information to host in {@linkcode open} API.
|
46
|
+
*
|
47
|
+
* @internal
|
48
|
+
* Limited to Microsoft-internal use
|
49
|
+
*/
|
50
|
+
export declare function getDialogInfoFromUrlDialogInfo(urlDialogInfo: UrlDialogInfo): DialogInfo;
|
51
|
+
/**
|
52
|
+
* @hidden
|
53
|
+
*
|
54
|
+
* Convert BotUrlDialogInfo to DialogInfo to send the information to host in {@linkcode bot.open} API.
|
55
|
+
*
|
56
|
+
* @internal
|
57
|
+
* Limited to Microsoft-internal use
|
58
|
+
*/
|
59
|
+
export declare function getDialogInfoFromBotUrlDialogInfo(botUrlDialogInfo: BotUrlDialogInfo): DialogInfo;
|
60
|
+
export { bot, parentCommunication };
|
@@ -0,0 +1,67 @@
|
|
1
|
+
import * as map from './map';
|
2
|
+
/**
|
3
|
+
* Namespace to interact with the geoLocation module-specific part of the SDK. This is the newer version of location module.
|
4
|
+
*
|
5
|
+
* @beta
|
6
|
+
*/
|
7
|
+
/**
|
8
|
+
* Data struture to represent the location information
|
9
|
+
*
|
10
|
+
* @beta
|
11
|
+
*/
|
12
|
+
export interface Location {
|
13
|
+
/**
|
14
|
+
Latitude of the location
|
15
|
+
*/
|
16
|
+
latitude: number;
|
17
|
+
/**
|
18
|
+
Longitude of the location
|
19
|
+
*/
|
20
|
+
longitude: number;
|
21
|
+
/**
|
22
|
+
Accuracy describes the maximum distance in meters from the captured coordinates to the possible actual location
|
23
|
+
@remarks
|
24
|
+
This property is only in scope for mobile
|
25
|
+
*/
|
26
|
+
accuracy?: number;
|
27
|
+
/**
|
28
|
+
Time stamp when the location was captured
|
29
|
+
*/
|
30
|
+
timestamp?: number;
|
31
|
+
}
|
32
|
+
/**
|
33
|
+
* Fetches current user coordinates
|
34
|
+
* @returns Promise that will resolve with {@link geoLocation.Location} object or reject with an error. Function can also throw a NOT_SUPPORTED_ON_PLATFORM error
|
35
|
+
*
|
36
|
+
* @beta
|
37
|
+
*/
|
38
|
+
export declare function getCurrentLocation(): Promise<Location>;
|
39
|
+
/**
|
40
|
+
* Checks whether or not location has user permission
|
41
|
+
*
|
42
|
+
* @returns Promise that will resolve with true if the user had granted the app permission to location information, or with false otherwise,
|
43
|
+
* In case of an error, promise will reject with the error. Function can also throw a NOT_SUPPORTED_ON_PLATFORM error
|
44
|
+
*
|
45
|
+
* @beta
|
46
|
+
*/
|
47
|
+
export declare function hasPermission(): Promise<boolean>;
|
48
|
+
/**
|
49
|
+
* Requests user permission for location
|
50
|
+
*
|
51
|
+
* @returns true if the user consented permission for location, false otherwise
|
52
|
+
* @returns Promise that will resolve with true if the user consented permission for location, or with false otherwise,
|
53
|
+
* In case of an error, promise will reject with the error. Function can also throw a NOT_SUPPORTED_ON_PLATFORM error
|
54
|
+
*
|
55
|
+
* @beta
|
56
|
+
*/
|
57
|
+
export declare function requestPermission(): Promise<boolean>;
|
58
|
+
/**
|
59
|
+
* Checks if geoLocation capability is supported by the host
|
60
|
+
* @returns boolean to represent whether geoLocation is supported
|
61
|
+
*
|
62
|
+
* @throws Error if {@linkcode app.initialize} has not successfully completed
|
63
|
+
*
|
64
|
+
* @beta
|
65
|
+
*/
|
66
|
+
export declare function isSupported(): boolean;
|
67
|
+
export { map };
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import { Location } from './geoLocation';
|
2
|
+
/**
|
3
|
+
* Allows user to choose location on map
|
4
|
+
*
|
5
|
+
* @returns Promise that will resolve with {@link geoLocation.Location} object chosen by the user or reject with an error. Function can also throw a NOT_SUPPORTED_ON_PLATFORM error
|
6
|
+
*
|
7
|
+
* @beta
|
8
|
+
*/
|
9
|
+
export declare function chooseLocation(): Promise<Location>;
|
10
|
+
/**
|
11
|
+
* Shows the location on map corresponding to the given coordinates
|
12
|
+
*
|
13
|
+
* @param location - Location to be shown on the map
|
14
|
+
* @returns Promise that resolves when the location dialog has been closed or reject with an error. Function can also throw a NOT_SUPPORTED_ON_PLATFORM error
|
15
|
+
*
|
16
|
+
* @beta
|
17
|
+
*/
|
18
|
+
export declare function showLocation(location: Location): Promise<void>;
|
19
|
+
/**
|
20
|
+
* Checks if geoLocation.map capability is supported by the host
|
21
|
+
* @returns boolean to represent whether geoLocation.map is supported
|
22
|
+
*
|
23
|
+
* @throws Error if {@linkcode app.initialize} has not successfully completed
|
24
|
+
*
|
25
|
+
* @beta
|
26
|
+
*/
|
27
|
+
export declare function isSupported(): boolean;
|