diff --git a/types/office-js/index.d.ts b/types/office-js/index.d.ts index 9a2f8981a5..809a710809 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,12 @@ 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. + * + * @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; // Enumerations @@ -523,7 +539,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 +555,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 +582,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.