@types/office-js 1.0.397 → 1.0.398

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.
office-js/README.md CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for office-js (https://github.com/OfficeD
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/office-js.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Mon, 24 Jun 2024 22:08:06 GMT
11
+ * Last updated: Tue, 25 Jun 2024 17:07:23 GMT
12
12
  * Dependencies: none
13
13
 
14
14
  # Credits
office-js/index.d.ts CHANGED
@@ -5321,6 +5321,13 @@ declare namespace Office {
5321
5321
  *
5322
5322
  * This method returns a promise. Use it with Excel, PowerPoint, and Word add-ins.
5323
5323
  *
5324
+ * If a user grants access to a device capability for the first time, the promise resolves with `true`.
5325
+ * You must then reload the add-in before you can run code that uses the device capability.
5326
+ * For example, you can call `window.location.reload()` to reload your add-in.
5327
+ * If a user had previously granted access to a device capability, the promise resolves with `false`.
5328
+ * You don't need to reload your add-in to run code that uses the device capability, as the permission is already set.
5329
+ * If a user denies access to a device capability, the promise rejects with a "User denied the permission request" error message.
5330
+ *
5324
5331
  * @remarks
5325
5332
  *
5326
5333
  * **Important**:
@@ -5331,9 +5338,6 @@ declare namespace Office {
5331
5338
  * Use {@link https://learn.microsoft.com/javascript/api/office/office.context#office-office-context-platform-member | Office.context.platform} and verify that it returns
5332
5339
  * `Office.PlatformType.OfficeOnline`. Otherwise, the `requestPermissions` call will return an error.
5333
5340
  *
5334
- * - If the user allows access to their camera or microphone, the add-in must be reloaded in the browser for the permissions to take effect.
5335
- * For example, you can call `window.location.reload()` to reload your add-in.
5336
- *
5337
5341
  * - If a user selects **Allow** from the dialog, the permission persists until the add-in is uninstalled or until the
5338
5342
  * cache of the browser on which the add-in is running is cleared. If a user wants to change an add-in’s access to their camera or microphone,
5339
5343
  * they must uninstall the add-in or clear their browser cache.
@@ -5361,9 +5365,6 @@ declare namespace Office {
5361
5365
  *
5362
5366
  * - For Excel, PowerPoint, and Word add-ins, use the `requestPermissions` method instead.
5363
5367
  *
5364
- * - If the user allows access to their camera, geolocation, or microphone, the add-in must be reloaded in the browser for the permissions to take effect.
5365
- * For example, you can call `window.location.reload()` to reload your add-in.
5366
- *
5367
5368
  * - If your add-in uses the same code for both Office on the web and Office desktop clients, verify the platform on which the add-in is running before calling `requestPermissionsAsync`.
5368
5369
  * Use {@link https://learn.microsoft.com/javascript/api/outlook/office.diagnostics#outlook-office-diagnostics-hostname-member | Office.context.mailbox.diagnostics.hostName}
5369
5370
  * and verify that it returns `OutlookWebApp`. Otherwise, the `requestPermissionsAsync` call will return an error.
@@ -5383,7 +5384,11 @@ declare namespace Office {
5383
5384
  * In Outlook on the web, an add-in can request access to a user's camera, geolocation, and microphone.
5384
5385
  * @param options An object literal that contains the `asyncContext` property. Assign any object you wish to access in the callback function to the `asyncContext` property.
5385
5386
  * @param callback When the method completes, the function passed in the `callback` parameter is called with a single parameter, `asyncResult`, which is an `Office.AsyncResult` object.
5386
- * If the user grants permission to access the requested device capabilities, `true` is returned in the `asyncResult.value` property.
5387
+ * If the user grants permission to access the requested device capabilities, `true` is returned in the `asyncResult.value` property. You must then reload the add-in before you can
5388
+ * run code that uses the device capabilities. For example, you can call `window.location.reload()` to reload your add-in.
5389
+ * If the user had previously granted permission to access the requested device capabilities, `false` is returned in the `asyncResult.value` property. You don't need to
5390
+ * reload your add-in to run code that uses the device capability, as the permission is already set.
5391
+ * If a user denies access to the requested device capabilities, `Office.AsyncResultStatus.Failed` is returned in the `asyncResult.status` property.
5387
5392
  */
5388
5393
  requestPermissionsAsync(permissions: Office.DevicePermissionType[], options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult<boolean>) => void): void;
5389
5394
  /**
@@ -5400,9 +5405,6 @@ declare namespace Office {
5400
5405
  *
5401
5406
  * - For Excel, PowerPoint, and Word add-ins, use the `requestPermissions` method instead.
5402
5407
  *
5403
- * - If the user allows access to their camera, geolocation, or microphone, the add-in must be reloaded in the browser for the permissions to take effect.
5404
- * For example, you can call `window.location.reload()` to reload your add-in.
5405
- *
5406
5408
  * - If your add-in uses the same code for both Office on the web and Office desktop clients, verify the platform on which the add-in is running before calling `requestPermissionsAsync`.
5407
5409
  * Use {@link https://learn.microsoft.com/javascript/api/outlook/office.diagnostics#outlook-office-diagnostics-hostname-member | Office.context.mailbox.diagnostics.hostName}
5408
5410
  * and verify that it returns `OutlookWebApp`. Otherwise, the `requestPermissionsAsync` call will return an error.
@@ -5421,7 +5423,11 @@ declare namespace Office {
5421
5423
  * @param permissions An array of device capabilities to which an add-in is requesting access.
5422
5424
  * In Outlook on the web, an add-in can request access to a user's camera, geolocation, and microphone.
5423
5425
  * @param callback When the method completes, the function passed in the `callback` parameter is called with a single parameter, `asyncResult`, which is an `Office.AsyncResult` object.
5424
- * If the user grants permission to access the requested device capabilities, `true` is returned in the `asyncResult.value` property.
5426
+ * If the user grants permission to access the requested device capabilities, `true` is returned in the `asyncResult.value` property. You must then reload the add-in before you can
5427
+ * run code that uses the device capabilities. For example, you can call `window.location.reload()` to reload your add-in.
5428
+ * If the user had previously granted permission to access the requested device capabilities, `false` is returned in the `asyncResult.value` property. You don't need to
5429
+ * reload your add-in to run code that uses the device capability, as the permission is already set.
5430
+ * If a user denies access to the requested device capabilities, `Office.AsyncResultStatus.Failed` is returned in the `asyncResult.status` property.
5425
5431
  */
5426
5432
  requestPermissionsAsync(permissions: Office.DevicePermissionType[], callback: (asyncResult: Office.AsyncResult<boolean>) => void): void;
5427
5433
  }
office-js/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/office-js",
3
- "version": "1.0.397",
3
+ "version": "1.0.398",
4
4
  "description": "TypeScript definitions for office-js",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/office-js",
6
6
  "license": "MIT",
@@ -45,6 +45,6 @@
45
45
  },
46
46
  "scripts": {},
47
47
  "dependencies": {},
48
- "typesPublisherContentHash": "c2bc7f913306c9e07362511c68d64a6a3dd273bf998f8073b89c52606e112c0b",
48
+ "typesPublisherContentHash": "37a7569077637aaca7c8d6e0e8a1a27d42727374f9a17f1fe39297cf75b78aa0",
49
49
  "typeScriptVersion": "4.8"
50
50
  }