@microsoft/teams-js 2.0.0 → 2.1.0-beta.2

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.
@@ -645,6 +645,66 @@ export namespace files {
645
645
  */
646
646
  extension: string;
647
647
  }
648
+ /**
649
+ * @hidden
650
+ * Hide from docs
651
+ *
652
+ * Actions specific to 3P cloud storage provider file and / or account
653
+ */
654
+ export enum CloudStorageProviderFileAction {
655
+ Download = "DOWNLOAD",
656
+ Upload = "UPLOAD",
657
+ Delete = "DELETE"
658
+ }
659
+ /**
660
+ * @hidden
661
+ * Hide from docs
662
+ *
663
+ * Interface for 3P cloud storage provider request content type
664
+ */
665
+ export interface CloudStorageProviderRequest<T> {
666
+ content: T;
667
+ }
668
+ /**
669
+ * @hidden
670
+ * Hide from docs
671
+ *
672
+ * Base interface for 3P cloud storage provider action request content
673
+ */
674
+ export interface CloudStorageProviderContent {
675
+ providerCode: CloudStorageProvider;
676
+ }
677
+ /**
678
+ * @hidden
679
+ * Hide from docs
680
+ *
681
+ * Interface representing 3P cloud storage provider add new file action.
682
+ * The file extension represents type of file e.g. docx, pptx etc. and need not be prefixed with dot(.)
683
+ */
684
+ export interface CloudStorageProviderNewFileContent extends CloudStorageProviderContent {
685
+ newFileName: string;
686
+ newFileExtension: string;
687
+ }
688
+ /**
689
+ * @hidden
690
+ * Hide from docs
691
+ *
692
+ * Interface representing 3P cloud storage provider rename existing file action
693
+ */
694
+ export interface CloudStorageProviderRenameFileContent extends CloudStorageProviderContent {
695
+ existingFile: CloudStorageFolderItem | ISharePointFile;
696
+ newFile: CloudStorageFolderItem | ISharePointFile;
697
+ }
698
+ /**
699
+ * @hidden
700
+ * Hide from docs
701
+ *
702
+ * Interface representing 3P cloud storage provider actions like Upload / Download / Delete file(s)
703
+ */
704
+ export interface CloudStorageProviderActionContent extends CloudStorageProviderContent {
705
+ action: CloudStorageProviderFileAction;
706
+ itemList: CloudStorageFolderItem[] | ISharePointFile[];
707
+ }
648
708
  /**
649
709
  * @hidden
650
710
  * Hide from docs
@@ -732,6 +792,85 @@ export namespace files {
732
792
  * @param callback Callback that will be triggered post open download folder/path
733
793
  */
734
794
  export function openDownloadFolder(fileObjectId: string, callback: (error?: SdkError) => void): void;
