@types/office-js 1.0.474 → 1.0.475

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, 03 Mar 2025 21:02:17 GMT
11
+ * Last updated: Fri, 07 Mar 2025 19:02:31 GMT
12
12
  * Dependencies: none
13
13
 
14
14
  # Credits
office-js/index.d.ts CHANGED
@@ -241,6 +241,10 @@ declare namespace Office {
241
241
  * Represents the Auth interface.
242
242
  */
243
243
  const auth: Auth;
244
+ /**
245
+ * Represents the context menu object associated with the Office application.
246
+ */
247
+ const contextMenu: ContextMenu;
244
248
  /**
245
249
  * Represents the Device Permission interface.
246
250
  */
@@ -4744,12 +4748,71 @@ declare namespace Office {
4744
4748
  */
4745
4749
  version: string;
4746
4750
  }
4751
+ /**
4752
+ * Provides options to manage the state of the Office context menu.
4753
+ *
4754
+ * To learn more, see {@link https://learn.microsoft.com/office/dev/add-ins/design/disable-add-in-commands | Change the availability of add-in commands}.
4755
+ *
4756
+ * @remarks
4757
+ *
4758
+ * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/context-menu-api-requirement-sets | ContextMenuApi 1.1}
4759
+ */
4760
+ interface ContextMenu {
4761
+ /**
4762
+ * Sends a request to Office to update the context menu.
4763
+ *
4764
+ * @remarks
4765
+ *
4766
+ * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/context-menu-api-requirement-sets | ContextMenuApi 1.1}
4767
+ *
4768
+ * **Important**: This API is only used to request an update. The actual UI update to the context menu is controlled by the Office application,
4769
+ * so the exact timing of the context menu update (or refresh) can't be determined by the completion of this API.
4770
+ *
4771
+ * @param input - Represents the updates to be made to the context menu controls. Only the changes specified in the `control` parameter are made.
4772
+ * Other context menu controls that aren't specified remain as is in the Office application.
4773
+ */
4774
+ requestUpdate(input: ContextMenuUpdaterData): Promise<void>;
4775
+ }
4776
+ /**
4777
+ * Represents an individual context menu control and its state.
4778
+ *
4779
+ * To learn more, see {@link https://learn.microsoft.com/office/dev/add-ins/design/disable-add-in-commands | Change the availability of add-in commands}.
4780
+ *
4781
+ * @remarks
4782
+ *
4783
+ * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/context-menu-api-requirement-sets | ContextMenuApi 1.1}
4784
+ */
4785
+ interface ContextMenuControl {
4786
+ /**
4787
+ * Identifier of the context menu control as specified in the manifest.
4788
+ */
4789
+ id: string;
4790
+ /**
4791
+ * Indicates whether the control is available on the context menu.
4792
+ */
4793
+ enabled?: boolean;
4794
+ }
4795
+ /**
4796
+ * Represents the changes to the context menu.
4797
+ *
4798
+ * To learn more, see {@link https://learn.microsoft.com/office/dev/add-ins/design/disable-add-in-commands | Change the availability of add-in commands}.
4799
+ *
4800
+ * @remarks
4801
+ *
4802
+ * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/context-menu-api-requirement-sets | ContextMenuApi 1.1}
4803
+ */
4804
+ interface ContextMenuUpdaterData {
4805
+ /**
4806
+ * Collection of context menu controls whose state is set using `Office.contextMenu.requestUpdate`.
4807
+ */
4808
+ controls: ContextMenuControl[];
4809
+ }
4747
4810
  /**
4748
4811
  * Represents an individual control or command and the state it should have.
4749
4812
  *
4750
4813
  * @remarks
4751
4814
  *
4752
- * For code samples showing how to use a `Control` object and its properties, see {@link https://learn.microsoft.com/office/dev/add-ins/design/disable-add-in-commands | Enable and Disable Add-in Commands} and {@link https://learn.microsoft.com/office/dev/add-ins/design/contextual-tabs | Create custom contextual tabs}.
4815
+ * For code samples showing how to use a `Control` object and its properties, see {@link https://learn.microsoft.com/office/dev/add-ins/design/disable-add-in-commands | Change the availability of add-in commands} and {@link https://learn.microsoft.com/office/dev/add-ins/design/contextual-tabs | Create custom contextual tabs}.
4753
4816
  *
4754
4817
  * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/ribbon-api-requirement-sets | RibbonApi 1.1}
4755
4818
  */
@@ -7189,7 +7252,7 @@ declare namespace Office {
7189
7252
  *
7190
7253
  * Note that this API is only to request an update. The actual UI update to the ribbon is controlled by the Office application and hence the exact timing of the ribbon update (or refresh) cannot be determined by the completion of this API.
7191
7254
  *
7192
- * For code examples, see {@link https://learn.microsoft.com/office/dev/add-ins/design/disable-add-in-commands | Enable and Disable Add-in Commands} and {@link https://learn.microsoft.com/office/dev/add-ins/design/contextual-tabs | Create custom contextual tabs}.
7255
+ * For code examples, see {@link https://learn.microsoft.com/office/dev/add-ins/design/disable-add-in-commands | Change the availability of add-in commands} and {@link https://learn.microsoft.com/office/dev/add-ins/design/contextual-tabs | Create custom contextual tabs}.
7193
7256
  *
7194
7257
  * @param input - Represents the updates to be made to the ribbon. Note that only the changes specified in the input parameter are made.
7195
7258
  */
@@ -7736,7 +7799,7 @@ declare namespace Office {
7736
7799
  size: number;
7737
7800
  }
7738
7801
  /**
7739
- * Represents an individual tab and the state it should have. For code examples, see {@link https://learn.microsoft.com/office/dev/add-ins/design/disable-add-in-commands | Enable and Disable Add-in Commands} and {@link https://learn.microsoft.com/office/dev/add-ins/design/contextual-tabs | Create custom contextual tabs}.
7802
+ * Represents an individual tab and the state it should have. For code examples, see {@link https://learn.microsoft.com/office/dev/add-ins/design/disable-add-in-commands | Change the availability of add-in commands} and {@link https://learn.microsoft.com/office/dev/add-ins/design/contextual-tabs | Create custom contextual tabs}.
7740
7803
  *
7741
7804
  * @remarks
7742
7805
  *
office-js/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/office-js",
3
- "version": "1.0.474",
3
+ "version": "1.0.475",
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",
@@ -46,6 +46,6 @@
46
46
  "scripts": {},
47
47
  "dependencies": {},
48
48
  "peerDependencies": {},
49
- "typesPublisherContentHash": "2c3b0bb2b9e42aaf43a598224e667362fc47d07d0bfd07c5a58c7dc6e9a45a3d",
49
+ "typesPublisherContentHash": "de6360fcfb86983b5df792a9927bac4cb2eea5042e8ff0f4f4750574d157e866",
50
50
  "typeScriptVersion": "5.0"
51
51
  }