@types/office-js-preview 1.0.567 → 1.0.568

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.
@@ -8,7 +8,7 @@ This package contains type definitions for office-js-preview (https://github.com
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/office-js-preview.
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
@@ -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
  */
@@ -4796,12 +4800,71 @@ declare namespace Office {
4796
4800
  */
4797
4801
  version: string;
4798
4802
  }
4803
+ /**
4804
+ * Provides options to manage the state of the Office context menu.
4805
+ *
4806
+ * 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}.
4807
+ *
4808
+ * @remarks
4809
+ *
4810
+ * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/context-menu-api-requirement-sets | ContextMenuApi 1.1}
4811
+ */
4812
+ interface ContextMenu {
4813
+ /**
4814
+ * Sends a request to Office to update the context menu.
4815
+ *
4816
+ * @remarks
4817
+ *
4818
+ * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/context-menu-api-requirement-sets | ContextMenuApi 1.1}
4819
+ *
4820
+ * **Important**: This API is only used to request an update. The actual UI update to the context menu is controlled by the Office application,
4821
+ * so the exact timing of the context menu update (or refresh) can't be determined by the completion of this API.
4822
+ *
4823
+ * @param input - Represents the updates to be made to the context menu controls. Only the changes specified in the `control` parameter are made.
4824
+ * Other context menu controls that aren't specified remain as is in the Office application.
4825
+ */
4826
+ requestUpdate(input: ContextMenuUpdaterData): Promise<void>;
4827
+ }
4828
+ /**
4829
+ * Represents an individual context menu control and its state.
4830
+ *
4831
+ * 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}.
4832
+ *
4833
+ * @remarks
4834
+ *
4835
+ * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/context-menu-api-requirement-sets | ContextMenuApi 1.1}
4836
+ */
4837
+ interface ContextMenuControl {
4838
+ /**
4839
+ * Identifier of the context menu control as specified in the manifest.
4840
+ */
4841
+ id: string;
4842
+ /**
4843
+ * Indicates whether the control is available on the context menu.
4844
+ */
4845
+ enabled?: boolean;
4846
+ }
4847
+ /**
4848
+ * Represents the changes to the context menu.
4849
+ *
4850
+ * 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}.
4851
+ *
4852
+ * @remarks
4853
+ *
4854
+ * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/context-menu-api-requirement-sets | ContextMenuApi 1.1}
4855
+ */
4856
+ interface ContextMenuUpdaterData {
4857
+ /**
4858
+ * Collection of context menu controls whose state is set using `Office.contextMenu.requestUpdate`.
4859
+ */
4860
+ controls: ContextMenuControl[];
4861
+ }
4799
4862
  /**
4800
4863
  * Represents an individual control or command and the state it should have.
4801
4864
  *
4802
4865
  * @remarks
4803
4866
  *
4804
- * 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}.
4867
+ * 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}.
4805
4868
  *
4806
4869
  * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/ribbon-api-requirement-sets | RibbonApi 1.1}
4807
4870
  */
@@ -7241,7 +7304,7 @@ declare namespace Office {
7241
7304
  *
7242
7305
  * 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.
7243
7306
  *
7244
- * 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}.
7307
+ * 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}.
7245
7308
  *
7246
7309
  * @param input - Represents the updates to be made to the ribbon. Note that only the changes specified in the input parameter are made.
7247
7310
  */
@@ -7788,7 +7851,7 @@ declare namespace Office {
7788
7851
  size: number;
7789
7852
  }
7790
7853
  /**
7791
- * 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}.
7854
+ * 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}.
7792
7855
  *
7793
7856
  * @remarks
7794
7857
  *
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/office-js-preview",
3
- "version": "1.0.567",
3
+ "version": "1.0.568",
4
4
  "description": "TypeScript definitions for office-js-preview",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/office-js-preview",
6
6
  "license": "MIT",
@@ -46,7 +46,7 @@
46
46
  "scripts": {},
47
47
  "dependencies": {},
48
48
  "peerDependencies": {},
49
- "typesPublisherContentHash": "8625596e178729788e6de5efa32f735bdc356ea3626434235160a164a3c3eaea",
49
+ "typesPublisherContentHash": "55303deb46122e7e5c7be11ec19047b0ce2df9076fa752d055270cba0c2f0566",
50
50
  "typeScriptVersion": "5.0",
51
51
  "nonNpm": true
52
52
  }