795
+ /**
796
+ * @hidden
797
+ * Hide from docs
798
+ *
799
+ * Initiates add 3P cloud storage provider flow, where a pop up window opens for user to select required
800
+ * 3P provider from the configured policy supported 3P provider list, following which user authentication
801
+ * for selected 3P provider is performed on success of which the selected 3P provider support is added for user
802
+ *
803
+ * @param callback Callback that will be triggered post add 3P cloud storage provider action
804
+ */
805
+ export function addCloudStorageProvider(callback: (error?: SdkError) => void): void;
806
+ /**
807
+ * @hidden
808
+ * Hide from docs
809
+ *
810
+ * Initiates signout of 3P cloud storage provider flow, which will remove the selected
811
+ * 3P cloud storage provider from the list of added providers. No other user input and / or action
812
+ * is required except the 3P cloud storage provider to signout from
813
+ *
814
+ * @param logoutRequest 3P cloud storage provider remove action request content
815
+ * @param callback Callback that will be triggered post signout of 3P cloud storage provider action
816
+ */
817
+ export function removeCloudStorageProvider(logoutRequest: CloudStorageProviderRequest<CloudStorageProviderContent>, callback: (error?: SdkError) => void): void;
818
+ /**
819
+ * @hidden
820
+ * Hide from docs
821
+ *
822
+ * Initiates the add 3P cloud storage file flow, which will add a new file for the given 3P provider
823
+ *
824
+ * @param addNewFileRequest 3P cloud storage provider add action request content
825
+ * @param callback Callback that will be triggered post adding a new file flow is finished
826
+ */
827
+ export function addCloudStorageProviderFile(addNewFileRequest: CloudStorageProviderRequest<CloudStorageProviderNewFileContent>, callback: (error?: SdkError) => void): void;
828
+ /**
829
+ * @hidden
830
+ * Hide from docs
831
+ *
832
+ * Initiates the rename 3P cloud storage file flow, which will rename an existing file in the given 3P provider
833
+ *
834
+ * @param renameFileRequest 3P cloud storage provider rename action request content
835
+ * @param callback Callback that will be triggered post renaming an existing file flow is finished
836
+ */
837
+ export function renameCloudStorageProviderFile(renameFileRequest: CloudStorageProviderRequest<CloudStorageProviderRenameFileContent>, callback: (error?: SdkError) => void): void;
838
+ /**
839
+ * @hidden
840
+ * Hide from docs
841
+ *
842
+ * Initiates the 3P cloud storage provider file action (Upload / Download / Delete) flow
843
+ *
844
+ * Upload Action : Allows uploading file(s) to the given 3P cloud storage provider
845
+ * Download Action : Allows downloading file(s) from the given 3P cloud storage provider
846
+ * Delete Action : Allows deleting file(s) from the given 3P cloud storage provider
847
+ *
848
+ * @param cloudStorageProviderFileActionRequest 3P cloud storage provider file action (Upload / Download / Delete) request content
849
+ * @param callback Callback that will be triggered post 3P cloud storage action
850
+ */
851
+ export function performCloudStorageProviderFileAction(cloudStorageProviderFileActionRequest: CloudStorageProviderRequest<CloudStorageProviderActionContent>, callback: (error?: SdkError) => void): void;
852
+ /**
853
+ * @hidden
854
+ * Hide from docs
855
+ *
856
+ * Register a handler to be called when a user's 3P cloud storage provider list changes i.e.
857
+ * post adding / removing a 3P provider, list is updated
858
+ *
859
+ * @param handler - When 3P cloud storage provider list is updated this handler is called
860
+ *
861
+ */
862
+ export function registerCloudStorageProviderListChangeHandler(handler: () => void): void;
863
+ /**
864
+ * @hidden
865
+ * Hide from docs
866
+ *
867
+ * Register a handler to be called when a user's 3P cloud storage provider content changes i.e.
868
+ * when file(s) is/are added / renamed / deleted / uploaded, the list of files is updated
869
+ *
870
+ * @param handler - When 3P cloud storage provider content is updated this handler is called
871
+ *
872
+ */
873
+ export function registerCloudStorageProviderContentChangeHandler(handler: () => void): void;
735
874
  export {};
736
875
  }
737
876
 
@@ -2174,6 +2313,9 @@ export interface BotUrlDialogInfo extends UrlDialogInfo {
2174
2313
  */
2175
2314
  completionBotId: string;
2176
2315
  }
2316
+ /**
2317
+ * Data structure to describe dialog information
2318
+ */
2177
2319
  export interface DialogInfo {
2178
2320
  /**
2179
2321
  * The url to be rendered in the webview/iframe.
@@ -4152,6 +4294,57 @@ export namespace meeting {
4152
4294
  */
4153
4295
  isSpeakingDetected: boolean;
4154
4296
  }
