@microsoft/teams-js 2.3.0-beta.0 → 2.3.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://docs.microsoft.com/javascript/api/overvi
24
24
 
25
25
  ### Production
26
26
 
27
- You can reference these files directly [from here](https://res.cdn.office.net/teams-js/2.2.0/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.3.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 SDK 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.2.0/js/MicrosoftTeams.min.js"
49
- integrity="sha384-yBjE++eHeBPzIg+IKl9OHFqMbSdrzY2S/LW3qeitc5vqXewEYRWegByWzBN/chRh"
48
+ src="https://res.cdn.office.net/teams-js/2.3.0/js/MicrosoftTeams.min.js"
49
+ integrity="sha384-LI9E631Gz4tFN2IFwM29y0lSXUgqhkoTtdiH4ghd6eNOA1lAzX9F+D8w1NnFF9xM"
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.2.0/dist/MicrosoftTeams.min.js"></script>
54
+ <script src="node_modules/@microsoft/teams-js@2.3.0/dist/MicrosoftTeams.min.js"></script>
55
55
 
56
56
  <!-- Microsoft Teams JavaScript API (via local) -->
57
57
  <script src="MicrosoftTeams.min.js"></script>
@@ -911,7 +911,7 @@ export namespace files {
911
911
  /**
912
912
  * The file path to uniquely identify it within the file hierarchy
913
913
  */
914
- filePath: string;
914
+ webkitRelativePath?: string;
915
915
  }
916
916
  /**
917
917
  * @hidden
@@ -1006,6 +1006,7 @@ export namespace files {
1006
1006
  /**
1007
1007
  * @hidden
1008
1008
  * Hide from docs
1009
+ * @beta
1009
1010
  *
1010
1011
  * Interface representing 3P cloud storage provider upload existing file(s) action
1011
1012
  *
@@ -1137,13 +1138,16 @@ export namespace files {
1137
1138
  * Initiates add 3P cloud storage provider flow, where a pop up window opens for user to select required
1138
1139
  * 3P provider from the configured policy supported 3P provider list, following which user authentication
1139
1140
  * for selected 3P provider is performed on success of which the selected 3P provider support is added for user
1141
+ * @beta
1140
1142
  *
1141
- * @param callback Callback that will be triggered post add 3P cloud storage provider action
1143
+ * @param callback Callback that will be triggered post add 3P cloud storage provider action.
1144
+ * If the error is encountered (and hence passed back), no provider value is sent back.
1145
+ * For success scenarios, error value will be passed as null and a valid provider value is sent.
1142
1146
  *
1143
1147
  * @internal
1144
1148
  * Limited to Microsoft-internal use
1145
1149
  */
1146
- export function addCloudStorageProvider(callback: (error?: SdkError) => void): void;
1150
+ export function addCloudStorageProvider(callback: (error?: SdkError, provider?: CloudStorageProvider) => void): void;
1147
1151
  /**
1148
1152
  * @hidden
1149
1153
  * Hide from docs
@@ -1218,6 +1222,7 @@ export namespace files {
1218
1222
  * Hide from docs
1219
1223
  *
1220
1224
  * Initiates the upload 3P cloud storage file(s) flow, which will upload file(s) to the given 3P provider
1225
+ * @beta
1221
1226
  *
1222
1227
  * @param uploadFileRequest 3P cloud storage provider upload file(s) action request content
1223
1228
  * @param callback Callback that will be triggered post uploading file(s) flow is finished
@@ -1989,6 +1994,166 @@ export namespace teams {
1989
1994
  }
1990
1995
  }
1991
1996
 
1997
+ /**
1998
+ * @hidden
1999
+ * Extended video API
2000
+ * @beta
2001
+ *
2002
+ * @internal
2003
+ * Limited to Microsoft-internal use
2004
+ */
2005
+ export namespace videoEx {
2006
+ /**
2007
+ * @hidden
2008
+ * Video frame configuration supplied to the host to customize the generated video frame parameters
2009
+ * @beta
2010
+ *
2011
+ * @internal
2012
+ * Limited to Microsoft-internal use
2013
+ */
2014
+ interface VideoFrameConfig extends video.VideoFrameConfig {
2015
+ /**
2016
+ * @hidden
2017
+ * Flag to indicate use camera stream to synthesize video frame or not.
2018
+ * Default value is true.
2019
+ * @beta
2020
+ *
2021
+ * @internal
2022
+ * Limited to Microsoft-internal use
2023
+ */
2024
+ requireCameraStream?: boolean;
2025
+ /**
2026
+ * @hidden
2027
+ * Machine learning model to run in the host to do audio inference for you
2028
+ * @beta
2029
+ *
2030
+ * @internal
2031
+ * Limited to Microsoft-internal use
2032
+ */
2033
+ audioInferenceModel?: ArrayBuffer;
2034
+ }
2035
+ /**
2036
+ * @hidden
2037
+ * Represents a video frame
2038
+ * @beta
2039
+ *
2040
+ * @internal
2041
+ * Limited to Microsoft-internal use
2042
+ */
2043
+ interface VideoFrame extends video.VideoFrame {
2044
+ /**
2045
+ * @hidden
2046
+ * The model output if you passed in an {@linkcode VideoFrameConfig.audioInferenceModel}
2047
+ * @beta
2048
+ *
2049
+ * @internal
2050
+ * Limited to Microsoft-internal use
2051
+ */
2052
+ audioInferenceResult?: Uint8Array;
2053
+ }
2054
+ /**
2055
+ * @hidden
2056
+ * Video frame call back function
2057
+ * @beta
2058
+ *
2059
+ * @internal
2060
+ * Limited to Microsoft-internal use
2061
+ */
2062
+ type VideoFrameCallback = (frame: VideoFrame, notifyVideoFrameProcessed: () => void, notifyError: (errorMessage: string) => void) => void;
2063
+ /**
2064
+ * @hidden
2065
+ * Register to process video frames
2066
+ * @beta
2067
+ *
2068
+ * @param frameCallback - The callback to invoke when registerForVideoFrame has completed
2069
+ * @param config - VideoFrameConfig to customize generated video frame parameters
2070
+ *
2071
+ * @internal
2072
+ * Limited to Microsoft-internal use
2073
+ */
2074
+ function registerForVideoFrame(frameCallback: VideoFrameCallback, config: VideoFrameConfig): void;
2075
+ /**
2076
+ * @hidden
2077
+ * Video extension should call this to notify host that the current selected effect parameter changed.
2078
+ * If it's pre-meeting, host will call videoEffectCallback immediately then use the videoEffect.
2079
+ * If it's the in-meeting scenario, we will call videoEffectCallback when apply button clicked.
2080
+ * @beta
2081
+ * @param effectChangeType - the effect change type.
2082
+ * @param effectId - Newly selected effect id. {@linkcode VideoEffectCallBack}
2083
+ * @param effectParam Variant for the newly selected effect. {@linkcode VideoEffectCallBack}
2084
+ *
2085
+ * @internal
2086
+ * Limited to Microsoft-internal use
2087
+ */
2088
+ function notifySelectedVideoEffectChanged(effectChangeType: video.EffectChangeType, effectId: string | undefined, effectParam?: string): void;
2089
+ /**
2090
+ * @hidden
2091
+ * Video effect change call back function definition
2092
+ * @beta
2093
+ *
2094
+ * @internal
2095
+ * Limited to Microsoft-internal use
2096
+ */
2097
+ type VideoEffectCallBack = (effectId: string | undefined, effectParam?: string) => void;
2098
+ /**
2099
+ * @hidden
2100
+ * Register the video effect callback, host uses this to notify the video extension the new video effect will by applied
2101
+ * @beta
2102
+ * @param callback - The VideoEffectCallback to invoke when registerForVideoEffect has completed
2103
+ *
2104
+ * @internal
2105
+ * Limited to Microsoft-internal use
2106
+ */
2107
+ function registerForVideoEffect(callback: VideoEffectCallBack): void;
2108
+ /**
2109
+ * @hidden
2110
+ * Personalized video effect
2111
+ * @beta
2112
+ *
2113
+ * @internal
2114
+ * Limited to Microsoft-internal use
2115
+ */
2116
+ interface PersonalizedEffect {
2117
+ /**
2118
+ * Personalized effect id
2119
+ */
2120
+ id: string;
2121
+ /**
2122
+ * Display name
2123
+ */
2124
+ name: string;
2125
+ /**
2126
+ * Effect type defined by app
2127
+ */
2128
+ type: string;
2129
+ /**
2130
+ * Data URI of the thumbnail image content encoded in ASCII format using the base64 scheme
2131
+ */
2132
+ thumbnail: string;
2133
+ }
2134
+ /**
2135
+ * @hidden
2136
+ * Send personalized effects to Teams client
2137
+ * @beta
2138
+ *
2139
+ * @internal
2140
+ * Limited to Microsoft-internal use
2141
+ */
2142
+ function updatePersonalizedEffects(effects: PersonalizedEffect[]): void;
2143
+ /**
2144
+ * @hidden
2145
+ * Checks if video capability is supported by the host
2146
+ * @beta
2147
+ *
2148
+ * @returns true if the video capability is enabled in runtime.supports.video and
2149
+ * false if it is disabled
2150
+ *
2151
+ * @internal
2152
+ * Limited to Microsoft-internal use
2153
+ */
2154
+ function isSupported(): boolean;
2155
+ }
2156
+
1992
2157
  /**
1993
2158
  * Namespace to interact with the authentication-specific part of the SDK.
1994
2159
  *
@@ -4136,6 +4301,17 @@ export namespace pages {
4136
4301
  * Limited to Microsoft-internal use
4137
4302
  */
4138
4303
  function registerFocusEnterHandler(handler: (navigateForward: boolean) => void): void;
4304
+ /**
4305
+ * @hidden
4306
+ * Undocumented helper function with shared code between deprecated version and current version of the registerFocusEnterHandler API.
4307
+ *
4308
+ * @internal
4309
+ * Limited to Microsoft-internal use
4310
+ *
4311
+ * @param handler - The handler for placing focus within the application.
4312
+ * @param versionSpecificHelper - The helper function containing logic pertaining to a specific version of the API.
4313
+ */
4314
+ function registerFocusEnterHandlerHelper(handler: (navigateForward: boolean) => void, versionSpecificHelper?: () => void): void;
4139
4315
  /**
4140
4316
  * Sets/Updates the current frame with new information
4141
4317
  *
@@ -4216,6 +4392,17 @@ export namespace pages {
4216
4392
  * @param handler - The handler to invoke when the user toggles full-screen view for a tab.
4217
4393
  */
4218
4394
  function registerFullScreenHandler(handler: (isFullScreen: boolean) => void): void;
4395
+ /**
4396
+ * @hidden
4397
+ * Undocumented helper function with shared code between deprecated version and current version of the registerFullScreenHandler API.
4398
+ *
4399
+ * @internal
4400
+ * Limited to Microsoft-internal use
4401
+ *
4402
+ * @param handler - The handler to invoke when the user toggles full-screen view for a tab.
4403
+ * @param versionSpecificHelper - The helper function containing logic pertaining to a specific version of the API.
4404
+ */
4405
+ function registerFullScreenHandlerHelper(handler: (isFullScreen: boolean) => void, versionSpecificHelper?: () => void): void;
4219
4406
  /**
4220
4407
  * Checks if the pages capability is supported by the host
4221
4408
  * @returns true if the pages capability is enabled in runtime.supports.pages and
@@ -4314,6 +4501,17 @@ export namespace pages {
4314
4501
  * @param handler - The handler to invoke when the user selects the Save button.
4315
4502
  */
4316
4503
  function registerOnSaveHandler(handler: (evt: SaveEvent) => void): void;
4504
+ /**
4505
+ * @hidden
4506
+ * Undocumented helper function with shared code between deprecated version and current version of the registerOnSaveHandler API.
4507
+ *
4508
+ * @internal
4509
+ * Limited to Microsoft-internal use
4510
+ *
4511
+ * @param handler - The handler to invoke when the user selects the Save button.
4512
+ * @param versionSpecificHelper - The helper function containing logic pertaining to a specific version of the API.
4513
+ */
4514
+ function registerOnSaveHandlerHelper(handler: (evt: SaveEvent) => void, versionSpecificHelper?: () => void): void;
4317
4515
  /**
4318
4516
  * Registers a handler for user attempts to remove content. This handler should be used
4319
4517
  * to remove the underlying resource powering the content.
@@ -4322,11 +4520,33 @@ export namespace pages {
4322
4520
  * @param handler - The handler to invoke when the user selects the Remove button.
4323
4521
  */
4324
4522
  function registerOnRemoveHandler(handler: (evt: RemoveEvent) => void): void;
4523
+ /**
4524
+ * @hidden
4525
+ * Undocumented helper function with shared code between deprecated version and current version of the registerOnRemoveHandler API.
4526
+ *
4527
+ * @internal
4528
+ * Limited to Microsoft-internal use
4529
+ *
4530
+ * @param handler - The handler to invoke when the user selects the Remove button.
4531
+ * @param versionSpecificHelper - The helper function containing logic pertaining to a specific version of the API.
4532
+ */
4533
+ function registerOnRemoveHandlerHelper(handler: (evt: RemoveEvent) => void, versionSpecificHelper?: () => void): void;
4325
4534
  /**
4326
4535
  * Registers a handler for when the tab configuration is changed by the user
4327
4536
  * @param handler - The handler to invoke when the user clicks on Settings.
4328
4537
  */
4329
4538
  function registerChangeConfigHandler(handler: () => void): void;
4539
+ /**
4540
+ * @hidden
4541
+ * Undocumented helper function with shared code between deprecated version and current version of the registerConfigChangeHandler API.
4542
+ *
4543
+ * @internal
4544
+ * Limited to Microsoft-internal use
4545
+ *
4546
+ * @param handler - The handler to invoke when the user clicks on Settings.
4547
+ * @param versionSpecificHelper - The helper function containing logic pertaining to a specific version of the API.
4548
+ */
4549
+ function registerChangeConfigHandlerHelper(handler: () => void, versionSpecificHelper?: () => void): void;
4330
4550
  /**
4331
4551
  * Describes the results of the settings.save event. Includes result, notifySuccess, and notifyFailure
4332
4552
  * to indicate the return object (result) and the status of whether the settings.save call succeeded or not and why.
@@ -4395,6 +4615,17 @@ export namespace pages {
4395
4615
  * @param handler - The handler to invoke when the user presses the host client's back button.
4396
4616
  */
4397
4617
  function registerBackButtonHandler(handler: () => boolean): void;
4618
+ /**
4619
+ * @hidden
4620
+ * Undocumented helper function with shared code between deprecated version and current version of the registerBackButtonHandler API.
4621
+ *
4622
+ * @internal
4623
+ * Limited to Microsoft-internal use
4624
+ *
4625
+ * @param handler - The handler to invoke when the user presses the host client's back button.
4626
+ * @param versionSpecificHelper - The helper function containing logic pertaining to a specific version of the API.
4627
+ */
4628
+ function registerBackButtonHandlerHelper(handler: () => boolean, versionSpecificHelper?: () => void): void;
4398
4629
  /**
4399
4630
  * Checks if the pages.backStack capability is supported by the host
4400
4631
  * @returns true if the pages.backStack capability is enabled in runtime.supports.pages.backStack and
@@ -4443,18 +4674,51 @@ export namespace pages {
4443
4674
  * @param handler - The handler to invoke when the personal app button is clicked in the app bar.
4444
4675
  */
4445
4676
  function onClick(handler: () => void): void;
4677
+ /**
4678
+ * @hidden
4679
+ * Undocumented helper function with shared code between deprecated version and current version of the onClick API.
4680
+ *
4681
+ * @internal
4682
+ * Limited to Microsoft-internal use
4683
+ *
4684
+ * @param handler - The handler to invoke when the personal app button is clicked in the app bar.
4685
+ * @param versionSpecificHelper - The helper function containing logic pertaining to a specific version of the API.
4686
+ */
4687
+ function onClickHelper(handler: () => void, versionSpecificHelper?: () => void): void;
4446
4688
  /**
4447
4689
  * Registers a handler for entering hover of the app button.
4448
4690
  * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.
4449
4691
  * @param handler - The handler to invoke when entering hover of the personal app button in the app bar.
4450
4692
  */
4451
4693
  function onHoverEnter(handler: () => void): void;
4694
+ /**
4695
+ * @hidden
4696
+ * Undocumented helper function with shared code between deprecated version and current version of the onHoverEnter API.
4697
+ *
4698
+ * @internal
4699
+ * Limited to Microsoft-internal use
4700
+ *
4701
+ * @param handler - The handler to invoke when entering hover of the personal app button in the app bar.
4702
+ * @param versionSpecificHelper - The helper function containing logic pertaining to a specific version of the API.
4703
+ */
4704
+ function onHoverEnterHelper(handler: () => void, versionSpecificHelper?: () => void): void;
4452
4705
  /**
4453
4706
  * Registers a handler for exiting hover of the app button.
4454
4707
  * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.
4455
4708
  * @param handler - The handler to invoke when exiting hover of the personal app button in the app bar.
4456
4709
  */
4457
4710
  function onHoverLeave(handler: () => void): void;
4711
+ /**
4712
+ * @hidden
4713
+ * Undocumented helper function with shared code between deprecated version and current version of the onHoverLeave API.
4714
+ *
4715
+ * @internal
4716
+ * Limited to Microsoft-internal use
4717
+ *
4718
+ * @param handler - The handler to invoke when existing hover of the personal app button in the app bar.
4719
+ * @param versionSpecificHelper - The helper function containing logic pertaining to a specific version of the API.
4720
+ */
4721
+ function onHoverLeaveHelper(handler: () => void, versionSpecificHelper?: () => void): void;
4458
4722
  /**
4459
4723
  * Checks if pages.appButton capability is supported by the host
4460
4724
  * @returns true if the pages.appButton capability is enabled in runtime.supports.pages.appButton and
@@ -5606,6 +5870,17 @@ export namespace teamsCore {
5606
5870
  * @internal
5607
5871
  */
5608
5872
  function registerOnLoadHandler(handler: (context: LoadContext) => void): void;
5873
+ /**
5874
+ * @hidden
5875
+ * Undocumented helper function with shared code between deprecated version and current version of the registerOnLoadHandler API.
5876
+ *
5877
+ * @internal
5878
+ * Limited to Microsoft-internal use
5879
+ *
5880
+ * @param handler - The handler to invoke when the page is loaded.
5881
+ * @param versionSpecificHelper - The helper function containing logic pertaining to a specific version of the API.
5882
+ */
5883
+ function registerOnLoadHandlerHelper(handler: (context: LoadContext) => void, versionSpecificHelper?: () => void): void;
5609
5884
  /**
5610
5885
  * @hidden
5611
5886
  * Registers a handler to be called before the page is unloaded.
@@ -5616,6 +5891,18 @@ export namespace teamsCore {
5616
5891
  * @internal
5617
5892
  */
5618
5893
  function registerBeforeUnloadHandler(handler: (readyToUnload: () => void) => boolean): void;
5894
+ /**
5895
+ * @hidden
5896
+ * Undocumented helper function with shared code between deprecated version and current version of the registerBeforeUnloadHandler API.
5897
+ *
5898
+ * @internal
5899
+ * Limited to Microsoft-internal use
5900
+ *
5901
+ * @param handler - - The handler to invoke before the page is unloaded. If this handler returns true the page should
5902
+ * invoke the readyToUnload function provided to it once it's ready to be unloaded.
5903
+ * @param versionSpecificHelper - The helper function containing logic pertaining to a specific version of the API.
5904
+ */
5905
+ function registerBeforeUnloadHandlerHelper(handler: (readyToUnload: () => void) => boolean, versionSpecificHelper?: () => void): void;
5619
5906
  /**
5620
5907
  * Checks if teamsCore capability is supported by the host
5621
5908
  * @returns true if the teamsCore capability is enabled in runtime.supports.teamsCore and
@@ -5813,6 +6100,10 @@ export namespace video {
5813
6100
  * RGB stride, valid only when video frame format is RGB
5814
6101
  */
5815
6102
  stride?: number;
6103
+ /**
6104
+ * The time stamp of the current video frame
6105
+ */
6106
+ timestamp?: number;
5816
6107
  }
