@types/office-js 1.0.256 → 1.0.257

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: Wed, 25 May 2022 20:31:31 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.
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.257",
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": "2d92dbad8f40f4098e21c5cc5781ae00197f2b30872a3226547dbe9f37cdc055",
49
49
  "typeScriptVersion": "3.9"
50
50
  }