@microsoft/teams-js 2.13.0 → 2.14.0-beta.1

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.
@@ -5568,6 +5568,24 @@ export namespace media {
5568
5568
  *
5569
5569
  */
5570
5570
  export function captureImage(callback: captureImageCallbackFunctionType): void;
5571
+ /**
5572
+ * Checks whether or not media has user permission
5573
+ *
5574
+ * @returns Promise that will resolve with true if the user had granted the app permission to media information, or with false otherwise,
5575
+ * In case of an error, promise will reject with the error. Function can also throw a NOT_SUPPORTED_ON_PLATFORM error
5576
+ *
5577
+ * @beta
5578
+ */
5579
+ export function hasPermission(): Promise<boolean>;
5580
+ /**
5581
+ * Requests user permission for media
5582
+ *
5583
+ * @returns Promise that will resolve with true if the user consented permission for media, or with false otherwise,
5584
+ * In case of an error, promise will reject with the error. Function can also throw a NOT_SUPPORTED_ON_PLATFORM error
5585
+ *
5586
+ * @beta
5587
+ */
5588
+ export function requestPermission(): Promise<boolean>;
5571
5589
  /**
5572
5590
  * Media object returned by the select Media API
5573
5591
  */
@@ -2089,7 +2089,7 @@ var _minRuntimeConfigToUninitialize = {
2089
2089
  * @hidden
2090
2090
  * Package version.
2091
2091
  */
2092
- var version = "2.13.0";
2092
+ var version = "2.14.0-beta.1";
2093
2093
 
2094
2094
  ;// CONCATENATED MODULE: ./src/internal/internalAPIs.ts
2095
2095
 
@@ -5790,6 +5790,53 @@ var media;
5790
5790
  sendMessageToParent('captureImage', callback);
5791
5791
  }
5792
5792
  media.captureImage = captureImage;
5793
+ /**
5794
+ * Checks whether or not media has user permission
5795
+ *
5796
+ * @returns Promise that will resolve with true if the user had granted the app permission to media information, or with false otherwise,
5797
+ * In case of an error, promise will reject with the error. Function can also throw a NOT_SUPPORTED_ON_PLATFORM error
5798
+ *
5799
+ * @beta
5800
+ */
5801
+ function hasPermission() {
5802
+ ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
5803
+ if (!isPermissionSupported()) {
5804
+ throw errorNotSupportedOnPlatform;
5805
+ }
5806
+ var permissions = DevicePermission.Media;
5807
+ return new Promise(function (resolve) {
5808
+ resolve(sendAndHandleSdkError('permissions.has', permissions));
5809
+ });
5810
+ }
5811
+ media.hasPermission = hasPermission;
5812
+ /**
5813
+ * Requests user permission for media
5814
+ *
5815
+ * @returns Promise that will resolve with true if the user consented permission for media, or with false otherwise,
5816
+ * In case of an error, promise will reject with the error. Function can also throw a NOT_SUPPORTED_ON_PLATFORM error
5817
+ *
5818
+ * @beta
5819
+ */
5820
+ function requestPermission() {
5821
+ ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
5822
+ if (!isPermissionSupported()) {
5823
+ throw errorNotSupportedOnPlatform;
5824
+ }
5825
+ var permissions = DevicePermission.Media;
5826
+ return new Promise(function (resolve) {
5827
+ resolve(sendAndHandleSdkError('permissions.request', permissions));
5828
+ });
5829
+ }
5830
+ media.requestPermission = requestPermission;
5831
+ /**
5832
+ * Checks if permission capability is supported by the host
5833
+ * @returns boolean to represent whether permission is supported
5834
+ *
5835
+ * @throws Error if {@linkcode app.initialize} has not successfully completed
5836
+ */
5837
+ function isPermissionSupported() {
5838
+ return ensureInitialized(runtime) && runtime.supports.permissions ? true : false;
5839
+ }
5793
5840
  /**
5794
5841
  * Media object returned by the select Media API
5795
5842
  */