office-js, office-js-preview: enhance Dialog event handler (#46679)

* office-js, office-js-preview: enhance Dialog event handler

* review change
This commit is contained in:
Rick-Kirkham 2020-08-11 16:02:58 -07:00 committed by GitHub
parent 25dd86eff6
commit 26091d6853
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 3 deletions

View File

@ -894,7 +894,7 @@ declare namespace Office {
* @param options Optional. Provides an option for preserving context data of any type, unchanged, for use in a callback.
* @param callback Optional. A function that is invoked when the handler registration returns, whose only parameter is of type {@link Office.AsyncResult}.
*/
addHandlerAsync(eventType: Office.EventType, handler: (result: any) => void, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult<void>) => void): void;
addHandlerAsync(eventType: Office.EventType, handler: (result: DialogParentMessageReceivedEventArgs) => void, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult<void>) => void): void;
/**
* Displays a dialog to show or collect information from the user or to facilitate Web navigation.
*
@ -1659,8 +1659,11 @@ declare namespace Office {
* - DialogMessageReceived. Triggered when the dialog box sends a message to its parent.
*
* - DialogEventReceived. Triggered when the dialog box has been closed or otherwise unloaded.
*
* @param eventType Must be either DialogMessageReceived or DialogEventReceived.
* @param handler A function which accepts either an object with a `message` property, if eventType is DialogMessageReceived, or an object with an `error` property, if eventType is DialogEventReceived.
*/
addEventHandler(eventType: Office.EventType, handler: Function): void;
addEventHandler(eventType: Office.EventType, handler: (args: {message: string | boolean} | {error: number}) => void): void;
/**
* Delivers a message from the host page, such as a task pane or a UI-less function file, to a dialog that was opened from the page.
*

View File

@ -1422,8 +1422,11 @@ declare namespace Office {
* - DialogMessageReceived. Triggered when the dialog box sends a message to its parent.
*
* - DialogEventReceived. Triggered when the dialog box has been closed or otherwise unloaded.
*
* @param eventType Must be either DialogMessageReceived or DialogEventReceived.
* @param handler A function which accepts either an object with a `message` property, if eventType is DialogMessageReceived, or an object with an `error` property, if eventType is DialogEventReceived.
*/
addEventHandler(eventType: Office.EventType, handler: Function): void;
addEventHandler(eventType: Office.EventType, handler: (args: {message: string | boolean} | {error: number}) => void): void;
/**
* FOR INTERNAL USE ONLY. DO NOT CALL IN YOUR CODE.
*/