@microsoft/teams-js 2.1.0-beta.4 → 2.1.1-beta.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.0.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.1.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.0.0/js/MicrosoftTeams.min.js"
49
- integrity="sha384-QtTBFeFlfRDZBfwHJHYQp7MdLJ2C3sfAEB1Qpy+YblvjavBye+q87TELpTnvlXw4"
48
+ src="https://res.cdn.office.net/teams-js/2.1.0/js/MicrosoftTeams.min.js"
49
+ integrity="sha384-OEWKU/EjpwI1kJsgIcTi+paZNbXiqihK8zg6Dg2cbyjoEaC674oCQMy00ie4caKi"
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.0.0/dist/MicrosoftTeams.min.js"></script>
54
+ <script src="node_modules/@microsoft/teams-js@2.1.0/dist/MicrosoftTeams.min.js"></script>
55
55
 
56
56
  <!-- Microsoft Teams JavaScript API (via local) -->
57
57
  <script src="MicrosoftTeams.min.js"></script>
@@ -2570,6 +2570,11 @@ export enum ErrorCode {
2570
2570
  */
2571
2571
  SIZE_EXCEEDED = 10000
2572
2572
  }
2573
+ /** @hidden */
2574
+ export enum DevicePermission {
2575
+ GeoLocation = "geolocation",
2576
+ Media = "media"
2577
+ }
2573
2578
 
