@types/office-js 1.0.387 → 1.0.388
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 +1 -1
- office-js/index.d.ts +172 -0
- office-js/package.json +2 -2
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: Thu,
|
|
11
|
+
* Last updated: Thu, 16 May 2024 19:06:38 GMT
|
|
12
12
|
* Dependencies: none
|
|
13
13
|
|
|
14
14
|
# Credits
|
office-js/index.d.ts
CHANGED
|
@@ -496,6 +496,43 @@ declare namespace Office {
|
|
|
496
496
|
*/
|
|
497
497
|
Text,
|
|
498
498
|
}
|
|
499
|
+
/**
|
|
500
|
+
* Specifies the device capability to which an add-in is requesting access.
|
|
501
|
+
*
|
|
502
|
+
* @remarks
|
|
503
|
+
*
|
|
504
|
+
* **Applications**: This API is supported by the following Office applications when running in Chromium-based browsers,
|
|
505
|
+
* such as Microsoft Edge and Google Chrome.
|
|
506
|
+
*
|
|
507
|
+
* - Excel on the web
|
|
508
|
+
*
|
|
509
|
+
* - Outlook on the web
|
|
510
|
+
*
|
|
511
|
+
* - PowerPoint on the web
|
|
512
|
+
*
|
|
513
|
+
* - Word on the web
|
|
514
|
+
*
|
|
515
|
+
* It's also supported in
|
|
516
|
+
* {@link https://support.microsoft.com/office/656bb8d9-5a60-49b2-a98b-ba7822bc7627 | new Outlook on Windows (preview)}.
|
|
517
|
+
*
|
|
518
|
+
* **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/device-permission-service-requirement-sets | DevicePermission 1.1}
|
|
519
|
+
*/
|
|
520
|
+
enum DevicePermissionType {
|
|
521
|
+
/**
|
|
522
|
+
* The add-in is requesting access to the user's camera.
|
|
523
|
+
*/
|
|
524
|
+
camera,
|
|
525
|
+
/**
|
|
526
|
+
* The add-in is requesting access to the user's geolocation.
|
|
527
|
+
*
|
|
528
|
+
* **Important**: Access to a user's geolocation is only supported in Outlook on the web and new Outlook on Windows (preview).
|
|
529
|
+
*/
|
|
530
|
+
geolocation,
|
|
531
|
+
/**
|
|
532
|
+
* The add-in is requesting access to the user's microphone.
|
|
533
|
+
*/
|
|
534
|
+
microphone
|
|
535
|
+
}
|
|
499
536
|
/**
|
|
500
537
|
* Specifies whether the document in the associated application is read-only or read-write.
|
|
501
538
|
*
|
|
@@ -5170,6 +5207,141 @@ declare namespace Office {
|
|
|
5170
5207
|
*/
|
|
5171
5208
|
getPrefixAsync(ns: string, callback?: (result: AsyncResult<string>) => void): void;
|
|
5172
5209
|
}
|
|
5210
|
+
/**
|
|
5211
|
+
* Provides methods for an add-in to request permission from a user to access their device capabilities.
|
|
5212
|
+
* A user's device capabilities include their camera, geolocation, and microphone.
|
|
5213
|
+
*
|
|
5214
|
+
* @remarks
|
|
5215
|
+
*
|
|
5216
|
+
* **Applications**: This API is supported by the following Office applications when running in Chromium-based browsers,
|
|
5217
|
+
* such as Microsoft Edge and Google Chrome.
|
|
5218
|
+
*
|
|
5219
|
+
* - Excel on the web
|
|
5220
|
+
*
|
|
5221
|
+
* - Outlook on the web
|
|
5222
|
+
*
|
|
5223
|
+
* - PowerPoint on the web
|
|
5224
|
+
*
|
|
5225
|
+
* - Word on the web
|
|
5226
|
+
*
|
|
5227
|
+
* It's also supported in
|
|
5228
|
+
* {@link https://support.microsoft.com/office/656bb8d9-5a60-49b2-a98b-ba7822bc7627 | new Outlook on Windows (preview)}.
|
|
5229
|
+
*
|
|
5230
|
+
* **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/device-permission-service-requirement-sets | DevicePermission 1.1}
|
|
5231
|
+
*/
|
|
5232
|
+
interface DevicePermission {
|
|
5233
|
+
/**
|
|
5234
|
+
* Requests permission from a user to access their device capabilities, such as a camera or microphone.
|
|
5235
|
+
*
|
|
5236
|
+
* All the requested permissions are displayed in a single modal dialog to the user.
|
|
5237
|
+
* The dialog includes options to **Allow**, **Allow once**, or **Deny** the requested permissions.
|
|
5238
|
+
*
|
|
5239
|
+
* This method returns a promise. Use it with Excel, PowerPoint, and Word add-ins.
|
|
5240
|
+
*
|
|
5241
|
+
* @remarks
|
|
5242
|
+
*
|
|
5243
|
+
* **Important**:
|
|
5244
|
+
*
|
|
5245
|
+
* - This method isn't supported in Outlook add-ins. Use the `requestPermissionsAsync` method instead.
|
|
5246
|
+
*
|
|
5247
|
+
* - 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 `requestPermissions`.
|
|
5248
|
+
* Use {@link https://learn.microsoft.com/javascript/api/office/office.context#office-office-context-platform-member | Office.context.platform} and verify that it returns
|
|
5249
|
+
* `Office.PlatformType.OfficeOnline`. Otherwise, the `requestPermissions` call will return an error.
|
|
5250
|
+
*
|
|
5251
|
+
* - 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.
|
|
5252
|
+
* For example, you can call `window.location.reload()` to reload your add-in.
|
|
5253
|
+
*
|
|
5254
|
+
* - If a user selects **Allow** from the dialog, the permission persists until the add-in is uninstalled or until the
|
|
5255
|
+
* 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,
|
|
5256
|
+
* they must uninstall the add-in or clear their browser cache.
|
|
5257
|
+
*
|
|
5258
|
+
* - If a user selects **Allow Once** from the dialog, the permission persists until the browser tab or window in which the add-in is running is closed.
|
|
5259
|
+
*
|
|
5260
|
+
* - If a user selects **Deny** from the dialog, the user will be requested for permissions again the next time the add-in requires access to the user's device capabilities.
|
|
5261
|
+
*
|
|
5262
|
+
* @param permissions An array of device capabilities to which an add-in is requesting access.
|
|
5263
|
+
* In web versions of Excel, PowerPoint, and Word, add-ins can only request access to a user's camera and microphone.
|
|
5264
|
+
* Access to a user's geolocation is blocked.
|
|
5265
|
+
*/
|
|
5266
|
+
requestPermissions(permissions: Office.DevicePermissionType[]): Promise<boolean>;
|
|
5267
|
+
/**
|
|
5268
|
+
* Requests permission from a user to access their device capabilities, such as a camera, geolocation, or microphone.
|
|
5269
|
+
*
|
|
5270
|
+
* All the requested permissions are displayed in a single modal dialog to the user.
|
|
5271
|
+
* The dialog includes options to **Allow**, **Allow once**, or **Deny** the requested permissions.
|
|
5272
|
+
*
|
|
5273
|
+
* This method accepts a callback function. Use it with Outlook add-ins.
|
|
5274
|
+
*
|
|
5275
|
+
* @remarks
|
|
5276
|
+
*
|
|
5277
|
+
* **Important**:
|
|
5278
|
+
*
|
|
5279
|
+
* - For Excel, PowerPoint, and Word add-ins, use the `requestPermissions` method instead.
|
|
5280
|
+
*
|
|
5281
|
+
* - 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.
|
|
5282
|
+
* For example, you can call `window.location.reload()` to reload your add-in.
|
|
5283
|
+
*
|
|
5284
|
+
* - 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`.
|
|
5285
|
+
* Use {@link https://learn.microsoft.com/javascript/api/outlook/office.diagnostics#outlook-office-diagnostics-hostname-member | Office.context.mailbox.diagnostics.hostName}
|
|
5286
|
+
* and verify that it returns `OutlookWebApp`. Otherwise, the `requestPermissionsAsync` call will return an error.
|
|
5287
|
+
*
|
|
5288
|
+
* - If a user selects **Allow** from the dialog, the permission persists until the add-in is uninstalled or until the
|
|
5289
|
+
* 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,
|
|
5290
|
+
* they must uninstall the add-in or clear their browser cache.
|
|
5291
|
+
*
|
|
5292
|
+
* - If a user selects **Allow Once** from the dialog, the permission persists until the browser tab or window in which the add-in is running is closed.
|
|
5293
|
+
*
|
|
5294
|
+
* - If a user selects **Deny** from the dialog, the user will be requested for permissions again the next time the add-in requires access to the user's device capabilities.
|
|
5295
|
+
*
|
|
5296
|
+
* - If your add-in implements {@link https://learn.microsoft.com/office/dev/add-ins/outlook/autolaunch | event-based activation},
|
|
5297
|
+
* browser permissions to device capabilities aren't inherited and the `requestPermissionsAsync` method isn't supported.
|
|
5298
|
+
*
|
|
5299
|
+
* @param permissions An array of device capabilities to which an add-in is requesting access.
|
|
5300
|
+
* In Outlook on the web, an add-in can request access to a user's camera, geolocation, and microphone.
|
|
5301
|
+
* @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.
|
|
5302
|
+
* @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.
|
|
5303
|
+
* If the user grants permission to access the requested device capabilities, `true` is returned in the `asyncResult.value` property.
|
|
5304
|
+
*/
|
|
5305
|
+
requestPermissionsAsync(permissions: Office.DevicePermissionType[], options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult<boolean>) => void): void;
|
|
5306
|
+
/**
|
|
5307
|
+
* Requests permission from a user to access their device capabilities, such as a camera, geolocation, or microphone.
|
|
5308
|
+
*
|
|
5309
|
+
* All the requested permissions are displayed in a single modal dialog to the user.
|
|
5310
|
+
* The dialog includes options to **Allow**, **Allow once**, or **Deny** the requested permissions.
|
|
5311
|
+
*
|
|
5312
|
+
* This method accepts a callback function. Use it with Outlook add-ins.
|
|
5313
|
+
*
|
|
5314
|
+
* @remarks
|
|
5315
|
+
*
|
|
5316
|
+
* **Important**:
|
|
5317
|
+
*
|
|
5318
|
+
* - For Excel, PowerPoint, and Word add-ins, use the `requestPermissions` method instead.
|
|
5319
|
+
*
|
|
5320
|
+
* - 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.
|
|
5321
|
+
* For example, you can call `window.location.reload()` to reload your add-in.
|
|
5322
|
+
*
|
|
5323
|
+
* - 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`.
|
|
5324
|
+
* Use {@link https://learn.microsoft.com/javascript/api/outlook/office.diagnostics#outlook-office-diagnostics-hostname-member | Office.context.mailbox.diagnostics.hostName}
|
|
5325
|
+
* and verify that it returns `OutlookWebApp`. Otherwise, the `requestPermissionsAsync` call will return an error.
|
|
5326
|
+
*
|
|
5327
|
+
* - If a user selects **Allow** from the dialog, the permission persists until the add-in is uninstalled or until the
|
|
5328
|
+
* 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,
|
|
5329
|
+
* they must uninstall the add-in or clear their browser cache.
|
|
5330
|
+
*
|
|
5331
|
+
* - If a user selects **Allow Once** from the dialog, the permission persists until the browser tab or window in which the add-in is running is closed.
|
|
5332
|
+
*
|
|
5333
|
+
* - If a user selects **Deny** from the dialog, the user will be requested for permissions again the next time the add-in requires access to the user's device capabilities.
|
|
5334
|
+
*
|
|
5335
|
+
* - If your add-in implements {@link https://learn.microsoft.com/office/dev/add-ins/outlook/autolaunch | event-based activation},
|
|
5336
|
+
* browser permissions to device capabilities aren't inherited and the `requestPermissionsAsync` method isn't supported.
|
|
5337
|
+
*
|
|
5338
|
+
* @param permissions An array of device capabilities to which an add-in is requesting access.
|
|
5339
|
+
* In Outlook on the web, an add-in can request access to a user's camera, geolocation, and microphone.
|
|
5340
|
+
* @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.
|
|
5341
|
+
* If the user grants permission to access the requested device capabilities, `true` is returned in the `asyncResult.value` property.
|
|
5342
|
+
*/
|
|
5343
|
+
requestPermissionsAsync(permissions: Office.DevicePermissionType[], callback: (asyncResult: Office.AsyncResult<boolean>) => void): void;
|
|
5344
|
+
}
|
|
5173
5345
|
/**
|
|
5174
5346
|
* The object that is returned when `UI.displayDialogAsync` is called. It exposes methods for registering event handlers and closing the dialog.
|
|
5175
5347
|
*
|
office-js/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/office-js",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.388",
|
|
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": "
|
|
48
|
+
"typesPublisherContentHash": "3d00cf2e80eed742197c9fe68e453549b14d17f2e8d483d1a1f2a6f644aab4e8",
|
|
49
49
|
"typeScriptVersion": "4.7"
|
|
50
50
|
}
|