@microsoft/teams-js 2.0.0-beta.4-dev.19 → 2.0.0-beta.4-dev.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,94 +1,5 @@
1
1
  // Generated by dts-bundle v0.7.3
2
2
 
3
- /**
4
- * @hidden
5
- * Namespace to interact with bots using the SDK.
6
- *
7
- * @alpha
8
- */
9
- export namespace bot {
10
- /**
11
- * @hidden
12
- * Hide from docs until release.
13
- * ------
14
- * Sends query to bot in order to retrieve data.
15
- *
16
- * @param botRequest - query to send to bot.
17
- * @param onSuccess - callback to invoke when data is retrieved from bot
18
- * @param onError - callback to invoke should an error occur
19
- */
20
- export function sendQuery(botRequest: QueryRequest, onSuccess?: (data: QueryResponse) => void, onError?: (error: string) => void): void;
21
- /**
22
- * @hidden
23
- * Hide from docs until release.
24
- * -----
25
- * Retrieves list of support commands from bot
26
- *
27
- * @param onSuccess - callback to invoke when data is retrieved from bot
28
- * @param onError - callback to invoke should an error occur
29
- */
30
- export function getSupportedCommands(onSuccess?: (response: Command[]) => void, onError?: (error: string) => void): void;
31
- /**
32
- * @hidden
33
- * Hide from docs until release.
34
- * -----
35
- * Authenticates a user for json tab
36
- *
37
- * @param authRequest - callback to invoke when data is retrieved from bot
38
- * @param onSuccess - callback to invoke when user is authenticated
39
- * @param onError - callback to invoke should an error occur
40
- */
41
- export function authenticate(authRequest: AuthQueryRequest, onSuccess?: (results: Results) => void, onError?: (error: string) => void): void;
42
- export interface QueryRequest {
43
- /**
44
- * @hidden
45
- * Query to search for
46
- */
47
- query: string;
48
- commandId?: string;
49
- option?: {
50
- skip: number;
51
- count: number;
52
- };
53
- }
54
- export interface Results {
55
- attachments: Attachment[];
56
- layout: any;
57
- botId: string;
58
- }
59
- export interface Auth {
60
- url: string;
61
- title: string;
62
- }
63
- export type ResponseType = 'Results' | 'Auth';
64
- interface Response<T extends ResponseType> {
65
- type: T;
66
- }
67
- export interface ResultResponse extends Response<'Results'> {
68
- data: Results;
69
- }
70
- export interface AuthResponse extends Response<'Auth'> {
71
- data: Auth;
72
- }
73
- export type QueryResponse = ResultResponse | AuthResponse;
74
- export interface AuthQueryRequest extends QueryRequest {
75
- url: string;
76
- }
77
- export interface Attachment {
78
- card: any;
79
- previewCard: any;
80
- previewRawPayload: any;
81
- rawPayload: any;
82
- }
83
- export interface Command {
84
- title: string;
85
- id: string;
86
- initialRun: boolean;
87
- }
88
- export function isSupported(): boolean;
89
- export {};
90
- }
91
-
92
3
  /**
93
4
  * @hidden
94
5
  * Namespace to interact with the logging part of the SDK.
@@ -351,50 +262,6 @@ export function registerCustomHandler(actionName: string, customHandler: (...arg
351
262
  */
352
263
  export function registerUserSettingsChangeHandler(settingTypes: UserSettingTypes[], handler: (settingType: UserSettingTypes, value: any) => void): void;
353
264
 
354
- /**
355
- *
356
- * @internal
357
- */
358
- interface OpenChatRequest {
359
- /**
360
- * @hidden
361
- * The message to send when opening chat
362
- */
363
- message?: string;
364
- }
365
- /**
366
- * @hidden
367
- * Hide from docs.
368
- * ------
369
- *
370
- * @internal
371
- */
372
- export interface OpenSingleChatRequest extends OpenChatRequest {
373
- /**
374
- * @hidden
375
- * User's UPN to open chat with
376
- */
377
- user: string;
378
- }
379
- /**
380
- * @hidden
381
- * Hide from docs.
382
- * ------
383
- *
384
- * @internal
385
- */
386
- export interface OpenGroupChatRequest extends OpenChatRequest {
387
- /**
388
- * @hidden
389
- * Array containing UPNs of users to open chat with
390
- */
391
- users: string[];
392
- /**
393
- * @hidden
394
- * The display name of a conversation for 3 or more users
395
- */
396
- topic?: string;
397
- }
398
265
  /**
399
266
  * @hidden
400
267
  * Hide from docs.
@@ -474,32 +341,23 @@ export interface ConversationResponse {
474
341
  *
475
342
  * @alpha
476
343
  */
