From 3d26b490c53a41596cb2bcf86d6d752c7b3cb97d Mon Sep 17 00:00:00 2001 From: Alex Jerabek Date: Wed, 6 Jun 2018 16:57:10 -0700 Subject: [PATCH] Event class documentation --- types/office-js/index.d.ts | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/types/office-js/index.d.ts b/types/office-js/index.d.ts index 5af6916816..4d06e7b764 100644 --- a/types/office-js/index.d.ts +++ b/types/office-js/index.d.ts @@ -523,7 +523,7 @@ declare namespace Office { */ name: string; } - export namespace AddinCommands { + namespace AddinCommands { /** * The event object is passed as a parameter to add-in functions invoked by UI-less command buttons. The object allows the add-in to identify which button was clicked and to signal the host that it has completed its processing. * @@ -539,8 +539,13 @@ declare namespace Office { * * Applicable Outlook mode: Compose or Read */ - export interface Event { + interface Event { + /** + * Information about the control that triggered calling this function + */ + source:Source; + /** * Indicates that the add-in has completed processing that was triggered by an add-in command button or event handler. * @@ -561,6 +566,17 @@ declare namespace Office { */ completed(options?: any): void; } + + /** + * Encapsulates source data for add-in events. + */ + interface Source { + + /** + * The id of the control that triggered calling this function. The id comes from the manifest and is the unique ID of your Office Add-in as a GUID. + */ + id: string; + } } /** * Provides objects and methods that you can use to create and manipulate UI components, such as dialog boxes, in your Office Add-ins.