5817
6108
  /**
5818
6109
  * Video frame format enum, currently only support NV12
@@ -5837,11 +6128,11 @@ export namespace video {
5837
6128
  */
5838
6129
  enum EffectChangeType {
5839
6130
  /**
5840
- * current video effect changed
6131
+ * Current video effect changed
5841
6132
  */
5842
6133
  EffectChanged = 0,
5843
6134
  /**
5844
- * disable the video effect
6135
+ * Disable the video effect
5845
6136
  */
5846
6137
  EffectDisabled = 1
5847
6138
  }
@@ -5863,8 +6154,8 @@ export namespace video {
5863
6154
  */
5864
6155
  function registerForVideoFrame(frameCallback: VideoFrameCallback, config: VideoFrameConfig): void;
5865
6156
  /**
5866
- * Video extension should call this to notify host client that the current selected effect parameter changed.
5867
- * If it's pre-meeting, host client will call videoEffectCallback immediately then use the videoEffect.
6157
+ * Video extension should call this to notify host that the current selected effect parameter changed.
6158
+ * If it's pre-meeting, host will call videoEffectCallback immediately then use the videoEffect.
5868
6159
  * If it's the in-meeting scenario, we will call videoEffectCallback when apply button clicked.
5869
6160
  * @beta
5870
6161
  * @param effectChangeType - the effect change type.
@@ -5872,7 +6163,7 @@ export namespace video {
5872
6163
  */
5873
6164
  function notifySelectedVideoEffectChanged(effectChangeType: EffectChangeType, effectId: string | undefined): void;
5874
6165
  /**
5875
- * Register the video effect callback, host client uses this to notify the video extension the new video effect will by applied
6166
+ * Register the video effect callback, host uses this to notify the video extension the new video effect will by applied
5876
6167
  * @beta
5877
6168
  * @param callback - The VideoEffectCallback to invoke when registerForVideoEffect has completed
5878
6169
  */