2574
2579
  /**
2575
2580
  * Namespace to interact with app initialization and lifecycle.
@@ -3063,6 +3068,61 @@ export namespace appInstallDialog {
3063
3068
  function isSupported(): boolean;
3064
3069
  }
3065
3070
 
3071
+ /**
3072
+ * Namespace to interact with the barcode scanning-specific part of the SDK.
3073
+ *
3074
+ * @beta
3075
+ */
3076
+ export namespace barCode {
3077
+ /**
3078
+ * Data structure to customize the barcode scanning experience in scanBarCode API.
3079
+ * All properties in BarCodeConfig are optional and have default values in the platform
3080
+ *
3081
+ * @beta
3082
+ */
3083
+ interface BarCodeConfig {
3084
+ /**
3085
+ * Optional; designates the scan timeout interval in seconds.
3086
+ * Default value is 30 seconds, max allowed value is 60 seconds.
3087
+ */
3088
+ timeOutIntervalInSec?: number;
3089
+ }
3090
+ /**
3091
+ * Scan Barcode or QRcode using camera
3092
+ *
3093
+ * @param barCodeConfig - input configuration to customize the barcode scanning experience
3094
+ *
3095
+ * @returns a scanned code
3096
+ *
3097
+ * @beta
3098
+ */
3099
+ function scanBarCode(barCodeConfig: BarCodeConfig): Promise<string>;
3100
+ /**
3101
+ * Checks whether or not media has user permission
3102
+ *
3103
+ * @returns true if the user has granted the app permission to media information, false otherwise
3104
+ *
3105
+ * @beta
3106
+ */
3107
+ function hasPermission(): Promise<boolean>;
3108
+ /**
3109
+ * Requests user permission for media
3110
+ *
3111
+ * @returns true if the user has granted the app permission to the media, false otherwise
3112
+ *
3113
+ * @beta
3114
+ */
3115
+ function requestPermission(): Promise<boolean>;
3116
+ /**
3117
+ * Checks if barCode capability is supported by the host
3118
+ *
3119
+ * @returns boolean to represent whether barCode is supported
3120
+ *
3121
+ * @beta
3122
+ */
3123
+ function isSupported(): boolean;
3124
+ }
3125
+
3066
3126
  /**
3067
3127
  * Describes information needed to start a chat
3068
3128
  *
@@ -3272,6 +3332,103 @@ export namespace dialog {
3272
3332
  function getDialogInfoFromBotUrlDialogInfo(botUrlDialogInfo: BotUrlDialogInfo): DialogInfo;
3273
3333
  }
3274
3334
 
3335
+ /**
3336
+ * Namespace to interact with the geoLocation module-specific part of the SDK. This is the newer version of location module.
3337
+ *
3338
+ * @beta
3339
+ */
3340
+ export namespace geoLocation {
3341
+ /**
3342
+ * Data struture to represent the location information
3343
+ *
3344
+ * @beta
3345
+ */
3346
+ interface Location {
3347
+ /**
3348
+ Latitude of the location
3349
+ */
3350
+ latitude: number;
3351
+ /**
3352
+ Longitude of the location
3353
+ */
3354
+ longitude: number;
3355
+ /**
3356
+ Accuracy of the coordinates captured
3357
+ */
3358
+ accuracy?: number;
3359
+ /**
3360
+ Time stamp when the location was captured
3361
+ */
3362
+ timestamp?: number;
3363
+ }
3364
+ /**
3365
+ * Fetches current user coordinates
3366
+ * @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
3367
+ *
3368
+ * @beta
3369
+ */
3370
+ function getCurrentLocation(): Promise<Location>;
3371
+ /**
3372
+ * Checks whether or not location has user permission
3373
+ *
3374
+ * @returns Promise that will resolve with true if the user had granted the app permission to location information, or with false otherwise,
3375
+ * In case of an error, promise will reject with the error. Function can also throw a NOT_SUPPORTED_ON_PLATFORM error
3376
+ *
3377
+ * @beta
3378
+ */
3379
+ function hasPermission(): Promise<boolean>;
3380
+ /**
3381
+ * Requests user permission for location
3382
+ *
3383
+ * @returns true if the user consented permission for location, false otherwise
3384
+ * @returns Promise that will resolve with true if the user consented permission for location, or with false otherwise,
3385
+ * In case of an error, promise will reject with the error. Function can also throw a NOT_SUPPORTED_ON_PLATFORM error
3386
+ *
3387
+ * @beta
3388
+ */
3389
+ function requestPermission(): Promise<boolean>;
3390
+ /**
3391
+ * Checks if geoLocation capability is supported by the host
3392
+ *
3393
+ * @returns boolean to represent whether geoLocation is supported
3394
+ *
3395
+ * @beta
3396
+ */
3397
+ function isSupported(): boolean;
3398
+ /**
3399
+ * Namespace to interact with the location on map module-specific part of the SDK.
3400
+ *
3401
+ * @beta
3402
+ */
3403
+ namespace map {
3404
+ /**
3405
+ * Allows user to choose location on map
3406
+ *
3407
+ * @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
3408
+ *
3409
+ * @beta
3410
+ */
3411
+ function chooseLocation(): Promise<Location>;
3412
+ /**
3413
+ * Shows the location on map corresponding to the given coordinates
3414
+ *
3415
+ * @param location - Location to be shown on the map
3416
+ * @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
3417
+ *
3418
+ * @beta
3419
+ */
3420
+ function showLocation(location: Location): Promise<void>;
3421
+ /**
3422
+ * Checks if geoLocation.map capability is supported by the host
3423
+ *
3424
+ * @returns boolean to represent whether geoLocation.map is supported
3425
+ *
3426
+ * @beta
3427
+ */
3428
+ function isSupported(): boolean;
3429
+ }
3430
+ }
3431
+
3275
3432
  /**
3276
3433
  * Navigation-specific part of the SDK.
3277
3434
  *
@@ -4180,6 +4337,9 @@ export namespace media {
4180
4337
  timeOutIntervalInSec?: number;
4181
4338
  }
4182
4339
  /**
4340
+ * @deprecated
4341
+ * As of 2.1.0, please use {@link barCode.scanBarCode barCode.scanBarCode(config?: BarCodeConfig): Promise\<string\>} instead.
4342
+
4183
4343
  * Scan Barcode/QRcode using camera
4184
4344
  *
4185
4345
  * @remarks
@@ -4192,7 +4352,17 @@ export namespace media {
4192
4352
  export {};
4193
4353
  }
4194
4354
 
4355
+ /**
4356
+ * @deprecated
4357
+ * As of 2.1.0, please use geoLocation namespace.
4358
+ *
4359
+ * Namespace to interact with the location module-specific part of the SDK.
4360
+ */
4195
4361
  export namespace location {
4362
+ /**
4363
+ * @deprecated
4364
+ * Data Structure to set the location properties in getLocation call.
4365
+ */
4196
4366
  interface LocationProps {
4197
4367
  /**
4198
4368
  whether user can alter location or not
@@ -4208,6 +4378,10 @@ export namespace location {
4208
4378
  */
4209
4379
  showMap?: boolean;
4210
4380
  }
4381
+ /**
4382
+ * @deprecated
4383
+ * Data struture to represent the location information
4384
+ */
4211
4385
  interface Location {
4212
4386
  /**
4213
4387
  Latitude of the location
@@ -4226,36 +4400,35 @@ export namespace location {
4226
4400
  */
4227
4401
  timestamp?: number;
4228
4402
  }
4229
- /**
4230
- * Fetches current user coordinates or allows user to choose location on map
4231
- *
4232
- * @param props {@link LocationProps} - Specifying how the location request is handled
4233
- * @returns Promise that will be fulfilled when the operation has completed
4234
- */
4235
- function getLocation(props: LocationProps): Promise<Location>;
4236
4403
  /**
4237
4404
  * @deprecated
4238
- * As of 2.0.0, please use {@link location.getLocation location.getLocation(props: LocationProps): Promise\<Location\>} instead.
4405
+ * As of 2.1.0, please use one of the following functions:
4406
+ * - {@link geoLocation.getCurrentLocation geoLocation.getCurrentLocation(): Promise\<Location\>} to get the current location.
4407
+ * - {@link geoLocation.map.chooseLocation geoLocation.map.chooseLocation(): Promise\<Location\>} to choose location on map.
4408
+ *
4409
+ * Fetches user location
4239
4410
  * @param props {@link LocationProps} - Specifying how the location request is handled
4240
4411
  * @param callback - Callback to invoke when current user location is fetched
4241
4412
  */
4242
4413
  function getLocation(props: LocationProps, callback: (error: SdkError, location: Location) => void): void;
4243
4414
  /**
4415
+ * @deprecated
4416
+ * As of 2.1.0, please use {@link geoLocation.map.showLocation geoLocation.map.showLocation(location: Location): Promise\<void\>} instead.
4417
+ *
4244
4418
  * Shows the location on map corresponding to the given coordinates
4245
4419
  *
4246
- * @param location {@link Location} - which needs to be shown on map
4247
- * @returns Promise that will be fulfilled when the operation has completed
4420
+ * @param location - Location to be shown on the map
4421
+ * @param callback - Callback to invoke when the location is opened on map
4248
4422
  */
4249
- function showLocation(location: Location): Promise<void>;
4423
+ function showLocation(location: Location, callback: (error: SdkError, status: boolean) => void): void;
4250
4424
  /**
4251
4425
  * @deprecated
4252
- * As of 2.0.0, please use {@link location.showLocation location.showLocation(location: Location): Promise\<void\>} instead.
4253
- * Shows the location on map corresponding to the given coordinates
4254
- * @param location {@link Location} - which needs to be shown on map
4255
- * @param callback - Callback to invoke when the location is opened on map
4426
+ * As of 2.1.0, please use geoLocation namespace, and use {@link geoLocation.isSupported geoLocation.isSupported: boolean} to check if geoLocation is supported.
4427
+ *
4428
+ * Checks if Location capability is supported by the host
4429
+ *
4430
+ * @returns boolean to represent whether Location is supported
4256
4431
  */
4257
- function showLocation(location: Location, callback: (error: SdkError, status: boolean) => void): void;
4258
- function showLocationHelper(location: Location): Promise<void>;
4259
4432
  function isSupported(): boolean;
4260
4433
  }
