@microsoft/teams-js 2.13.0 → 2.14.0-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.
@@ -5568,6 +5568,27 @@ 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
+ export function hasPermission(): Promise<boolean>;
5578
+ /**
5579
+ * Requests user permission for media
5580
+ *
5581
+ * @returns Promise that will resolve with true if the user consented permission for media, or with false otherwise,
5582
+ * In case of an error, promise will reject with the error. Function can also throw a NOT_SUPPORTED_ON_PLATFORM error
5583
+ */
5584
+ export function requestPermission(): Promise<boolean>;
5585
+ /**
5586
+ * Checks if media capability is supported by the host
5587
+ * @returns boolean to represent whether media is supported
5588
+ *
5589
+ * @throws Error if {@linkcode app.initialize} has not successfully completed
5590
+ */
5591
+ export function isSupported(): boolean;
5571
5592
  /**
5572
5593
  * Media object returned by the select Media API
5573
5594
  */
@@ -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.0";
2093
2093
 
2094
2094
  ;// CONCATENATED MODULE: ./src/internal/internalAPIs.ts
2095
2095
 
@@ -5790,6 +5790,50 @@ 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
+ function hasPermission() {
5800
+ ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
5801
+ if (!isSupported()) {
5802
+ throw errorNotSupportedOnPlatform;
5803
+ }
5804
+ var permissions = DevicePermission.Media;
5805
+ return new Promise(function (resolve) {
5806
+ resolve(sendAndHandleSdkError('permissions.has', permissions));
5807
+ });
5808
+ }
5809
+ media.hasPermission = hasPermission;
5810
+ /**
5811
+ * Requests user permission for media
5812
+ *
5813
+ * @returns Promise that will resolve with true if the user consented permission for media, or with false otherwise,
5814
+ * In case of an error, promise will reject with the error. Function can also throw a NOT_SUPPORTED_ON_PLATFORM error
5815
+ */
5816
+ function requestPermission() {
5817
+ ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
5818
+ if (!isSupported()) {
5819
+ throw errorNotSupportedOnPlatform;
5820
+ }
5821
+ var permissions = DevicePermission.Media;
5822
+ return new Promise(function (resolve) {
5823
+ resolve(sendAndHandleSdkError('permissions.request', permissions));
5824
+ });
5825
+ }
5826
+ media.requestPermission = requestPermission;
5827
+ /**
5828
+ * Checks if media capability is supported by the host
5829
+ * @returns boolean to represent whether media is supported
5830
+ *
5831
+ * @throws Error if {@linkcode app.initialize} has not successfully completed
5832
+ */
5833
+ function isSupported() {
5834
+ return ensureInitialized(runtime) && runtime.supports.media && runtime.supports.permissions ? true : false;
5835
+ }
5836
+ media.isSupported = isSupported;
5793
5837
  /**
5794
5838
  * Media object returned by the select Media API
5795
5839
  */