4297
+ /**
4298
+ * Property bag for the meeting reaction received event
4299
+ *
4300
+ * @beta
4301
+ */
4302
+ interface MeetingReactionReceivedEventData {
4303
+ /**
4304
+ * Indicates the type of meeting reaction received
4305
+ */
4306
+ meetingReactionType?: MeetingReactionType;
4307
+ /**
4308
+ * error object in case there is a failure
4309
+ */
4310
+ error?: SdkError;
4311
+ }
4312
+ /**
4313
+ * Interface for raiseHandState properties
4314
+ *
4315
+ * @beta
4316
+ */
4317
+ interface IRaiseHandState {
4318
+ /** Indicates whether the selfParticipant's hand is raised or not*/
4319
+ isHandRaised: boolean;
4320
+ }
4321
+ /**
4322
+ * Property bag for the raiseHandState changed event
4323
+ *
4324
+ * @beta
4325
+ */
4326
+ interface RaiseHandStateChangedEventData {
4327
+ /**
4328
+ * entire raiseHandState object for the selfParticipant
4329
+ */
4330
+ raiseHandState: IRaiseHandState;
4331
+ /**
4332
+ * error object in case there is a failure
4333
+ */
4334
+ error?: SdkError;
4335
+ }
4336
+ /**
4337
+ * Different types of meeting reactions that can be sent/received
4338
+ *
4339
+ * @beta
4340
+ */
4341
+ enum MeetingReactionType {
4342
+ like = "like",
4343
+ heart = "heart",
4344
+ laugh = "laugh",
4345
+ surprised = "surprised",
4346
+ applause = "applause"
4347
+ }
4155
4348
  enum MeetingType {
4156
4349
  Unknown = "Unknown",
4157
4350
  Adhoc = "Adhoc",
@@ -4289,6 +4482,26 @@ export namespace meeting {
4289
4482
  * @param handler The handler to invoke when the speaking state of any participant changes (start/stop speaking).
4290
4483
  */
4291
4484
  function registerSpeakingStateChangeHandler(handler: (speakingState: ISpeakingState) => void): void;
4485
+ /**
4486
+ * Registers a handler for changes to the selfParticipant's (current user's) raiseHandState. If the selfParticipant raises their hand, isHandRaised
4487
+ * will be true. By default and if the selfParticipant hand is lowered, isHandRaised will be false. This API will return {@link RaiseHandStateChangedEventData}
4488
+ * that will have the raiseHandState or an error object. Only one handler can be registered at a time. A subsequent registration
4489
+ * replaces an existing registration.
4490
+ *
4491
+ * @param handler The handler to invoke when the selfParticipant's (current user's) raiseHandState changes.
4492
+ *
4493
+ * @beta
4494
+ */
4495
+ function registerRaiseHandStateChangedHandler(handler: (eventData: RaiseHandStateChangedEventData) => void): void;
4496
+ /**
4497
+ * Registers a handler for receiving meeting reactions. When the selfParticipant (current user) successfully sends a meeting reaction and it is being rendered on the UI, the meetingReactionType will be populated. Only one handler can be registered
4498
+ * at a time. A subsequent registration replaces an existing registration.
4499
+ *
4500
+ * @param handler The handler to invoke when the selfParticipant (current user) successfully sends a meeting reaction
4501
+ *
4502
+ * @beta
4503
+ */
4504
+ function registerMeetingReactionReceivedHandler(handler: (eventData: MeetingReactionReceivedEventData) => void): void;
4292
4505
  }
4293
4506
 
4294
4507
  export namespace monetization {
@@ -4499,6 +4712,94 @@ export namespace people {
4499
4712
  function isSupported(): boolean;
4500
4713
  }
4501
4714
 
4715
+ /**
4716
+ * Namespace for profile related APIs.
4717
+ *
4718
+ * @beta
4719
+ */
4720
+ export namespace profile {
4721
+ /**
4722
+ * Opens a profile card at a specified position to show profile information about a persona.
4723
+ * @param showProfileRequest The parameters to position the card and identify the target user.
4724
+ * @returns Promise that will be fulfilled when the operation has completed
4725
+ */
4726
+ function showProfile(showProfileRequest: ShowProfileRequest): Promise<void>;
4727
+ /**
4728
+ * The type of modalities that are supported when showing a profile.
4729
+ * Can be provided as an optional hint with the request and will be
4730
+ * respected if the hosting M365 application supports it.
4731
+ */
4732
+ type Modality = 'Card' | 'Expanded';
4733
+ /**
4734
+ * The type of the profile trigger.
4735
+ * - MouseHover: The user hovered a target.
4736
+ * - MouseClick: The user clicked a target.
4737
+ * - KeyboardPress: The user initiated the show profile request with their keyboard.
4738
+ * - AppRequest: The show profile request is happening programmatically, without direct user interaction.
4739
+ */
4740
+ type TriggerType = 'MouseHover' | 'MouseClick' | 'KeyboardPress' | 'AppRequest';
4741
+ /**
4742
+ * The set of identifiers that are supported for resolving the persona.
4743
+ *
4744
+ * At least one is required, and if multiple are provided then only the highest
4745
+ * priority one will be used (AadObjectId > Upn > Smtp).
4746
+ */
4747
+ type PersonaIdentifiers = {
4748
+ /**
4749
+ * The object id in Azure Active Directory.
4750
+ *
4751
+ * This id is guaranteed to be unique for an object within a tenant,
4752
+ * and so if provided will lead to a more performant lookup. It can
4753
+ * be resolved via MS Graph (see https://docs.microsoft.com/en-us/graph/api/resources/users
4754
+ * for examples).
4755
+ */
4756
+ readonly AadObjectId?: string;
4757
+ /**
4758
+ * The primary SMTP address.
4759
+ */
4760
+ readonly Smtp?: string;
4761
+ /**
4762
+ * The user principle name.
4763
+ */
4764
+ readonly Upn?: string;
4765
+ };
4766
+ /**
4767
+ * The persona to show the profile for.
4768
+ */
4769
+ interface Persona {
4770
+ /**
4771
+ * The set of identifiers that are supported for resolving the persona.
4772
+ */
4773
+ identifiers: PersonaIdentifiers;
4774
+ /**
4775
+ * Optional display name override. If not specified the user's display name will be resolved normally.
4776
+ */
4777
+ displayName?: string;
4778
+ }
4779
+ /**
4780
+ * Input parameters provided to the showProfile API.
4781
+ */
4782
+ interface ShowProfileRequest {
4783
+ /**
4784
+ * An optional hint to the hosting M365 application about which modality of the profile you want to show.
4785
+ */
4786
+ modality?: Modality;
4787
+ /**
4788
+ * The information about the persona to show the profile for.
4789
+ */
4790
+ persona: Persona;
4791
+ /**
4792
+ * The bounding rectangle of the target.
4793
+ */
4794
+ targetElementBoundingRect: DOMRect;
4795
+ /**
4796
+ * Specifies which user interaction was used to trigger the API call.
4797
+ */
4798
+ triggerType: TriggerType;
4799
+ }
4800
+ function isSupported(): boolean;
4801
+ }
4802
+
4502
4803
  /**
4503
4804
  * Namespace to video extensibility of the SDK
4504
4805
  */
@@ -4691,26 +4992,40 @@ export namespace stageView {
4691
4992
  }
4692
4993
 
4693
4994
  export namespace call {
4694
- enum CallModalities {
4695
- Unknown = "unknown",
4696
- Audio = "audio",
4697
- Video = "video",
4698
- VideoBasedScreenSharing = "videoBasedScreenSharing",
4699
- Data = "data"
4700
- }
4701
- interface StartCallParams {
4702
- targets: string[];
4703
- requestedModalities?: CallModalities[];
4704
- source?: string;
4705
- }
4706
- /**
4707
- * Starts a call with other users
4708
- *
4709
- * @param startCallParams - Parameters for the call
4710
- * @returns If the call is accepted
4711
- */
4712
- function startCall(startCallParams: StartCallParams): Promise<boolean>;
4713
- function isSupported(): boolean;
4995
+ enum CallModalities {
4996
+ Unknown = "unknown",
4997
+ Audio = "audio",
4998
+ Video = "video",
4999
+ VideoBasedScreenSharing = "videoBasedScreenSharing",
5000
+ Data = "data"
5001
+ }
5002
+ interface StartCallParams {
5003
+ /**
5004
+ * Comma-separated list of user IDs representing the participants of the call.
5005
+ *
5006
+ * @remarks
5007
+ * Currently the User ID field supports the Azure AD UserPrincipalName,
5008
+ * typically an email address, or in case of a PSTN call, it supports a pstn
5009
+ * mri 4:<phonenumber>.
5010
+ */
5011
+ targets: string[];
5012
+ /**
5013
+ * List of modalities for the call. Defaults to [“audio”].
5014
+ */
5015
+ requestedModalities?: CallModalities[];
5016
+ /**
5017
+ * An optional parameter that informs about the source of the deep link
5018
+ */
5019
+ source?: string;
5020
+ }
5021
+ /**
5022
+ * Starts a call with other users
5023
+ *
5024
+ * @param startCallParams - Parameters for the call
5025
+ * @returns If the call is accepted
5026
+ */
5027
+ function startCall(startCallParams: StartCallParams): Promise<boolean>;
5028
+ function isSupported(): boolean;
4714
5029
  }
4715
5030
 
4716
5031
  /**
@@ -5089,7 +5404,7 @@ export namespace settings {
5089
5404
  function setValidityState(validityState: boolean): void;
5090
5405
  /**
5091
5406
  * @deprecated
5092
- * As of 2.0.0, please use {@link pages.config.getConfig pages.config.getConfig(): Promise\<Config\>} instead.
5407
+ * As of 2.0.0, please use {@link pages.getConfig pages.getConfig(): Promise\<InstanceConfig\>} instead.
5093
5408
  *
5094
5409
  * Gets the settings for the current instance.
5095
5410
  *
@@ -5143,9 +5458,8 @@ export namespace settings {
5143
5458
  export namespace tasks {
5144
5459
  /**
5145
5460
  * @deprecated
5146
- * As of 2.0.0, please use {@link dialog.open(urlDialogInfo: UrlDialogInfo, submitHandler?: DialogSubmitHandler, messageFromChildHandler?: PostMessageChannel): PostMessageChannel} for url based dialogs
5147
- * and {@link dialog.bot.open(botUrlDialogInfo: BotUrlDialogInfo, submitHandler?: DialogSubmitHandler, messageFromChildHandler?: PostMessageChannel): PostMessageChannel} for bot based dialogs.
5148
- *
5461
+ * As of 2.0.0, please use {@link dialog.open dialog.open(urlDialogInfo: UrlDialogInfo, submitHandler?: DialogSubmitHandler, messageFromChildHandler?: PostMessageChannel): void} for url based dialogs
5462
+ * and {@link dialog.bot.open dialog.bot.open(botUrlDialogInfo: BotUrlDialogInfo, submitHandler?: DialogSubmitHandler, messageFromChildHandler?: PostMessageChannel): void} for bot based dialogs.
5149
5463
  * Allows an app to open the task module.
5150
5464
  *
5151
5465
  * @param taskInfo - An object containing the parameters of the task module
@@ -5163,7 +5477,7 @@ export namespace tasks {
5163
5477
  function updateTask(taskInfo: TaskInfo): void;
5164
5478
  /**
5165
5479
  * @deprecated
5166
- * As of 2.0.0, please use {@link dialog.submit dialog.submit(result?: string | object, appIds?: string | string[]): void} instead.
5480
+ * As of 2.0.0, please use {@link dialog.submit} instead.
5167
5481
  *
5168
5482
  * Submit the task module.
5169
5483
  *
@@ -5171,8 +5485,24 @@ export namespace tasks {
5171
5485
  * @param appIds - Helps to validate that the call originates from the same appId as the one that invoked the task module
5172
5486
  */
5173
5487
  function submitTask(result?: string | object, appIds?: string | string[]): void;
5488
+ /**
5489
+ * Converts {@link TaskInfo} to {@link UrlDialogInfo}
5490
+ * @param taskInfo - TaskInfo object to convert
5491
+ * @returns - Converted UrlDialogInfo object
5492
+ */
5174
5493
  function getUrlDialogInfoFromTaskInfo(taskInfo: TaskInfo): UrlDialogInfo;
5494
+ /**
5495
+ * Converts {@link TaskInfo} to {@link BotUrlDialogInfo}
5496
+ * @param taskInfo - TaskInfo object to convert
5497
+ * @returns - converted BotUrlDialogInfo object
5498
+ */
5175
5499
  function getBotUrlDialogInfoFromTaskInfo(taskInfo: TaskInfo): BotUrlDialogInfo;
5500
+ /**
5501
+ * Sets the height and width of the {@link TaskInfo} object to the original height and width, if initially specified,
5502
+ * otherwise uses the height and width values corresponding to {@link TaskModuleDimension.Small}
5503
+ * @param taskInfo TaskInfo object from which to extract size info, if specified
5504
+ * @returns TaskInfo with height and width specified
5505
+ */
5176
5506
  function getDefaultSizeIfNotProvided(taskInfo: TaskInfo): TaskInfo;
5177
5507
  }
5178
5508