From cdf9084e9a1278b23a490fa76008fbace96ee389 Mon Sep 17 00:00:00 2001 From: Alex Jerabek Date: Mon, 11 Jun 2018 16:36:14 -0700 Subject: [PATCH 1/3] Adding Dialog oject --- types/office-js/index.d.ts | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/types/office-js/index.d.ts b/types/office-js/index.d.ts index e4cb2bb0cc..926b344a88 100644 --- a/types/office-js/index.d.ts +++ b/types/office-js/index.d.ts @@ -624,6 +624,7 @@ declare namespace Office { */ closeContainer(): void; } + /** * Provides information about what Requirement Sets are supported in current environment. */ @@ -634,7 +635,26 @@ declare namespace Office { * @param minVersion - The minimum required version; e.g., "1.4". */ isSetSupported(name: string, minVersion?: number): boolean; -} + } + + /** + * The object that is returned when `UI.displayDialogAsync` is called. + */ + interface Dialog { + /** + * Called from a parent page to close the corresponding dialog box. + */ + close(): void; + /** + * Registers an event handler. The two supported events are: + * + * - DialogMessageReceived. Triggered when the dialog box sends a message to its parent. + * + * - DialogEventReceived. Triggered when the dialog box has been closed or otherwise unloaded. + */ + addEventHandler(eventType: Office.EventType, handler: Function): void; + } + /** * Provides options for how a dialog is displayed. */ From 9831f24f344177a787b2fc42ba8e46d5ff59c466 Mon Sep 17 00:00:00 2001 From: Alex Jerabek Date: Wed, 13 Jun 2018 13:24:01 -0700 Subject: [PATCH 2/3] Switching to type rename --- types/office-js/index.d.ts | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/types/office-js/index.d.ts b/types/office-js/index.d.ts index 926b344a88..fc1e5fd974 100644 --- a/types/office-js/index.d.ts +++ b/types/office-js/index.d.ts @@ -637,24 +637,6 @@ declare namespace Office { isSetSupported(name: string, minVersion?: number): boolean; } - /** - * The object that is returned when `UI.displayDialogAsync` is called. - */ - interface Dialog { - /** - * Called from a parent page to close the corresponding dialog box. - */ - close(): void; - /** - * Registers an event handler. The two supported events are: - * - * - DialogMessageReceived. Triggered when the dialog box sends a message to its parent. - * - * - DialogEventReceived. Triggered when the dialog box has been closed or otherwise unloaded. - */ - addEventHandler(eventType: Office.EventType, handler: Function): void; - } - /** * Provides options for how a dialog is displayed. */ @@ -1048,11 +1030,11 @@ declare namespace Office { controlForegroundColor: string; } /** - * Dialog object returned as part of the displayDialogAsync callback. The object exposes methods for registering event handlers and closing the dialog + * The object that is returned when `UI.displayDialogAsync` is called. */ - interface DialogHandler { + interface Dialog { /** - * When called from an active add-in dialog, asynchronously closes the dialog. + * Called from a parent page to close the corresponding dialog box. */ close(): void; /** From 5431383a5123bda1b00130b0baf45e47a397032a Mon Sep 17 00:00:00 2001 From: Alex Jerabek Date: Wed, 13 Jun 2018 13:42:39 -0700 Subject: [PATCH 3/3] Embellishing comment --- types/office-js/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/office-js/index.d.ts b/types/office-js/index.d.ts index a54b1fdff0..daedd2040d 100644 --- a/types/office-js/index.d.ts +++ b/types/office-js/index.d.ts @@ -1030,7 +1030,7 @@ declare namespace Office { controlForegroundColor: string; } /** - * The object that is returned when `UI.displayDialogAsync` is called. + * The object that is returned when `UI.displayDialogAsync` is called. It exposes methods for registering event handlers and closing the dialog. */ interface Dialog { /**