@microsoft/teams-js 2.8.0-beta.0 → 2.8.0

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.
package/README.md CHANGED
@@ -24,7 +24,7 @@ To install the stable [version](https://learn.microsoft.com/javascript/api/overv
24
24
 
25
25
  ### Production
26
26
 
27
- You can reference these files directly [from here](https://res.cdn.office.net/teams-js/2.7.1/js/MicrosoftTeams.min.js) or point your package manager at them.
27
+ You can reference these files directly [from here](https://res.cdn.office.net/teams-js/2.8.0/js/MicrosoftTeams.min.js) or point your package manager at them.
28
28
 
29
29
  ## Usage
30
30
 
@@ -45,13 +45,13 @@ Reference the library inside of your `.html` page using:
45
45
  ```html
46
46
  <!-- Microsoft Teams JavaScript API (via CDN) -->
47
47
  <script
48
- src="https://res.cdn.office.net/teams-js/2.7.1/js/MicrosoftTeams.min.js"
49
- integrity="sha384-4Gy2G+qxzDVdrdemcVqKVQvaSK1Ghg3x6xcsaMLPc/pw7KPtiogHGM97LTWF2PWg"
48
+ src="https://res.cdn.office.net/teams-js/2.8.0/js/MicrosoftTeams.min.js"
49
+ integrity="sha384-/DJ9oJEFZSpGiUQx9Na5Yb5svOPPqSb3khKxJ/YgoZ2GtrkzWgSTBpESy3LvMPVk"
50
50
  crossorigin="anonymous"
51
51
  ></script>
52
52
 
53
53
  <!-- Microsoft Teams JavaScript API (via npm) -->
54
- <script src="node_modules/@microsoft/teams-js@2.7.1/dist/MicrosoftTeams.min.js"></script>
54
+ <script src="node_modules/@microsoft/teams-js@2.8.0/dist/MicrosoftTeams.min.js"></script>
55
55
 
56
56
  <!-- Microsoft Teams JavaScript API (via local) -->
57
57
  <script src="MicrosoftTeams.min.js"></script>
@@ -3367,7 +3367,7 @@ export interface UrlDialogInfo extends BaseDialogInfo {
3367
3367
  *
3368
3368
  * @remarks
3369
3369
  * The domain of the url must match at least one of the
3370
- * valid domains specified in the validDomains block of the manifest
3370
+ * valid domains specified in the [validDomains block](https://learn.microsoft.com/microsoftteams/platform/resources/schema/manifest-schema#validdomains) of the app manifest
3371
3371
  */
3372
3372
  url: string;
3373
3373
  /**
@@ -3435,19 +3435,15 @@ export interface DialogSize {
3435
3435
  width: DialogDimension | number;
3436
3436
  }
3437
3437
  /**
3438
- * @hidden
3439
- *
3440
- * @internal
3441
- * Limited to Microsoft-internal use
3438
+ * @beta
3439
+ * Data structure to be used with the {@link teamsCore.registerOnLoadHandler teamsCore.registerOnLoadHandler(handler: (context: LoadContext) => void): void} to pass the context to the app.
3442
3440
  */
3443
3441
  export interface LoadContext {
3444
3442
  /**
3445
- * @hidden
3446
3443
  * The entity that is requested to be loaded
3447
3444
  */
3448
3445
  entityId: string;
3449
3446
  /**
3450
- * @hidden
3451
3447
  * The content URL that is requested to be loaded
3452
3448
  */
3453
3449
  contentUrl: string;
@@ -3850,7 +3846,8 @@ export namespace app {
3850
3846
  */
3851
3847
  isPSTNCallingAllowed?: boolean;
3852
3848
  /**
3853
- * The license type for the current user.
3849
+ * The license type for the current user. Possible values are:
3850
+ * "Unknown", "Teacher", "Student", "Free", "SmbBusinessVoice", "SmbNonVoice", "FrontlineWorker"
3854
3851
  */
3855
3852
  licenseType?: string;
3856
3853
  /**
@@ -3950,7 +3947,7 @@ export namespace app {
3950
3947
  */
3951
3948
  meeting?: MeetingInfo;
3952
3949
  /**
3953
- * When hosted in SharePoint, this is the [SharePoint PageContext](https://learn.microsoft.com/en-us/javascript/api/sp-page-context/pagecontext?view=sp-typescript-latest), else `undefined`
3950
+ * When hosted in SharePoint, this is the [SharePoint PageContext](https://learn.microsoft.com/javascript/api/sp-page-context/pagecontext?view=sp-typescript-latest), else `undefined`
3954
3951
  */
3955
3952
  sharepoint?: any;
3956
3953
  /**
@@ -4215,7 +4212,7 @@ export namespace dialog {
4215
4212
  */
4216
4213
  err?: string;
4217
4214
  /**
4218
- * Value provided in the `result` parameter by the dialog when the {@linkcode submit} function
4215
+ * Value provided in the `result` parameter by the dialog when the {@linkcode url.submit} function
4219
4216
  * was called.
4220
4217
  * If the dialog was closed by the user without submitting (e.g., using a control in the corner
4221
4218
  * of the dialog), this value will be `undefined` here.
@@ -4228,7 +4225,7 @@ export namespace dialog {
4228
4225
  */
4229
4226
  type PostMessageChannel = (message: any) => void;
4230
4227
  /**
4231
- * Handler used for receiving results when a dialog closes, either the value passed by {@linkcode submit}
4228
+ * Handler used for receiving results when a dialog closes, either the value passed by {@linkcode url.submit}
4232
4229
  * or an error if the dialog was closed by the user.
4233
4230
  * @beta
4234
4231
  */
@@ -4262,6 +4259,9 @@ export namespace dialog {
4262
4259
  /**
4263
4260
  * Submit the dialog module and close the dialog
4264
4261
  *
4262
+ * @remarks
4263
+ * This function is only intended to be called from code running within the dialog. Calling it from outside the dialog will have no effect.
4264
+ *
4265
4265
  * @param result - The result to be sent to the bot or the app. Typically a JSON object or a serialized version of it,
4266
4266
  * If this function is called from a dialog while {@link M365ContentAction} is set in the context object by the host, result will be ignored
4267
4267
  *
@@ -4273,8 +4273,8 @@ export namespace dialog {
4273
4273
  /**
4274
4274
  * Send message to the parent from dialog
4275
4275
  *
4276
- * @remarks
4277
- * This function is only called from inside of a dialog
4276
+ * @remarks
4277
+ * This function is only intended to be called from code running within the dialog. Calling it from outside the dialog will have no effect.
4278
4278
  *
4279
4279
  * @param message - The message to send to the parent
4280
4280
  *
@@ -4293,7 +4293,7 @@ export namespace dialog {
4293
4293
  * Register a listener that will be triggered when a message is received from the app that opened the dialog.
4294
4294
  *
4295
4295
  * @remarks
4296
- * This function is only called from inside of a dialog.
4296
+ * This function is only intended to be called from code running within the dialog. Calling it from outside the dialog will have no effect.
4297
4297
  *
4298
4298
  * @param listener - The listener that will be triggered.
4299
4299
  *
@@ -4405,7 +4405,7 @@ export namespace dialog {
4405
4405
  * This function cannot be called from inside of a dialog
4406
4406
  *
4407
4407
  * @param adaptiveCardDialogInfo - An object containing the parameters of the dialog module {@link AdaptiveCardDialogInfo}.
4408
- * @param submitHandler - Handler that triggers when a dialog calls the {@linkcode submit} function or when the user closes the dialog.
4408
+ * @param submitHandler - Handler that triggers when a dialog calls the {@linkcode url.submit} function or when the user closes the dialog.
4409
4409
  *
4410
4410
  * @beta
4411
4411
  */
@@ -4583,7 +4583,7 @@ export namespace geoLocation {
4583
4583
  }
4584
4584
 
4585
4585
  /**
4586
- * @returns The {@linkcode: AdaptiveCardVersion} representing the Adaptive Card schema
4586
+ * @returns The {@linkcode AdaptiveCardVersion} representing the Adaptive Card schema
4587
4587
  * version supported by the host, or undefined if the host does not support Adaptive Cards
4588
4588
  */
4589
4589
  export function getAdaptiveCardSchemaVersion(): AdaptiveCardVersion | undefined;
@@ -4994,7 +4994,7 @@ export namespace pages {
4994
4994
  interface NavigateWithinAppParams {
4995
4995
  /**
4996
4996
  * The developer-defined unique ID for the page defined in the manifest or when first configuring
4997
- * the page. (Known as {entityId} prior to TeamsJS v.2.0.0)
4997
+ * the page. (Known as {@linkcode Context.entityId} prior to TeamsJS v.2.0.0)
4998
4998
  */
4999
4999
  pageId: string;
5000
5000
  /**
@@ -5850,45 +5850,126 @@ export namespace meeting {
5850
5850
  /**
5851
5851
  * Property bag for the meeting reaction received event
5852
5852
  *
5853
+ * @hidden
5854
+ * Hide from docs.
5855
+ *
5856
+ * @internal
5857
+ * Limited to Microsoft-internal use
5858
+ *
5853
5859
  * @beta
5854
5860
  */
5855
5861
  interface MeetingReactionReceivedEventData {
5856
5862
  /**
5857
5863
  * Indicates the type of meeting reaction received
5864
+ *
5865
+ * @hidden
5866
+ * Hide from docs.
5858
5867
  */
5859
5868
  meetingReactionType?: MeetingReactionType;
5860
5869
  /**
5861
5870
  * error object in case there is a failure
5871
+ *
5872
+ * @hidden
5873
+ * Hide from docs.
5862
5874
  */
5863
5875
  error?: SdkError;
5864
5876
  }
5865
5877
  /**
5866
5878
  * Interface for raiseHandState properties
5867
5879
  *
5880
+ * @hidden
5881
+ * Hide from docs.
5882
+ *
5883
+ * @internal
5884
+ * Limited to Microsoft-internal use
5885
+ *
5868
5886
  * @beta
5869
5887
  */
5870
5888
  interface IRaiseHandState {
5871
- /** Indicates whether the selfParticipant's hand is raised or not*/
5889
+ /** Indicates whether the selfParticipant's hand is raised or not
5890
+ *
5891
+ * @hidden
5892
+ * Hide from docs.
5893
+ */
5872
5894
  isHandRaised: boolean;
5873
5895
  }
5874
5896
  /**
5875
5897
  * Property bag for the raiseHandState changed event
5876
5898
  *
5899
+ * @hidden
5900
+ * Hide from docs.
5901
+ *
5902
+ * @internal
5903
+ * Limited to Microsoft-internal use
5904
+ *
5877
5905
  * @beta
5878
5906
  */
5879
5907
  interface RaiseHandStateChangedEventData {
5880
5908
  /**
5881
5909
  * entire raiseHandState object for the selfParticipant
5910
+ *
5911
+ * @hidden
5912
+ * Hide from docs.
5882
5913
  */
5883
5914
  raiseHandState: IRaiseHandState;
5884
5915
  /**
5885
5916
  * error object in case there is a failure
5917
+ *
5918
+ * @hidden
5919
+ * Hide from docs.
5886
5920
  */
5887
5921
  error?: SdkError;
5888
5922
  }
5923
+ /**
5924
+ * Interface for mic state change
5925
+ *
5926
+ * @hidden
5927
+ * Hide from docs.
5928
+ *
5929
+ * @internal
5930
+ * Limited to Microsoft-internal use
5931
+ *
5932
+ * @beta
5933
+ */
5934
+ interface MicState {
5935
+ /**
5936
+ * Indicates the mute status of the mic
5937
+ */
5938
+ isMicMuted: boolean;
5939
+ }
5940
+ /**
5941
+ * Interface for RequestAppAudioHandling properties
5942
+ *
5943
+ * @hidden
5944
+ * Hide from docs.
5945
+ *
5946
+ * @internal
5947
+ * Limited to Microsoft-internal use
5948
+ *
5949
+ * @beta
5950
+ */
5951
+ interface RequestAppAudioHandlingParams {
5952
+ /**
5953
+ * Indicates whether the app is requesting to start handling audio, or if
5954
+ * it's giving audio back to the host
5955
+ */
5956
+ isAppHandlingAudio: boolean;
5957
+ /**
5958
+ * Callback for the host to tell the app to change its microphone state
5959
+ * @param micState The microphone state for the app to use
5960
+ * @returns A promise with the updated microphone state
5961
+ */
5962
+ micMuteStateChangedCallback: (micState: MicState) => Promise<MicState>;
5963
+ }
5889
5964
  /**
5890
5965
  * Different types of meeting reactions that can be sent/received
5891
5966
  *
5967
+ * @hidden
5968
+ * Hide from docs.
5969
+ *
5970
+ * @internal
5971
+ * Limited to Microsoft-internal use
5972
+ *
5892
5973
  * @beta
5893
5974
  */
5894
5975
  enum MeetingReactionType {
@@ -6043,6 +6124,12 @@ export namespace meeting {
6043
6124
  *
6044
6125
  * @param handler The handler to invoke when the selfParticipant's (current user's) raiseHandState changes.
6045
6126
  *
6127
+ * @hidden
6128
+ * Hide from docs.
6129
+ *
6130
+ * @internal
6131
+ * Limited to Microsoft-internal use
6132
+ *
6046
6133
  * @beta
6047
6134
  */
6048
6135
  function registerRaiseHandStateChangedHandler(handler: (eventData: RaiseHandStateChangedEventData) => void): void;
@@ -6052,6 +6139,12 @@ export namespace meeting {
6052
6139
  *
6053
6140
  * @param handler The handler to invoke when the selfParticipant (current user) successfully sends a meeting reaction
6054
6141
  *
6142
+ * @hidden
6143
+ * Hide from docs.
6144
+ *
6145
+ * @internal
6146
+ * Limited to Microsoft-internal use
6147
+ *
6055
6148
  * @beta
6056
6149
  */
6057
6150
  function registerMeetingReactionReceivedHandler(handler: (eventData: MeetingReactionReceivedEventData) => void): void;
@@ -6088,6 +6181,46 @@ export namespace meeting {
6088
6181
  */
6089
6182
  function setOptions(shareInformation: ShareInformation): void;
6090
6183
  }
6184
+ /**
6185
+ * Have the app handle audio (mic & speaker) and turn off host audio.
6186
+ *
6187
+ * When {@link RequestAppAudioHandlingParams.isAppHandlingAudio} is true, the host will switch to audioless mode
6188
+ * Registers for mic mute status change events, which are events that the app can receive from the host asking the app to
6189
+ * mute or unmute the microphone.
6190
+ *
6191
+ * When {@link RequestAppAudioHandlingParams.isAppHandlingAudio} is false, the host will switch out of audioless mode
6192
+ * Unregisters the mic mute status change events so the app will no longer receive these events
6193
+ *
6194
+ * @throws Error if {@linkcode app.initialize} has not successfully completed
6195
+ * @throws Error if {@link RequestAppAudioHandlingParams.micMuteStateChangedCallback} parameter is not defined
6196
+ *
6197
+ * @param requestAppAudioHandlingParams - {@link RequestAppAudioHandlingParams} object with values for the audio switchover
6198
+ * @param callback - Callback with one parameter, the result
6199
+ * can either be true (the host is now in audioless mode) or false (the host is not in audioless mode)
6200
+ *
6201
+ * @hidden
6202
+ * Hide from docs.
6203
+ *
6204
+ * @internal
6205
+ * Limited to Microsoft-internal use
6206
+ *
6207
+ * @beta
6208
+ */
6209
+ function requestAppAudioHandling(requestAppAudioHandlingParams: RequestAppAudioHandlingParams, callback: (isHostAudioless: boolean) => void): void;
6210
+ /**
6211
+ * Notifies the host that the microphone state has changed in the app.
6212
+ * @param micState - The new state that the microphone is in
6213
+ * isMicMuted - Boolean to indicate the current mute status of the mic.
6214
+ *
6215
+ * @hidden
6216
+ * Hide from docs.
6217
+ *
6218
+ * @internal
6219
+ * Limited to Microsoft-internal use
6220
+ *
6221
+ * @beta
6222
+ */
6223
+ function updateMicState(micState: MicState): void;
6091
6224
  }
6092
6225
 
6093
6226
  export namespace monetization {
@@ -6225,12 +6358,14 @@ export namespace teamsCore {
6225
6358
  */
6226
6359
  function print(): void;
6227
6360
  /**
6228
- * @hidden
6229
6361
  * Registers a handler to be called when the page has been requested to load.
6230
6362
  *
6363
+ * @remarks Check out [App Caching in Teams](https://learn.microsoft.com/microsoftteams/platform/apps-in-teams-meetings/build-tabs-for-meeting?tabs=desktop%2Cmeeting-chat-view-desktop%2Cmeeting-stage-view-desktop%2Cchannel-meeting-desktop#app-caching)
6364
+ * for a more detailed explanation about using this API.
6365
+ *
6231
6366
  * @param handler - The handler to invoke when the page is loaded.
6232
6367
  *
6233
- * @internal
6368
+ * @beta
6234
6369
  */
6235
6370
  function registerOnLoadHandler(handler: (context: LoadContext) => void): void;
6236
6371
  /**
@@ -6245,13 +6380,15 @@ export namespace teamsCore {
6245
6380
  */
6246
6381
  function registerOnLoadHandlerHelper(handler: (context: LoadContext) => void, versionSpecificHelper?: () => void): void;
6247
6382
  /**
6248
- * @hidden
6249
6383
  * Registers a handler to be called before the page is unloaded.
6250
6384
  *
6385
+ * @remarks Check out [App Caching in Teams](https://learn.microsoft.com/microsoftteams/platform/apps-in-teams-meetings/build-tabs-for-meeting?tabs=desktop%2Cmeeting-chat-view-desktop%2Cmeeting-stage-view-desktop%2Cchannel-meeting-desktop#app-caching)
6386
+ * for a more detailed explanation about using this API.
6387
+ *
6251
6388
  * @param handler - The handler to invoke before the page is unloaded. If this handler returns true the page should
6252
6389
  * invoke the readyToUnload function provided to it once it's ready to be unloaded.
6253
6390
  *
6254
- * @internal
6391
+ * @beta
6255
6392
  */
6256
6393
  function registerBeforeUnloadHandler(handler: (readyToUnload: () => void) => boolean): void;
6257
6394
  /**
@@ -6679,7 +6816,7 @@ export namespace search {
6679
6816
 
6680
6817
  /**
6681
6818
  * Namespace to open a share dialog for web content.
6682
- * For more info, see {@link https://learn.microsoft.com/en-us/microsoftteams/platform/concepts/build-and-test/share-to-teams-from-personal-app-or-tab Share to Teams from personal app or tab}
6819
+ * For more info, see [Share to Teams from personal app or tab](https://learn.microsoft.com/microsoftteams/platform/concepts/build-and-test/share-to-teams-from-personal-app-or-tab)
6683
6820
  */
6684
6821
  export namespace sharing {
6685
6822
  export const SharingAPIMessages: {
@@ -7269,7 +7406,7 @@ export namespace settings {
7269
7406
  export namespace tasks {
7270
7407
  /**
7271
7408
  * @deprecated
7272
- * As of 2.0.0, please use {@link dialog.url.open dialog.url.open(urlDialogInfo: UrlDialogInfo, submitHandler?: DialogSubmitHandler, messageFromChildHandler?: PostMessageChannel): void} for url based dialogs
7409
+ * As of 2.8.0, please use {@link dialog.url.open dialog.url.open(urlDialogInfo: UrlDialogInfo, submitHandler?: DialogSubmitHandler, messageFromChildHandler?: PostMessageChannel): void} for url based dialogs
7273
7410
  * and {@link dialog.url.bot.open dialog.url.bot.open(botUrlDialogInfo: BotUrlDialogInfo, submitHandler?: DialogSubmitHandler, messageFromChildHandler?: PostMessageChannel): void} for bot-based dialogs. In Teams,
7274
7411
  * this function can be used for Adaptive Card-based dialogs. Support for Adaptive Card-based dialogs is coming to other hosts in the future.
7275
7412
  *
@@ -7290,7 +7427,7 @@ export namespace tasks {
7290
7427
  function updateTask(taskInfo: TaskInfo): void;
7291
7428
  /**
7292
7429
  * @deprecated
7293
- * As of 2.0.0, please use {@link dialog.submit} instead.
7430
+ * As of 2.8.0, please use {@link dialog.url.submit} instead.
7294
7431
  *
7295
7432
  * Submit the task module.
7296
7433
  *