477
- export namespace chat {
344
+ export namespace conversation {
478
345
  /**
479
346
  * @hidden
480
347
  * Hide from docs
481
348
  * --------------
482
- * Allows the user to open a chat with a single user and allows
483
- * for the user to specify the message they wish to send.
484
- *
485
- *@param openChatRequest: {@link OpenSingleChatRequest}- a request object that contains a user's email as well as an optional message parameter.
349
+ * Allows the user to start or continue a conversation with each subentity inside the tab
486
350
  *
487
351
  * @returns Promise resolved upon completion
488
352
  */
489
- function openChat(openChatRequest: OpenSingleChatRequest): Promise<void>;
353
+ function openConversation(openConversationRequest: OpenConversationRequest): Promise<void>;
490
354
  /**
491
355
  * @hidden
492
356
  * Hide from docs
493
357
  * --------------
494
- * Allows the user to create a chat with multiple users (2+) and allows
495
- * for the user to specify a message and name the topic of the conversation. If
496
- * only 1 user is provided into users array default back to origin openChat.
497
- *
498
- * @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).
499
- *
500
- * @returns Promise resolved upon completion
358
+ * Allows the user to close the conversation in the right pane
501
359
  */
502
- function openGroupChat(openChatRequest: OpenGroupChatRequest): Promise<void>;
360
+ function closeConversation(): void;
503
361
  /**
504
362
  * @hidden
505
363
  * Hide from docs
@@ -514,27 +372,7 @@ export namespace chat {
514
372
  */
515
373
  function getChatMembers(): Promise<ChatMembersInformation>;
516
374
  function isSupported(): boolean;
517
- namespace conversation {
518
- /**
519
- * @hidden
520
- * Hide from docs
521
- * --------------
522
- * Allows the user to start or continue a conversation with each subentity inside the tab
523
- *
524
- * @returns Promise resolved upon completion
525
- */
526
- function openConversation(openConversationRequest: OpenConversationRequest): Promise<void>;
527
- /**
528
- * @hidden
529
- * Hide from docs
530
- * --------------
531
- * Allows the user to close the conversation in the right pane
532
- */
533
- function closeConversation(): void;
534
- function isSupported(): boolean;
535
- }
536
375
  }
537
- export {};
538
376
 
539
377
  /**
540
378
  * @hidden
@@ -911,10 +749,12 @@ export namespace files {
911
749
  /**
912
750
  * @hidden
913
751
  * Hide from docs
914
- * ------
915
- * Open download preference folder
752
+ *
753
+ * Open download preference folder if fileObjectId value is undefined else open folder containing the file with id fileObjectId
754
+ * @param fileObjectId Id of the file whose containing folder should be opened
755
+ * @param callback Callback that will be triggered post open download folder/path
916
756
  */
917
- export function openDownloadFolder(): void;
757
+ export function openDownloadFolder(fileObjectId: string, callback: (error?: SdkError) => void): void;
918
758
  export {};
919
759
  }
920
760
 
