@types/office-js 1.0.256 → 1.0.259

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: Fri, 20 May 2022 21:01:43 GMT
11
+ * Last updated: Tue, 07 Jun 2022 18:31:33 GMT
12
12
  * Dependencies: none
13
13
  * Global values: `Excel`, `Office`, `OfficeCore`, `OfficeExtension`, `OneNote`, `PowerPoint`, `Visio`, `Word`
14
14
 
office-js/index.d.ts CHANGED
@@ -546,6 +546,53 @@ declare namespace Office {
546
546
  * @param actionFunction The function that is run when the action is invoked.
547
547
  */
548
548
  associate: (actionId: string, actionFunction: (arg?: any) => void) => void;
549
+ /**
550
+ * Replaces existing add-in shortcuts with custom shortcuts for the user.
551
+ *
552
+ * @remarks
553
+ *
554
+ * **Requirement sets**:
555
+ *
556
+ * - {@link https://docs.microsoft.com/javascript/api/requirement-sets/common/keyboard-shortcuts-requirement-sets | KeyboardShortcuts 1.1}
557
+ *
558
+ * - {@link https://docs.microsoft.com/javascript/api/requirement-sets/common/shared-runtime-requirement-sets | SharedRuntime 1.1}
559
+ *
560
+ * @param shortcuts An object of custom shortcuts with keys being the IDs of the actions (as defined in an extended manifest) and values being the shortcut combinations. For example, `{"SetItalic": "Ctrl+1", "SetBold": "Ctrl+2"}`.
561
+ * To learn how to specify a valid action ID and a key combination, see {@link https://docs.microsoft.com/office/dev/add-ins/design/keyboard-shortcuts | Add custom keyboard shortcuts to your Office Add-ins}. (Note that a key combination can be `null`, in which case, the action keeps the key combination specified in the JSON file.)
562
+ * @returns A promise that resolves when every custom shortcut assignment in `shortcuts` has been registered. Even if there is a conflict with existing shortcuts, the customized shortcut will be registered.
563
+ * Otherwise, the promise will be rejected with error code and error message. An "InvalidOperation" error code is returned if any action ID in `shortcuts` does not exist, or if shortcut combination is invalid.
564
+ */
565
+ replaceShortcuts(shortcuts: {[actionId: string]: string}): Promise<void>;
566
+ /**
567
+ * Gets the existing shortcuts for the add-in. The set always includes (1) the shortcuts defined in the add-in's extended manifest for keyboard shortcuts and (2) the current user's custom shortcuts if those exist.
568
+ * The shortcut can be `null` if it conflicts with the shortcut of another add-in or with the Office application. Specifically, it would be `null` if, when prompted to choose which shortcut to use, the user didn't choose the action of the current add-in. For more information about conflicts with shortcuts, see {@link https://docs.microsoft.com/office/dev/add-ins/design/keyboard-shortcuts#avoid-key-combinations-in-use-by-other-add-ins | Avoid key combinations in use by other add-ins}.
569
+ *
570
+ * @remarks
571
+ *
572
+ * **Requirement sets**:
573
+ *
574
+ * - {@link https://docs.microsoft.com/javascript/api/requirement-sets/common/keyboard-shortcuts-requirement-sets | KeyboardShortcuts 1.1}
575
+ *
576
+ * - {@link https://docs.microsoft.com/javascript/api/requirement-sets/common/shared-runtime-requirement-sets | SharedRuntime 1.1}
577
+ *
578
+ * @returns A promise that resolves to an object of shortcuts, with keys being the IDs of the actions (as defined in an extended manifest) and values being the shortcut combinations. For example, `{"SetItalic": "Ctrl+1", "SetBold": "Ctrl+2", "SetUnderline": null}`.
579
+ */
580
+ getShortcuts(): Promise<{[actionId: string]: string|null}>;
581
+ /**
582
+ * Checks if a set of shortcut combinations are currently in use for the user, as defined by another add-in or by the host Office application.
583
+ *
584
+ * @remarks
585
+ *
586
+ * **Requirement sets**:
587
+ *
588
+ * - {@link https://docs.microsoft.com/javascript/api/requirement-sets/common/keyboard-shortcuts-requirement-sets | KeyboardShortcuts 1.1}
589
+ *
590
+ * - {@link https://docs.microsoft.com/javascript/api/requirement-sets/common/shared-runtime-requirement-sets | SharedRuntime 1.1}
591
+ *
592
+ * @param shortcuts An array of shortcut combinations. For example, `["Ctrl+1", "Ctrl+2"]`.
593
+ * @returns A promise that resolves to an array of objects. Each object consists of a shortcut combination and Boolean value. The value is `true` if the shortcut combination conflicts with a shortcut of another add-in or with a shortcut of the Office application; otherwise, `false`. For example, `[{shortcut:"Ctrl+1", inUse:true},{shortcut:"Ctrl+2", inUse:false}]`.
594
+ */
595
+ areShortcutsInUse(shortcuts: string[]): Promise<{shortcut: string, inUse: boolean}[]>;
549
596
  }
