From 3d26b490c53a41596cb2bcf86d6d752c7b3cb97d Mon Sep 17 00:00:00 2001 From: Alex Jerabek Date: Wed, 6 Jun 2018 16:57:10 -0700 Subject: [PATCH 1/3] 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. From d419bddbce227a24126bce0581728d1f70643479 Mon Sep 17 00:00:00 2001 From: Alex Jerabek Date: Mon, 11 Jun 2018 15:57:22 -0700 Subject: [PATCH 2/3] Office function descriptions --- types/office-js/index.d.ts | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/types/office-js/index.d.ts b/types/office-js/index.d.ts index 4d06e7b764..d9a54c2331 100644 --- a/types/office-js/index.d.ts +++ b/types/office-js/index.d.ts @@ -240,8 +240,20 @@ declare namespace Office { */ var context: Context; /** - * This method is called after the Office API was loaded. - * @param reason Indicates how the app was initialized + * Occurs when the runtime environment is loaded and the add-in is ready to start interacting with the application and hosted document. + * + * The reason parameter of the initialize event listener function returns an `InitializationReason` enumeration value that specifies how initialization occurred. A task pane or content add-in can be initialized in two ways: + * + * - The user just inserted it from Recently Used Add-ins section of the Add-in drop-down list on the Insert tab of the ribbon in the Office host application, or from Insert add-in dialog box. + * + * - The user opened a document that already contains the add-in. + * + * *Note*: The reason parameter of the initialize event listener function only returns an `InitializationReason` enumeration value for task pane and content add-ins. It does not return a value for Outlook add-ins. + * + * @remarks + * Hosts: Access, Excel, Outlook, PowerPoint, Project, Word + * + * @param reason Indicates how the app was initialized. */ function initialize(reason: InitializationReason): void; /** @@ -252,8 +264,9 @@ declare namespace Office { */ function onReady(callback?: (info: { host: HostType, platform: PlatformType }) => any): Promise<{ host: HostType, platform: PlatformType }>; /** - * Indicates if the large namespace for objects will be used or not. - * @param useShortNamespace Indicates if 'true' that the short namespace will be used + * Toggles on and off the `Office` alias for the full `Microsoft.Office.WebExtension` namespace. + * + * @param useShortNamespace True to use the shortcut alias; otherwise false to disable it. The default is true. */ function useShortNamespace(useShortNamespace: boolean): void; // Enumerations From caf2c31222ccc68c405b0a5f566d7b5cdbb875c9 Mon Sep 17 00:00:00 2001 From: Alex Jerabek Date: Mon, 11 Jun 2018 15:59:34 -0700 Subject: [PATCH 3/3] Office function descriptions --- types/office-js/index.d.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/types/office-js/index.d.ts b/types/office-js/index.d.ts index d9a54c2331..17bb3dcb55 100644 --- a/types/office-js/index.d.ts +++ b/types/office-js/index.d.ts @@ -266,6 +266,9 @@ declare namespace Office { /** * Toggles on and off the `Office` alias for the full `Microsoft.Office.WebExtension` namespace. * + * @remarks + * Hosts: Access, Excel, Outlook, PowerPoint, Project, Word + * * @param useShortNamespace True to use the shortcut alias; otherwise false to disable it. The default is true. */ function useShortNamespace(useShortNamespace: boolean): void;