4261
4434
 
@@ -5061,6 +5234,8 @@ export namespace sharing {
5061
5234
 
5062
5235
  /**
5063
5236
  * Namespace to interact with the stage view specific part of the SDK.
5237
+ *
5238
+ * @beta
5064
5239
  */
5065
5240
  export namespace stageView {
5066
5241
  /**
@@ -5097,10 +5272,18 @@ export namespace stageView {
5097
5272
  * Feature is under development
5098
5273
  *
5099
5274
  * Opens a stage view to display a Teams application
5275
+ * @beta
5100
5276
  * @param stageViewParams - The parameters to pass into the stage view.
5101
5277
  * @returns Promise that resolves or rejects with an error once the stage view is closed.
5102
5278
  */
5103
5279
  function open(stageViewParams: StageViewParams): Promise<void>;
5280
+ /**
5281
+ * Checks if stageView capability is supported by the host
5282
+ * @beta
5283
+ * @returns true if the stageView capability is enabled in runtime.supports.stageView and
5284
+ * false if it is disabled
5285
+ */
5286
+ function isSupported(): boolean;
5104
5287
  }
5105
5288
 
5106
5289
  /**
@@ -5419,7 +5602,7 @@ export function getMruTabInstances(callback: (tabInfo: TabInformation) => void,
5419
5602
  export function shareDeepLink(deepLinkParameters: DeepLinkParameters): void;
5420
5603
  /**
5421
5604
  * @deprecated
5422
- * As of 2.0.0, please use {@link app.openLink core.openLink(deepLink: string): Promise\<void\>} instead.
5605
+ * As of 2.0.0, please use {@link app.openLink app.openLink(deepLink: string): Promise\<void\>} instead.
5423
5606
  *
5424
5607
  * Execute deep link API.
5425
5608
  *