550
597
  /**
551
598
  * Message used in the `onVisibilityModeChanged` invocation.
@@ -16826,7 +16873,7 @@ declare namespace Office {
16826
16873
  * **Important**: In Outlook on the web, if a user created a new message by activating a contact's email address link from their contact or
16827
16874
  * profile card, your add-in's `getAsync` call currently won't return a value in the `displayName` property of the
16828
16875
  * associated `EmailAddressDetails` object. For more details, refer to the
16829
- * {@link https://github.com/OfficeDev/office-js-docs-pr/issues/2962 | related GitHub issue}.
16876
+ * {@link https://github.com/OfficeDev/office-js/issues/2201 | related GitHub issue}.
16830
16877
  *
16831
16878
  * @remarks
16832
16879
  * [Api set: Mailbox 1.1]
@@ -16854,7 +16901,7 @@ declare namespace Office {
16854
16901
  * **Important**: In Outlook on the web, if a user created a new message by activating a contact's email address link from their contact or
16855
16902
  * profile card, your add-in's `getAsync` call currently won't return a value in the `displayName` property of the
16856
16903
  * associated `EmailAddressDetails` object. For more details, refer to the
16857
- * {@link https://github.com/OfficeDev/office-js-docs-pr/issues/2962 | related GitHub issue}.
16904
+ * {@link https://github.com/OfficeDev/office-js/issues/2201 | related GitHub issue}.
16858
16905
  *
16859
16906
  * @remarks
16860
16907
  * [Api set: Mailbox 1.1]
@@ -18353,17 +18400,17 @@ declare namespace OfficeExtension {
18353
18400
  const Promise: Office.IPromiseConstructor;
18354
18401
  type IPromise<T> = Promise<T>;
18355
18402
 
18356
- /** Collection of tracked objects, contained within a request context. See "context.trackedObjects" for more information. */
18403
+ /**
18404
+ * Collection of tracked objects, contained within a request context.
18405
+ * See {@link https://docs.microsoft.com/javascript/api/office/officeextension.clientrequestcontext#office-officeextension-clientrequestcontext-trackedobjects-member | context.trackedObjects}
18406
+ * for more information.
18407
+ */
18357
18408
  class TrackedObjects {
18358
18409
  /**
18359
18410
  * Track a new object for automatic adjustment based on surrounding changes in the document. Only some object types require this.
18360
18411
  * If you are using an object across ".sync" calls and outside the sequential execution of a ".run" batch,
18361
18412
  * and get an "InvalidObjectPath" error when setting a property or invoking a method on the object, you needed to have added the object
18362
18413
  * to the tracked object collection when the object was first created.
18363
- *
18364
- * This method also has the following signature:
18365
- *
18366
- * `add(objects: ClientObject[]): void;` Where objects is an array of objects to be tracked.
18367
18414
  */
18368
18415
  add(object: ClientObject): void;
18369
18416
  /**
@@ -18377,10 +18424,6 @@ declare namespace OfficeExtension {
18377
18424
  * Release the memory associated with an object that was previously added to this collection.
18378
18425
  * Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them.
18379
18426
  * You will need to call `context.sync()` before the memory release takes effect.
18380
- *
18381
- * This method also has the following signature:
18382
- *
18383
- * `remove(objects: ClientObject[]): void;` Where objects is an array of objects to be removed.
18384
18427
  */
18385
18428
  remove(object: ClientObject): void;
18386
18429
  /**
office-js/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/office-js",
3
- "version": "1.0.256",
3
+ "version": "1.0.259",
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": "f128a0a38eefbfdc81f6ef75e1d4996dd2aea6e4617893ecbacb5276d05d69d2",
48
+ "typesPublisherContentHash": "002bef8261aa095a639006649d8b878116411db7ba60955ac573ab1416c85a4f",
49
49
  "typeScriptVersion": "3.9"
50
50
  }