@@ -923,16 +763,19 @@ export namespace files {
923
763
  */
924
764
  export namespace legacy {
925
765
  namespace fullTrust {
926
- /**
927
- * @hidden
928
- * Hide from docs
929
- * ------
930
- * Allows an app to retrieve information of all user joined teams
931
- *
932
- * @param teamInstanceParameters - OPTIONAL Flags that specify whether to scope call to favorite teams
933
- * @returns Promise resolved containing information about the user joined teams or rejected with error
934
- */
935
- function getUserJoinedTeams(teamInstanceParameters?: TeamInstanceParameters): Promise<UserJoinedTeamsInformation>;
766
+ namespace joinedTeams {
767
+ /**
768
+ * @hidden
769
+ * Hide from docs
770
+ * ------
771
+ * Allows an app to retrieve information of all user joined teams
772
+ *
773
+ * @param teamInstanceParameters - OPTIONAL Flags that specify whether to scope call to favorite teams
774
+ * @returns Promise resolved containing information about the user joined teams or rejected with error
775
+ */
776
+ function getUserJoinedTeams(teamInstanceParameters?: TeamInstanceParameters): Promise<UserJoinedTeamsInformation>;
777
+ function isSupported(): boolean;
778
+ }
936
779
  /**
937
780
  * @hidden
938
781
  * Hide from docs
@@ -995,7 +838,7 @@ export namespace meetingRoom {
995
838
  * ------
996
839
  * Types of Stage Layout control capabilities of a meeting room.
997
840
  */
998
- type StageLayoutControls = 'showVideoGallery' | 'showContent' | 'showContent' | 'showVideoGalleryAndContent' | 'showLargeGallery' | 'showTogether';
841
+ type StageLayoutControls = 'showVideoGallery' | 'showContent' | 'showVideoGalleryAndContent' | 'showLargeGallery' | 'showTogether';
999
842
  /**
1000
843
  * @hidden
1001
844
  * Hide from docs
@@ -2122,8 +1965,8 @@ export interface Context {
2122
1965
  hostName?: HostName;
2123
1966
  /**
2124
1967
  * @hidden
2125
- * The type of the host client. Possible values are : android, ios, web, desktop, rigel (deprecated, use teamsRoomsWindows instead),
2126
- * teamsRoomsWindows, teamsRoomsAndroid, teamsPhones, teamsDisplays
1968
+ * The type of the host client. Possible values are : android, ios, web, desktop, rigel(deprecated, use teamsRoomsWindows instead),
1969
+ * surfaceHub, teamsRoomsWindows, teamsRoomsAndroid, teamsPhones, teamsDisplays
2127
1970
  */
2128
1971
  hostClientType?: HostClientType;
2129
1972
  /**
@@ -2254,6 +2097,9 @@ export interface DeepLinkParameters {
2254
2097
  */
2255
2098
  subEntityWebUrl?: string;
2256
2099
  }
2100
+ /**
2101
+ * Data structure to represent the size of a dialog
2102
+ */
2257
2103
  export interface DialogSize {
2258
2104
  /**
2259
2105
  * The requested height of the webview/iframe.
@@ -2264,6 +2110,9 @@ export interface DialogSize {
2264
2110
  */
2265
2111
  width: DialogDimension | number;
2266
2112
  }
2113
+ /**
2114
+ * Data structure to describe dialog information needed to open a url based dialog.
2115
+ */
2267
2116
  export interface UrlDialogInfo {
2268
2117
  /**
2269
2118
  * The url to be rendered in the webview/iframe.
@@ -2279,6 +2128,9 @@ export interface UrlDialogInfo {
2279
2128
  */
2280
2129
  fallbackUrl?: string;
2281
2130
  }
2131
+ /**
2132
+ * Data structure to describe dialog information needed to open a bot based dialog.
2133
+ */
2282
2134
  export interface BotUrlDialogInfo extends UrlDialogInfo {
2283
2135
  /**
2284
2136
  * Specifies a bot ID to send the result of the user's interaction with the task module.
@@ -2851,25 +2703,105 @@ export namespace appInstallDialog {
2851
2703
  }
2852
2704
 
2853
2705
  /**
2854
- * Namespace to interact with the dialog module-specific part of the SDK.
2706
+ * Describes information needed to start a chat
2855
2707
  *
2856
- * @remarks
2857
- * This object is usable only on the content frame.
2708
+ * @beta
2709
+ */
2710
+ interface OpenChatRequest {
2711
+ /**
2712
+ * An optional message used when initiating chat
2713
+ */
2714
+ message?: string;
2715
+ }
2716
+ /**
2717
+ * Used when starting a chat with one person
2718
+ *
2719
+ * @see OpenGroupChatRequest for use when a chat with more than one person
2858
2720
  *
2859
2721
  * @beta
2860
2722
  */
2861
- export interface SdkResponse {
2862
- err?: string;
2863
- result?: string | object;
2723
+ export interface OpenSingleChatRequest extends OpenChatRequest {
2724
+ /**
2725
+ * The Azure Active Directory UPN (e-mail address) of the user to chat with
2726
+ */
2727
+ user: string;
2728
+ }
2729
+ /**
2730
+ * Used when starting a chat with more than one person
2731
+ *
2732
+ * @see OpenSingleChatRequest for use in a chat with only one person
2733
+ *
2734
+ * @beta
2735
+ */
2736
+ export interface OpenGroupChatRequest extends OpenChatRequest {
2737
+ /**
2738
+ * Array containing Azure Active Directory UPNs (e-mail addresss) of users to open chat with
2739
+ */
2740
+ users: string[];
2741
+ /**
2742
+ * The display name of a conversation for 3 or more users (chats with fewer than three users will ignore this field)
2743
+ */
2744
+ topic?: string;
2745
+ }
2746
+ /**
2747
+ * Contains functionality to start chat with others
2748
+ *
2749
+ * @beta
2750
+ */
2751
+ export namespace chat {
2752
+ /**
2753
+ * Allows the user to open a chat with a single user and allows
2754
+ * for the user to specify the message they wish to send.
2755
+ *
2756
+ * @param openChatRequest: {@link OpenSingleChatRequest}- a request object that contains a user's email as well as an optional message parameter.
2757
+ *
2758
+ * @returns Promise resolved upon completion
2759
+ */
2760
+ function openChat(openChatRequest: OpenSingleChatRequest): Promise<void>;
2761
+ /**
2762
+ * Allows the user to create a chat with multiple users (2+) and allows
2763
+ * for the user to specify a message and name the topic of the conversation. If
2764
+ * only 1 user is provided into users array default back to origin openChat.
2765
+ *
2766
+ * @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).
2767
+ *
2768
+ * @returns Promise resolved upon completion
2769
+ */
2770
+ function openGroupChat(openChatRequest: OpenGroupChatRequest): Promise<void>;
2771
+ function isSupported(): boolean;
2864
2772
  }
2773
+ export {};
2774
+
2775
+ /**
2776
+ * Namespace to interact with the dialog module-specific part of the SDK.
2777
+ *
2778
+ * @beta
2779
+ */
2865
2780
  export namespace dialog {
2781
+ /**
2782
+ * Data Structure to represent the SDK response when dialog closes
2783
+ */
2784
+ interface ISdkResponse {
2785
+ /**
2786
+ * Error in case there is a failure before dialog submission
2787
+ */
2788
+ err?: string;
2789
+ /**
2790
+ * Result value that the dialog is submitted with using {@linkcode submit} function
2791
+ *
2792
+ */
2793
+ result?: string | object;
2794
+ }
2866
2795
  type PostMessageChannel = (message: any) => void;
2867
- type DialogSubmitHandler = (result: SdkResponse) => void;
2796
+ type DialogSubmitHandler = (result: ISdkResponse) => void;
2868
2797
  /**
2869
- * Allows an app to open the dialog module.
2798
+ * Allows app to open a url based dialog.
2799
+ *
2800
+ * @remarks
2801
+ * This function cannot be called from inside of a dialog
2870
2802
  *
2871
2803
  * @param urlDialogInfo - An object containing the parameters of the dialog module.
2872
- * @param submitHandler - This Handler is called when the dialog has been submitted or closed.
2804
+ * @param submitHandler - Handler that triggers when a dialog calls the {@linkcode submit} function or when the user closes the dialog.
2873
2805
  * @param messageFromChildHandler - Handler that triggers if dialog sends a message to the app.
2874
2806
  *
2875
2807
  * @returns a function that can be used to send messages to the dialog.
@@ -2878,24 +2810,37 @@ export namespace dialog {
2878
2810
  /**
2879
2811
  * Submit the dialog module.
2880
2812
  *
2881
- * @param result - Contains the result to be sent to the bot or the app. Typically a JSON object or a serialized version of it
2813
+ * @param result - The result to be sent to the bot or the app. Typically a JSON object or a serialized version of it
2882
2814
  * @param appIds - Helps to validate that the call originates from the same appId as the one that invoked the task module
2883
2815
  */
2884
2816
  function submit(result?: string | object, appIds?: string | string[]): void;
2885
2817
  /**
2886
2818
  * Send message to the parent from dialog
2887
2819
  *
2888
- * @param message - The message to send
2820
+ * @remarks
2821
+ * This function is only called from inside of a dialog
2822
+ *
2823
+ * @param message - The message to send to the parent
2889
2824
  */
2890
2825
  function sendMessageToParentFromDialog(message: any): void;
2891
2826
  /**
2892
- * Fucntion to call when an event is received from the Parent
2827
+ * Register a listener that will be triggered when a message is received from the app that opened the dialog.
2893
2828
  *
2894
- * @param type - The event to listen to. Currently the only supported type is 'message'.
2895
- * @param listener - listener - The listener that will be called.
2829
+ * @remarks
2830
+ * This function is only called from inside of a dialog.
2831
+ *
2832
+ * @param listener - The listener that will be triggered.
2833
+ */
2834
+ function registerOnMessageFromParent(listener: PostMessageChannel): void;
2835
+ /**
2836
+ * Checks if dialog module is supported by the host
2837
+ *
2838
+ * @returns boolean to represent whether dialog module is supported
2896
2839
  */
2897
- function registerOnMessageFromParent(listener: (message: any) => void): void;
2898
2840
  function isSupported(): boolean;
2841
+ /**
2842
+ * Namespace to update the dialog
2843
+ */
2899
2844
  namespace update {
2900
2845
  /**
2901
2846
  * Update dimensions - height/width of a dialog.
@@ -2903,10 +2848,32 @@ export namespace dialog {
2903
2848
  * @param dimensions - An object containing width and height properties.
2904
2849
  */
2905
2850
  function resize(dimensions: DialogSize): void;
2851
+ /**
2852
+ * Checks if dialog.update capability is supported by the host
2853
+ *
2854
+ * @returns boolean to represent whether dialog.update is supported
2855
+ */
2906
2856
  function isSupported(): boolean;
2907
2857
  }
2858
+ /**
2859
+ * Namespace to open a dialog that sends results to the bot framework
2860
+ */
2908
2861
  namespace bot {
2862
+ /**
2863
+ * Allows an app to open the dialog module using bot.
2864
+ *
2865
+ * @param botUrlDialogInfo - An object containing the parameters of the dialog module including completionBotId.
2866
+ * @param submitHandler - Handler that triggers when the dialog has been submitted or closed.
2867
+ * @param messageFromChildHandler - Handler that triggers if dialog sends a message to the app.
2868
+ *
2869
+ * @returns a function that can be used to send messages to the dialog.
2870
+ */
2909
2871
  function open(botUrlDialogInfo: BotUrlDialogInfo, submitHandler?: DialogSubmitHandler, messageFromChildHandler?: PostMessageChannel): PostMessageChannel;
2872
+ /**
2873
+ * Checks if dialog.bot capability is supported by the host
2874
+ *
2875
+ * @returns boolean to represent whether dialog.bot is supported
2876
+ */
2910
2877
  function isSupported(): boolean;
2911
2878
  }
2912
2879
  }
@@ -4047,6 +4014,13 @@ export namespace meeting {
4047
4014
  */
4048
4015
  isAppSharing: boolean;
4049
4016
  }
4017
+ interface ISpeakingState {
4018
+ /**
4019
+ * Indicates whether one or more participants in a meeting are speaking, or
4020
+ * if no participants are speaking
4021
+ */
4022
+ isSpeakingDetected: boolean;
4023
+ }
4050
4024
  interface IAppContentStageSharingCapabilities {
4051
4025
  /**
4052
4026
  * indicates whether app has permission to share contents to meeting stage
@@ -4301,6 +4275,13 @@ export namespace meeting {
4301
4275
  * (indication of successful retrieval), or null (indication of failed retrieval)
4302
4276
  */
4303
4277
  function getAppContentStageSharingState(callback: (error: SdkError | null, appContentStageSharingState: IAppContentStageSharingState | null) => void): void;
4278
+ /**
4279
+ * Registers a handler for changes to paticipant speaking states. If any participant is speaking, isSpeakingDetected
4280
+ * will be true. If no participants are speaking, isSpeakingDetected will be false. Only one handler can be registered
4281
+ * at a time. A subsequent registration replaces an existing registration.
4282
+ * @param handler The handler to invoke when the speaking state of any participant changes (start/stop speaking).
4283
+ */
4284
+ function registerSpeakingStateChangeHandler(handler: (speakingState: ISpeakingState) => void): void;
4304
4285
  }
4305
4286
 
4306
4287
  /**
@@ -5172,7 +5153,8 @@ export namespace settings {
5172
5153
  export namespace tasks {
5173
5154
  /**
5174
5155
  * @deprecated
5175
- * As of 2.0.0-beta.4, please use {@link dialog.open(dialogInfo: DialogInfo, submitHandler?: DialogSubmitHandler, messageFromChildHandler?: PostMessageChannel): PostMessageChannel} instead.
5156
+ * As of 2.0.0-beta.4, please use {@link dialog.open(urlDialogInfo: UrlDialogInfo, submitHandler?: DialogSubmitHandler, messageFromChildHandler?: PostMessageChannel): PostMessageChannel} for url based dialogs
5157
+ * and {@link dialog.bot.open(botUrlDialogInfo: BotUrlDialogInfo, submitHandler?: DialogSubmitHandler, messageFromChildHandler?: PostMessageChannel): PostMessageChannel} for bot based dialogs.
5176
5158
  *
5177
5159
  * Allows an app to open the task module.
5178
5160
  *