@types/office-js 1.0.305 → 1.0.306

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: Tue, 06 Dec 2022 20:32:55 GMT
11
+ * Last updated: Mon, 12 Dec 2022 21:49:43 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
@@ -653,6 +653,61 @@ declare namespace Office {
653
653
  onVisibilityModeChanged(
654
654
  handler: (message: VisibilityModeChangedMessage) => void,
655
655
  ): Promise<() => Promise<void>>;
656
+ /**
657
+ * Represents a modal notification dialog that can appear when the user attempts to close a document. The document won't close until the user responds.
658
+ * This API is only supported in Excel.
659
+ *
660
+ * @remarks
661
+ * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/shared-runtime-requirement-sets | SharedRuntime 1.2}
662
+ */
663
+ beforeDocumentCloseNotification: BeforeDocumentCloseNotification;
664
+ }
665
+ /**
666
+ * Represents a modal notification dialog that can appear when the user attempts to close a document. The document won't close until the user responds.
667
+ * The notification dialog will allow the user to confirm the request to close the document or cancel the request to close the document.
668
+ * This API is only supported in Excel.
669
+ *
670
+ * @remarks
671
+ * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/shared-runtime-requirement-sets | SharedRuntime 1.2}
672
+ */
673
+ interface BeforeDocumentCloseNotification {
674
+ /**
675
+ * Enable a modal notification dialog that appears when the user attempts to close a document. The document won't close until the user responds.
676
+ * This notification dialog asks the user to confirm the request to close the document, or allows the user to cancel the request to close the document.
677
+ * The `BeforeDocumentCloseNotification` API is only supported in Excel.
678
+ *
679
+ * @remarks
680
+ * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/shared-runtime-requirement-sets | SharedRuntime 1.2}
681
+ */
682
+ enable(): Promise<void>;
683
+
684
+ /**
685
+ * Prevents the notification dialog from appearing when the user attempts to close a document.
686
+ * The `BeforeDocumentCloseNotification` API is only supported in Excel.
687
+ *
688
+ * @remarks
689
+ * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/shared-runtime-requirement-sets | SharedRuntime 1.2}
690
+ */
691
+ disable(): Promise<void>;
692
+
693
+ /**
694
+ * Adds an event handler that detects when the `BeforeDocumentCloseNotification` close operation is cancelled.
695
+ * This event handler will be triggered if both of the following conditions are met.
696
+ *
697
+ * 1. The add-in calls the `enable` method on the `BeforeDocumentCloseNotification` object.
698
+ *
699
+ * 2. When the notification dialog is open, the end user clicks the **Don't close** button within the dialog, clicks the Close button in the upper right corner of the dialog, or presses the Esc key.
700
+ *
701
+ * The `BeforeDocumentCloseNotification` API is only supported in Excel.
702
+ * @param handler The event handler that is called when the dialog is cancelled.
703
+ * @returns A promise that resolves when the event handler is added.
704
+ *
705
+ * @remarks
706
+ * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/shared-runtime-requirement-sets | SharedRuntime 1.2}
707
+ */
708
+ onCloseActionCancelled(
709
+ handler: () => void
710
+ ): Promise<() => Promise<void>>;
656
711
  }
657
712
  /**
658
713
  * An interface that contains all the functionality provided to manage the state of the Office ribbon.
office-js/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/office-js",
3
- "version": "1.0.305",
3
+ "version": "1.0.306",
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": "24d36736ef95e23c53387a10258c67a09c1ca2f36d474731842dad90e8de4fac",
48
+ "typesPublisherContentHash": "9cd40f17dd505e2505b98cd7849e9fe331bc7a055eb2e2a202dc3a0f95146f69",
49
49
  "typeScriptVersion": "4.2"
50
50
  }