From 66feddd421cd0b19f6d6d87295fa06aaab2b1e77 Mon Sep 17 00:00:00 2001 From: AbdulKareem Nalband Date: Fri, 6 Oct 2017 23:34:47 +0530 Subject: [PATCH] fixes #19554 Office js function overloads for optional parameters (#20074) * fixes #19554 @OfficeDev * Fixed review changes removed unused parameter docs Removed no op overloads --- types/office-js/index.d.ts | 727 ++++++++++++++++++++++++++++--------- 1 file changed, 547 insertions(+), 180 deletions(-) diff --git a/types/office-js/index.d.ts b/types/office-js/index.d.ts index 252e8b4512..fef494614f 100644 --- a/types/office-js/index.d.ts +++ b/types/office-js/index.d.ts @@ -149,25 +149,43 @@ declare namespace Office { name: string; } export interface UI { + /** + * Displays a dialog to show or collect information from the user or to facilitate Web navigation. + * @param startAddress Accepts the initial HTTPS Url that opens in the dialog. + */ + displayDialogAsync(startAddress: string): void; + /** + * Displays a dialog to show or collect information from the user or to facilitate Web navigation. + * @param startAddress Accepts the initial HTTPS Url that opens in the dialog. + * @param options Optional. Accepts a DialogOptions object to define dialog behaviors. + */ + displayDialogAsync(startAddress: string, options: DialogOptions): void; + /** + * Displays a dialog to show or collect information from the user or to facilitate Web navigation. + * @param startAddress Accepts the initial HTTPS Url that opens in the dialog. + * @param callback Optional. Accepts a callback method to handle the dialog creation attempt. + */ + displayDialogAsync(startAddress: string, callback: (result: AsyncResult) => void): void; /** * Displays a dialog to show or collect information from the user or to facilitate Web navigation. * @param startAddress Accepts the initial HTTPS Url that opens in the dialog. * @param options Optional. Accepts a DialogOptions object to define dialog behaviors. * @param callback Optional. Accepts a callback method to handle the dialog creation attempt. */ - displayDialogAsync(startAddress: string, options?: DialogOptions, callback?: (result: AsyncResult) => void): void; + displayDialogAsync(startAddress: string, options: DialogOptions, callback: (result: AsyncResult) => void): void; + /** * Synchronously delivers a message from the dialog to its parent add-in. * @param messageObject Accepts a message from the dialog to deliver to the add-in. */ messageParent(messageObject: any): void; /** - * Closes the UI container where the JavaScript is executing. + * Closes the UI container where the JavaScript is executing. * The behavior of this method is specified by the following table. * When called from Behavior * A UI-less command button No effect. Any dialogs opened by displayDialogAsync will remain open. * A taskpane The taskpane will close. Any dialogs opened by displayDialogAsync will also close. If the taskpane supports pinning and was pinned by the user, it will be un-pinned. - * A module extension No effect. + * A module extension No effect. */ closeContainer(): void; } @@ -186,12 +204,18 @@ declare namespace Office { displayInIframe?: boolean } export interface Auth { + /** + * Obtains an access token from AAD V 2.0 endpoint to grant the Office host application access to the add-in's web application. + * @param callback Optional. Accepts a callback method to handle the token acquisition attempt. If AsyncResult.status is "succeeded", then AsyncResult.value is the raw AAD v. 2.0-formatted access token. + */ + getAccessTokenAsync(callback: (result: AsyncResult) => void): void; /** * Obtains an access token from AAD V 2.0 endpoint to grant the Office host application access to the add-in's web application. * @param options Optional. Accepts an AuthOptions object to define sign-on behaviors. * @param callback Optional. Accepts a callback method to handle the token acquisition attempt. If AsyncResult.status is "succeeded", then AsyncResult.value is the raw AAD v. 2.0-formatted access token. */ - getAccessTokenAsync(options?: AuthOptions, callback?: (result: AsyncResult) => void): void; + getAccessTokenAsync(options: AuthOptions, callback: (result: AsyncResult) => void): void; + } export interface AuthOptions { /** @@ -203,7 +227,7 @@ declare namespace Office { */ forceAddAccount?: boolean, /** - * Optional. Causes Office to prompt the user to provide the additional factor when the tenancy being targeted by Microsoft Graph requires multifactor authentication. The string value identifies the type of additional factor that is required. In most cases, you won't know at development time whether the user's tenant requires an additional factor or what the string should be. So this option would be used in a "second try" call of getAccessTokenAsync after Microsoft Graph has sent an error requesting the additional factor and containing the string that should be used with the authChallenge option. + * Optional. Causes Office to prompt the user to provide the additional factor when the tenancy being targeted by Microsoft Graph requires multifactor authentication. The string value identifies the type of additional factor that is required. In most cases, you won't know at development time whether the user's tenant requires an additional factor or what the string should be. So this option would be used in a "second try" call of getAccessTokenAsync after Microsoft Graph has sent an error requesting the additional factor and containing the string that should be used with the authChallenge option. */ authChallenge?: string /** @@ -1708,10 +1732,17 @@ declare namespace Office { /** * Returns the current body in a specified format * @param coercionType The format of the returned body - * @param options Any optional parameters or state data passed to the method - * @param The optional method to call when the getAsync method returns + * @param callback optional method to call when the getAsync method returns */ - getAsync(coercionType: CoercionType, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getAsync(coercionType: CoercionType, callback: (result: AsyncResult) => void): void; + /** + * Returns the current body in a specified format + * @param coercionType The format of the returned body + * @param options Any optional parameters or state data passed to the method + * @param callback optional method to call when the getAsync method returns + */ + getAsync(coercionType: CoercionType, options: AsyncContextOptions, callback: (result: AsyncResult) => void): void; + /* * Gets a value that indicates whether the content is in HTML or text format * @param tableData A TableData object with the headers and rows @@ -1719,27 +1750,81 @@ declare namespace Office { * @param callback The optional method to call when the getTypeAsync method returns */ getTypeAsync(options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + /** + * Adds the specified content to the beginning of the item body + * @param data The string to be inserted at the beginning of the body. The string is limited to 1,000,000 characters + */ + prependAsync(data: string): void; + /** + * Adds the specified content to the beginning of the item body + * @param data The string to be inserted at the beginning of the body. The string is limited to 1,000,000 characters + * @param options Any optional parameters or state data passed to the method + */ + prependAsync(data: string, options: AsyncContextOptions & CoercionTypeOptions): void; + /** + * Adds the specified content to the beginning of the item body + * @param data The string to be inserted at the beginning of the body. The string is limited to 1,000,000 characters + * @param callback The optional method to call when the string is inserted + */ + prependAsync(data: string, callback: (result: AsyncResult) => void): void; /** * Adds the specified content to the beginning of the item body * @param data The string to be inserted at the beginning of the body. The string is limited to 1,000,000 characters * @param options Any optional parameters or state data passed to the method * @param callback The optional method to call when the string is inserted */ - prependAsync(data: string, options?: AsyncContextOptions & CoercionTypeOptions, callback?: (result: AsyncResult) => void): void; + prependAsync(data: string, options: AsyncContextOptions & CoercionTypeOptions, callback: (result: AsyncResult) => void): void; + + /** + * Replaces the entire body with the specified text. + * @param data The string that will replace the existing body. The string is limited to 1,000,000 characters + */ + setAsync(data: string): void; + /** + * Replaces the entire body with the specified text. + * @param data The string that will replace the existing body. The string is limited to 1,000,000 characters + * @param options Any optional parameters or state data passed to the method + */ + setAsync(data: string, options: AsyncContextOptions & CoercionTypeOptions): void; + /** + * Replaces the entire body with the specified text. + * @param data The string that will replace the existing body. The string is limited to 1,000,000 characters + * @param callback the optional method to call when the body is replaced + */ + setAsync(data: string, callback: (result: AsyncResult) => void): void; /** * Replaces the entire body with the specified text. * @param data The string that will replace the existing body. The string is limited to 1,000,000 characters * @param options Any optional parameters or state data passed to the method * @param callback the optional method to call when the body is replaced */ - setAsync(data: string, options?: AsyncContextOptions & CoercionTypeOptions, callback?: (result: AsyncResult) => void): void; + setAsync(data: string, options: AsyncContextOptions & CoercionTypeOptions, callback: (result: AsyncResult) => void): void; + + /** + * Replaces the selection in the body with the specified text + * @param data The string to be inserted at the beginning of the body. The string is limited to 1,000,000 characters + */ + setSelectedDataAsync(data: string): void; + /** + * Replaces the selection in the body with the specified text + * @param data The string to be inserted at the beginning of the body. The string is limited to 1,000,000 characters + * @param options Any optional parameters or state data passed to the method + */ + setSelectedDataAsync(data: string, options: AsyncContextOptions & CoercionTypeOptions): void; + /** + * Replaces the selection in the body with the specified text + * @param data The string to be inserted at the beginning of the body. The string is limited to 1,000,000 characters + * @param callback The optional method to call when the string is inserted + */ + setSelectedDataAsync(data: string, callback: (result: AsyncResult) => void): void; /** * Replaces the selection in the body with the specified text * @param data The string to be inserted at the beginning of the body. The string is limited to 1,000,000 characters * @param options Any optional parameters or state data passed to the method * @param callback The optional method to call when the string is inserted */ - setSelectedDataAsync(data: string, options?: AsyncContextOptions & CoercionTypeOptions, callback?: (result: AsyncResult) => void): void; + setSelectedDataAsync(data: string, options: AsyncContextOptions & CoercionTypeOptions, callback: (result: AsyncResult) => void): void; + } export interface Contact { addresses: Array; @@ -1820,6 +1905,26 @@ declare namespace Office { } export interface ItemCompose extends Item { subject: Subject; + /** + * Adds a file to a message as an attachment + * @param uri The URI that provides the location of the file to attach to the message. The maximum length is 2048 characters + * @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters + */ + addFileAttachmentAsync(uri: string, attachmentName: string): void; + /** + * Adds a file to a message as an attachment + * @param uri The URI that provides the location of the file to attach to the message. The maximum length is 2048 characters + * @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters + * @param options Any optional parameters or state data passed to the method + */ + addFileAttachmentAsync(uri: string, attachmentName: string, options: AsyncContextOptions): void; + /** + * Adds a file to a message as an attachment + * @param uri The URI that provides the location of the file to attach to the message. The maximum length is 2048 characters + * @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters + * @param callback The optional callback method + */ + addFileAttachmentAsync(uri: string, attachmentName: string, callback: (result: AsyncResult) => void): void; /** * Adds a file to a message as an attachment * @param uri The URI that provides the location of the file to attach to the message. The maximum length is 2048 characters @@ -1827,7 +1932,28 @@ declare namespace Office { * @param options Any optional parameters or state data passed to the method * @param callback The optional callback method */ - addFileAttachmentAsync(uri: string, attachmentName: string, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + addFileAttachmentAsync(uri: string, attachmentName: string, options: AsyncContextOptions, callback: (result: AsyncResult) => void): void; + + /** + * Adds an Exchange item, such as a message, as an attachment to the message + * @param itemId The Exchange identifier of the item to attach. The maximum length is 100 characters + * @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters + */ + addItemAttachmentAsync(itemId: any, attachmentName: string): void; + /** + * Adds an Exchange item, such as a message, as an attachment to the message + * @param itemId The Exchange identifier of the item to attach. The maximum length is 100 characters + * @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters + * @param options Any optional parameters or state data passed to the method + */ + addItemAttachmentAsync(itemId: any, attachmentName: string, options: AsyncContextOptions): void; + /** + * Adds an Exchange item, such as a message, as an attachment to the message + * @param itemId The Exchange identifier of the item to attach. The maximum length is 100 characters + * @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters + * @param callback The optional callback method + */ + addItemAttachmentAsync(itemId: any, attachmentName: string, callback: (result: AsyncResult) => void): void; /** * Adds an Exchange item, such as a message, as an attachment to the message * @param itemId The Exchange identifier of the item to attach. The maximum length is 100 characters @@ -1835,41 +1961,103 @@ declare namespace Office { * @param options Any optional parameters or state data passed to the method * @param callback The optional callback method */ - addItemAttachmentAsync(itemId: any, attachmentName: string, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + addItemAttachmentAsync(itemId: any, attachmentName: string, options: AsyncContextOptions, callback: (result: AsyncResult) => void): void; + /** * Closes the current item that is being composed - * + * * The behaviors of the close method depends on the current state of the item being composed. If the item has unsaved changes, the client * prompts the user to save, discard, or close the action. - * + * * In the Outlook desktop client, if the message is an inline reply, the close method has no effect. */ close(): void; /** * Asynchronously returns selected data from the subject or body of a message. - * + * * If there is no selection but the cursor is in the body or the subject, the method returns null for the selected data. If a field other * than the body or subject is selected, the method returns the InvalidSelection error */ - getSelectedDataAsync(coercionType: CoercionType, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getSelectedDataAsync(coercionType: CoercionType, callback: (result: AsyncResult) => void): void; + /** + * Asynchronously returns selected data from the subject or body of a message. + * + * If there is no selection but the cursor is in the body or the subject, the method returns null for the selected data. If a field other + * than the body or subject is selected, the method returns the InvalidSelection error + */ + getSelectedDataAsync(coercionType: CoercionType, options: AsyncContextOptions, callback: (result: AsyncResult) => void): void; + + /** + * Removes an attachment from a message + * @param attachmentIndex The index of the attachment to remove. The maximum length of the string is 100 characters + */ + removeAttachmentAsync(attachmentIndex: string): void; + /** + * Removes an attachment from a message + * @param attachmentIndex The index of the attachment to remove. The maximum length of the string is 100 characters + * @param options Any optional parameters or state data passed to the method + */ + removeAttachmentAsync(attachmentIndex: string, options: AsyncContextOptions): void; + /** + * Removes an attachment from a message + * @param attachmentIndex The index of the attachment to remove. The maximum length of the string is 100 characters + * @param callback The optional callback method + */ + removeAttachmentAsync(attachmentIndex: string, callback: (result: AsyncResult) => void): void; /** * Removes an attachment from a message * @param attachmentIndex The index of the attachment to remove. The maximum length of the string is 100 characters * @param options Any optional parameters or state data passed to the method * @param callback The optional callback method */ - removeAttachmentAsync(attachmentIndex: string, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + removeAttachmentAsync(attachmentIndex: string, options: AsyncContextOptions, callback: (result: AsyncResult) => void): void; + /** * Asynchronously saves an item. - * - * When invoked, this method saves the current message as a draft and returns the item id via the callback method. In Outlook Web App or + * + * When invoked, this method saves the current message as a draft and returns the item id via the callback method. In Outlook Web App or * Outlook in online mode, the item is saved to the server. In Outlook in cached mode, the item is saved to the local cache. */ - saveAsync(options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + saveAsync(): void; + /** + * Asynchronously saves an item. + * + * When invoked, this method saves the current message as a draft and returns the item id via the callback method. In Outlook Web App or + * Outlook in online mode, the item is saved to the server. In Outlook in cached mode, the item is saved to the local cache. + */ + saveAsync(options: AsyncContextOptions): void; + /** + * Asynchronously saves an item. + * + * When invoked, this method saves the current message as a draft and returns the item id via the callback method. In Outlook Web App or + * Outlook in online mode, the item is saved to the server. In Outlook in cached mode, the item is saved to the local cache. + */ + saveAsync(callback: (result: AsyncResult) => void): void; + /** + * Asynchronously saves an item. + * + * When invoked, this method saves the current message as a draft and returns the item id via the callback method. In Outlook Web App or + * Outlook in online mode, the item is saved to the server. In Outlook in cached mode, the item is saved to the local cache. + */ + saveAsync(options: AsyncContextOptions, callback: (result: AsyncResult) => void): void; + /** * Asynchronously inserts data into the body or subject of a message. */ - setSelectedDataAsync(data: string, options?: AsyncContextOptions & CoercionTypeOptions, callback?: (result: AsyncResult) => void): void; + setSelectedDataAsync(data: string): void; + /** + * Asynchronously inserts data into the body or subject of a message. + */ + setSelectedDataAsync(data: string, options: AsyncContextOptions & CoercionTypeOptions): void; + /** + * Asynchronously inserts data into the body or subject of a message. + */ + setSelectedDataAsync(data: string, callback: (result: AsyncResult) => void): void; + /** + * Asynchronously inserts data into the body or subject of a message. + */ + setSelectedDataAsync(data: string, options: AsyncContextOptions & CoercionTypeOptions, callback: (result: AsyncResult) => void): void; + } export interface ItemRead extends Item { attachments: Array; @@ -1879,14 +2067,14 @@ declare namespace Office { subject: string; /** * Displays a reply form that includes the sender and all the recipients of the selected message - * @param formData A string that contains text and HTML and that represents the body of the reply form. The string is limited to 32 KB + * @param formData A string that contains text and HTML and that represents the body of the reply form. The string is limited to 32 KB * OR * An object that contains body or attachment data and a callback function */ displayReplyAllForm(formData: string | ReplyFormData): void; /** * Displays a reply form that includes only the sender of the selected message - * @param formData A string that contains text and HTML and that represents the body of the reply form. The string is limited to 32 KB + * @param formData A string that contains text and HTML and that represents the body of the reply form. The string is limited to 32 KB * OR * An object that contains body or attachment data and a callback function */ @@ -1925,19 +2113,43 @@ declare namespace Office { timezoneOffset: number; } export interface Location { + /** + * Begins an asynchronous request for the location of an appointment + * @param callback The optional method to call when the string is inserted + */ + getAsync(callback: (result: AsyncResult) => void): void; /** * Begins an asynchronous request for the location of an appointment * @param options Any optional parameters or state data passed to the method * @param callback The optional method to call when the string is inserted */ - getAsync(options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getAsync(options: AsyncContextOptions, callback: (result: AsyncResult) => void): void; + + /** + * Begins an asynchronous request to set the location of an appointment + * @param data The location of the appointment. The string is limited to 255 characters + */ + setAsync(location: string): void; + /** + * Begins an asynchronous request to set the location of an appointment + * @param data The location of the appointment. The string is limited to 255 characters + * @param options Any optional parameters or state data passed to the method + */ + setAsync(location: string, options: AsyncContextOptions): void; + /** + * Begins an asynchronous request to set the location of an appointment + * @param data The location of the appointment. The string is limited to 255 characters + * @param callback The optional method to call when the location is set + */ + setAsync(location: string, callback: (result: AsyncResult) => void): void; /** * Begins an asynchronous request to set the location of an appointment * @param data The location of the appointment. The string is limited to 255 characters * @param options Any optional parameters or state data passed to the method * @param callback The optional method to call when the location is set */ - setAsync(location: string, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + setAsync(location: string, options: AsyncContextOptions, callback: (result: AsyncResult) => void): void; + } export interface Mailbox { diagnostics: Diagnostics; @@ -2046,6 +2258,26 @@ declare namespace Office { persistent?: Boolean; } export interface NotificationMessages { + /** + * Adds a notification to an item + * @param key A developer-specified key used to refrence this notification message. Developers can use it to modify this message later. + * @param JSONmessage A JSON object that contains the notification message to be added to this item + */ + addAsync(key: string, JSONmessage: NotificationMessageDetails): void; + /** + * Adds a notification to an item + * @param key A developer-specified key used to refrence this notification message. Developers can use it to modify this message later. + * @param JSONmessage A JSON object that contains the notification message to be added to this item + * @param options Any optional parameters or state data passed to the method + */ + addAsync(key: string, JSONmessage: NotificationMessageDetails, options: AsyncContextOptions): void; + /** + * Adds a notification to an item + * @param key A developer-specified key used to refrence this notification message. Developers can use it to modify this message later. + * @param JSONmessage A JSON object that contains the notification message to be added to this item + * @param callback The optional callback method + */ + addAsync(key: string, JSONmessage: NotificationMessageDetails, callback: (result: AsyncResult) => void): void; /** * Adds a notification to an item * @param key A developer-specified key used to refrence this notification message. Developers can use it to modify this message later. @@ -2053,20 +2285,65 @@ declare namespace Office { * @param options Any optional parameters or state data passed to the method * @param callback The optional callback method */ - addAsync(key: string, JSONmessage: NotificationMessageDetails, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + addAsync(key: string, JSONmessage: NotificationMessageDetails, options: AsyncContextOptions, callback: (result: AsyncResult) => void): void; + + /** + * Returns all keys and messages for an item. + * @param callback The optional callback method + */ + getAllAsync(callback: (result: AsyncResult) => void): void; /** * Returns all keys and messages for an item. * @param options Any optional parameters or state data passed to the method * @param callback The optional callback method */ - getAllAsync(options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getAllAsync(options: AsyncContextOptions, callback: (result: AsyncResult) => void): void; + + /** + * Removes a notification message for an item. + * @param key The key for the notification message to remove + */ + removeAsync(key: string): void; + /** + * Removes a notification message for an item. + * @param key The key for the notification message to remove + * @param options Any optional parameters or state data passed to the method + */ + removeAsync(key: string, options: AsyncContextOptions): void; + /** + * Removes a notification message for an item. + * @param key The key for the notification message to remove + * @param callback The optional callback method + */ + removeAsync(key: string, callback: (result: AsyncResult) => void): void; /** * Removes a notification message for an item. * @param key The key for the notification message to remove * @param options Any optional parameters or state data passed to the method * @param callback The optional callback method */ - removeAsync(key: string, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + removeAsync(key: string, options: AsyncContextOptions, callback: (result: AsyncResult) => void): void; + + /** + * Replaces a notification message that has a given key with another message + * @param key The key for the notification message to replace. + * @param JSONmessage A JSON object that contains the new notification message to replace the existing message + */ + replaceAsync(key: string, JSONmessage: NotificationMessageDetails): void; + /** + * Replaces a notification message that has a given key with another message + * @param key The key for the notification message to replace. + * @param JSONmessage A JSON object that contains the new notification message to replace the existing message + * @param options Any optional parameters or state data passed to the method + */ + replaceAsync(key: string, JSONmessage: NotificationMessageDetails, options: AsyncContextOptions): void; + /** + * Replaces a notification message that has a given key with another message + * @param key The key for the notification message to replace. + * @param JSONmessage A JSON object that contains the new notification message to replace the existing message + * @param callback The optional callback method + */ + replaceAsync(key: string, JSONmessage: NotificationMessageDetails, callback: (result: AsyncResult) => void): void; /** * Replaces a notification message that has a given key with another message * @param key The key for the notification message to replace. @@ -2074,7 +2351,8 @@ declare namespace Office { * @param options Any optional parameters or state data passed to the method * @param callback The optional callback method */ - replaceAsync(key: string, JSONmessage: NotificationMessageDetails, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + replaceAsync(key: string, JSONmessage: NotificationMessageDetails, options: AsyncContextOptions, callback: (result: AsyncResult) => void): void; + } export interface PhoneNumber { phoneString: string; @@ -2082,26 +2360,67 @@ declare namespace Office { type: string; } export interface Recipients { + /** + * Begins an asynchronous request to add a recipient list to an appointment or message + * @param recipients The recipients to add to the recipients list + */ + addAsync(recipients: Array): void; + /** + * Begins an asynchronous request to add a recipient list to an appointment or message + * @param recipients The recipients to add to the recipients list + * @param options Any optional parameters or state data passed to the method + */ + addAsync(recipients: Array, options: AsyncContextOptions): void; + /** + * Begins an asynchronous request to add a recipient list to an appointment or message + * @param recipients The recipients to add to the recipients list + * @param callback The optional method to call when the string is inserted + */ + addAsync(recipients: Array, callback: (result: AsyncResult) => void): void; /** * Begins an asynchronous request to add a recipient list to an appointment or message * @param recipients The recipients to add to the recipients list * @param options Any optional parameters or state data passed to the method * @param callback The optional method to call when the string is inserted */ - addAsync(recipients: Array, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + addAsync(recipients: Array, options: AsyncContextOptions, callback: (result: AsyncResult) => void): void; + /** + * Begins an asynchronous request to get the recipient list for an appointment or message + * @param callback The optional method to call when the string is inserted + */ + getAsync(callback: (result: AsyncResult) => void): void; /** * Begins an asynchronous request to get the recipient list for an appointment or message * @param options Any optional parameters or state data passed to the method * @param callback The optional method to call when the string is inserted */ - getAsync(options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getAsync(options: AsyncContextOptions, callback: (result: AsyncResult) => void): void; + + /** + * Begins an asynchronous request to set the recipient list for an appointment or message + * @param recipients The recipients to add to the recipients list + */ + setAsync(recipients: Array): void; + /** + * Begins an asynchronous request to set the recipient list for an appointment or message + * @param recipients The recipients to add to the recipients list + * @param options Any optional parameters or state data passed to the method + */ + setAsync(recipients: Array, options: AsyncContextOptions): void; + /** + * Begins an asynchronous request to set the recipient list for an appointment or message + * @param recipients The recipients to add to the recipients list + * @param callback The optional method to call when the string is inserted + */ + setAsync(recipients: Array, callback: (result: AsyncResult) => void): void; /** * Begins an asynchronous request to set the recipient list for an appointment or message * @param recipients The recipients to add to the recipients list * @param options Any optional parameters or state data passed to the method * @param callback The optional method to call when the string is inserted */ - setAsync(recipients: Array, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + setAsync(recipients: Array, options: AsyncContextOptions, callback: (result: AsyncResult) => void): void; + } export interface ReplyFormAttachment { type: string; @@ -2138,38 +2457,86 @@ declare namespace Office { set(name: string, value: any): void; } export interface Subject { + /** + * Begins an asynchronous request to get the subject of an appointment or message + * @param callback The optional method to call when the string is inserted + */ + getAsync(callback: (result: AsyncResult) => void): void; /** * Begins an asynchronous request to get the subject of an appointment or message * @param options Any optional parameters or state data passed to the method * @param callback The optional method to call when the string is inserted */ - getAsync(options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getAsync(options: AsyncContextOptions, callback: (result: AsyncResult) => void): void; + + /** + * Begins an asynchronous call to set the subject of an appointment or message + * @param data The subject of the appointment. The string is limited to 255 characters + */ + setAsync(data: string): void; + /** + * Begins an asynchronous call to set the subject of an appointment or message + * @param data The subject of the appointment. The string is limited to 255 characters + * @param options Any optional parameters or state data passed to the method + */ + setAsync(data: string, options: AsyncContextOptions): void; + /** + * Begins an asynchronous call to set the subject of an appointment or message + * @param data The subject of the appointment. The string is limited to 255 characters + * @param callback The optional method to call when the string is inserted + */ + setAsync(data: string, callback: (result: AsyncResult) => void): void; /** * Begins an asynchronous call to set the subject of an appointment or message * @param data The subject of the appointment. The string is limited to 255 characters * @param options Any optional parameters or state data passed to the method * @param callback The optional method to call when the string is inserted */ - setAsync(data: string, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + setAsync(data: string, options: AsyncContextOptions, callback: (result: AsyncResult) => void): void; + } export interface TaskSuggestion { assignees: Array; taskString: string; } export interface Time { + /** + * Begins an asynchronous request to get the start or end time + * @param callback The optional method to call when the string is inserted + */ + getAsync(callback: (result: AsyncResult) => void): void; /** * Begins an asynchronous request to get the start or end time * @param options Any optional parameters or state data passed to the method * @param callback The optional method to call when the string is inserted */ - getAsync(options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + getAsync(options: AsyncContextOptions, callback: (result: AsyncResult) => void): void; + + /** + * Begins an asynchronous request to set the start or end time + * @param dateTime A date-time object in Coordinated Universal Time (UTC) + */ + setAsync(dateTime: Date): void; + /** + * Begins an asynchronous request to set the start or end time + * @param dateTime A date-time object in Coordinated Universal Time (UTC) + * @param options Any optional parameters or state data passed to the method + */ + setAsync(dateTime: Date, options: AsyncContextOptions): void; + /** + * Begins an asynchronous request to set the start or end time + * @param dateTime A date-time object in Coordinated Universal Time (UTC) + * @param callback The optional method to call when the string is inserted + */ + setAsync(dateTime: Date, callback: (result: AsyncResult) => void): void; /** * Begins an asynchronous request to set the start or end time * @param dateTime A date-time object in Coordinated Universal Time (UTC) * @param options Any optional parameters or state data passed to the method * @param callback The optional method to call when the string is inserted */ - setAsync(dateTime: Date, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; + setAsync(dateTime: Date, options: AsyncContextOptions, callback: (result: AsyncResult) => void): void; + } export interface UserProfile { displayName: string; @@ -2194,108 +2561,108 @@ declare namespace Office { //////////////////////////////////////////////////////////////// declare namespace OfficeExtension { - /** An abstract proxy object that represents an object in an Office document. You create proxy objects from the context (or from other proxy objects), add commands to a queue to act on the object, and then synchronize the proxy object state with the document by calling "context.sync()". */ - class ClientObject { - /** The request context associated with the object */ - context: ClientRequestContext; - /** Returns a boolean value for whether the corresponding object is a null object. You must call "context.sync()" before reading the isNullObject property. */ - isNullObject: boolean; - } + /** An abstract proxy object that represents an object in an Office document. You create proxy objects from the context (or from other proxy objects), add commands to a queue to act on the object, and then synchronize the proxy object state with the document by calling "context.sync()". */ + class ClientObject { + /** The request context associated with the object */ + context: ClientRequestContext; + /** Returns a boolean value for whether the corresponding object is a null object. You must call "context.sync()" before reading the isNullObject property. */ + isNullObject: boolean; + } } declare namespace OfficeExtension { - interface LoadOption { - select?: string | string[]; - expand?: string | string[]; - top?: number; - skip?: number; - } - /** An abstract RequestContext object that facilitates requests to the host Office application. The "Excel.run" and "Word.run" methods provide a request context. */ - class ClientRequestContext { - constructor(url?: string); + interface LoadOption { + select?: string | string[]; + expand?: string | string[]; + top?: number; + skip?: number; + } + /** An abstract RequestContext object that facilitates requests to the host Office application. The "Excel.run" and "Word.run" methods provide a request context. */ + class ClientRequestContext { + constructor(url?: string); - /** Collection of objects that are tracked for automatic adjustments based on surrounding changes in the document. */ - trackedObjects: TrackedObjects; + /** Collection of objects that are tracked for automatic adjustments based on surrounding changes in the document. */ + trackedObjects: TrackedObjects; - /** Request headers */ - requestHeaders: { [name: string]: string }; + /** Request headers */ + requestHeaders: { [name: string]: string }; - /** Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. */ - load(object: ClientObject, option?: string | string[]| LoadOption): void; + /** Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. */ + load(object: ClientObject, option?: string | string[] | LoadOption): void; /** * Queues up a command to recursively load the specified properties of the object and its navigation properties. * You must call "context.sync()" before reading the properties. - * + * * @param object The object to be loaded. * @param options The key-value pairing of load options for the types, such as { "Workbook": "worksheets,tables", "Worksheet": "tables", "Tables": "name" } * @param maxDepth The maximum recursive depth. */ - loadRecursive(object: ClientObject, options: { [typeName: string]: string | string[] | LoadOption }, maxDepth?: number): void; + loadRecursive(object: ClientObject, options: { [typeName: string]: string | string[] | LoadOption }, maxDepth?: number): void; - /** Adds a trace message to the queue. If the promise returned by "context.sync()" is rejected due to an error, this adds a ".traceMessages" array to the OfficeExtension.Error object, containing all trace messages that were executed. These messages can help you monitor the program execution sequence and detect the cause of the error. */ - trace(message: string): void; + /** Adds a trace message to the queue. If the promise returned by "context.sync()" is rejected due to an error, this adds a ".traceMessages" array to the OfficeExtension.Error object, containing all trace messages that were executed. These messages can help you monitor the program execution sequence and detect the cause of the error. */ + trace(message: string): void; - /** Synchronizes the state between JavaScript proxy objects and the Office document, by executing instructions queued on the request context and retrieving properties of loaded Office objects for use in your code.�This method returns a promise, which is resolved when the synchronization is complete. */ - sync(passThroughValue?: T): IPromise; - } + /** Synchronizes the state between JavaScript proxy objects and the Office document, by executing instructions queued on the request context and retrieving properties of loaded Office objects for use in your code.�This method returns a promise, which is resolved when the synchronization is complete. */ + sync(passThroughValue?: T): IPromise; + } } declare namespace OfficeExtension { - /** Contains the result for methods that return primitive types. The object's value property is retrieved from the document after "context.sync()" is invoked. */ - class ClientResult { - /** The value of the result that is retrieved from the document after "context.sync()" is invoked. */ - value: T; - } + /** Contains the result for methods that return primitive types. The object's value property is retrieved from the document after "context.sync()" is invoked. */ + class ClientResult { + /** The value of the result that is retrieved from the document after "context.sync()" is invoked. */ + value: T; + } } declare namespace OfficeExtension { - export interface DebugInfo { - /** Error code string, such as "InvalidArgument". */ - code: string; - /** The error message passed through from the host Office application. */ - message: string; - /** Inner error, if applicable. */ - innerError?: DebugInfo | string; + export interface DebugInfo { + /** Error code string, such as "InvalidArgument". */ + code: string; + /** The error message passed through from the host Office application. */ + message: string; + /** Inner error, if applicable. */ + innerError?: DebugInfo | string; - /** The object type and property or method name (or similar information), if available. */ - errorLocation?: string - } + /** The object type and property or method name (or similar information), if available. */ + errorLocation?: string + } - /** The error object returned by "context.sync()", if a promise is rejected due to an error while processing the request. */ - class Error { - /** Error name: "OfficeExtension.Error".*/ - name: string; - /** The error message passed through from the host Office application. */ - message: string; - /** Stack trace, if applicable. */ - stack: string; - /** Error code string, such as "InvalidArgument". */ - code: string; - /** Trace messages (if any) that were added via a "context.trace()" invocation before calling "context.sync()". If there was an error, this contains all trace messages that were executed before the error occurred. These messages can help you monitor the program execution sequence and detect the case of the error. */ - traceMessages: Array; - /** Debug info (useful for detailed logging of the error, i.e., via JSON.stringify(...)). */ - debugInfo: DebugInfo; - /** Inner error, if applicable. */ - innerError: Error; - } + /** The error object returned by "context.sync()", if a promise is rejected due to an error while processing the request. */ + class Error { + /** Error name: "OfficeExtension.Error".*/ + name: string; + /** The error message passed through from the host Office application. */ + message: string; + /** Stack trace, if applicable. */ + stack: string; + /** Error code string, such as "InvalidArgument". */ + code: string; + /** Trace messages (if any) that were added via a "context.trace()" invocation before calling "context.sync()". If there was an error, this contains all trace messages that were executed before the error occurred. These messages can help you monitor the program execution sequence and detect the case of the error. */ + traceMessages: Array; + /** Debug info (useful for detailed logging of the error, i.e., via JSON.stringify(...)). */ + debugInfo: DebugInfo; + /** Inner error, if applicable. */ + innerError: Error; + } } declare namespace OfficeExtension { - class ErrorCodes { - public static accessDenied: string; - public static generalException: string; - public static activityLimitReached: string; - public static invalidObjectPath: string; - public static propertyNotLoaded: string; - public static valueNotLoaded: string; - public static invalidRequestContext: string; - public static invalidArgument: string; - public static runMustReturnPromise: string; - public static cannotRegisterEvent: string; - public static apiNotFound: string; - public static connectionFailure: string; - } + class ErrorCodes { + public static accessDenied: string; + public static generalException: string; + public static activityLimitReached: string; + public static invalidObjectPath: string; + public static propertyNotLoaded: string; + public static valueNotLoaded: string; + public static invalidRequestContext: string; + public static invalidArgument: string; + public static runMustReturnPromise: string; + public static cannotRegisterEvent: string; + public static apiNotFound: string; + public static connectionFailure: string; + } } declare namespace OfficeExtension { - /** An IPromise object that represents a deferred interaction with the host Office application. */ - interface IPromise { + /** An IPromise object that represents a deferred interaction with the host Office application. */ + interface IPromise { /** * This method will be called once the previous promise has been resolved. * Both the onFulfilled on onRejected callbacks are optional. @@ -2303,7 +2670,7 @@ declare namespace OfficeExtension { * @returns A new promise for the value or error that was returned from onFulfilled/onRejected. */ - then(onFulfilled?: (value: R) => IPromise, onRejected?: (error: any) => IPromise): IPromise; + then(onFulfilled?: (value: R) => IPromise, onRejected?: (error: any) => IPromise): IPromise; /** * This method will be called once the previous promise has been resolved. @@ -2312,7 +2679,7 @@ declare namespace OfficeExtension { * @returns A new promise for the value or error that was returned from onFulfilled/onRejected. */ - then(onFulfilled?: (value: R) => IPromise, onRejected?: (error: any) => U): IPromise; + then(onFulfilled?: (value: R) => IPromise, onRejected?: (error: any) => U): IPromise; /** * This method will be called once the previous promise has been resolved. @@ -2321,7 +2688,7 @@ declare namespace OfficeExtension { * @returns A new promise for the value or error that was returned from onFulfilled/onRejected. */ - then(onFulfilled?: (value: R) => IPromise, onRejected?: (error: any) => void): IPromise; + then(onFulfilled?: (value: R) => IPromise, onRejected?: (error: any) => void): IPromise; /** * This method will be called once the previous promise has been resolved. @@ -2330,7 +2697,7 @@ declare namespace OfficeExtension { * @returns A new promise for the value or error that was returned from onFulfilled/onRejected. */ - then(onFulfilled?: (value: R) => U, onRejected?: (error: any) => IPromise): IPromise; + then(onFulfilled?: (value: R) => U, onRejected?: (error: any) => IPromise): IPromise; /** * This method will be called once the previous promise has been resolved. @@ -2339,7 +2706,7 @@ declare namespace OfficeExtension { * @returns A new promise for the value or error that was returned from onFulfilled/onRejected. */ - then(onFulfilled?: (value: R) => U, onRejected?: (error: any) => U): IPromise; + then(onFulfilled?: (value: R) => U, onRejected?: (error: any) => U): IPromise; /** * This method will be called once the previous promise has been resolved. @@ -2348,50 +2715,50 @@ declare namespace OfficeExtension { * @returns A new promise for the value or error that was returned from onFulfilled/onRejected. */ - then(onFulfilled?: (value: R) => U, onRejected?: (error: any) => void): IPromise; + then(onFulfilled?: (value: R) => U, onRejected?: (error: any) => void): IPromise; /** * Catches failures or exceptions from actions within the promise, or from an unhandled exception earlier in the call stack. * @param onRejected function to be called if or when the promise rejects. */ - catch(onRejected?: (error: any) => IPromise): IPromise; + catch(onRejected?: (error: any) => IPromise): IPromise; /** * Catches failures or exceptions from actions within the promise, or from an unhandled exception earlier in the call stack. * @param onRejected function to be called if or when the promise rejects. */ - catch(onRejected?: (error: any) => U): IPromise; + catch(onRejected?: (error: any) => U): IPromise; /** * Catches failures or exceptions from actions within the promise, or from an unhandled exception earlier in the call stack. * @param onRejected function to be called if or when the promise rejects. */ - catch(onRejected?: (error: any) => void): IPromise; - } + catch(onRejected?: (error: any) => void): IPromise; + } - /** An Promise object that represents a deferred interaction with the host Office application. The publically-consumable OfficeExtension.Promise is available starting in ExcelApi 1.2 and WordApi 1.2. Promises can be chained via ".then", and errors can be caught via ".catch". Remember to always use a ".catch" on the outer promise, and to return intermediary promises so as not to break the promise chain. When a "native" Promise implementation is available, OfficeExtension.Promise will switch to use the native Promise instead. */ - export class Promise implements IPromise - { + /** An Promise object that represents a deferred interaction with the host Office application. The publically-consumable OfficeExtension.Promise is available starting in ExcelApi 1.2 and WordApi 1.2. Promises can be chained via ".then", and errors can be caught via ".catch". Remember to always use a ".catch" on the outer promise, and to return intermediary promises so as not to break the promise chain. When a "native" Promise implementation is available, OfficeExtension.Promise will switch to use the native Promise instead. */ + export class Promise implements IPromise + { /** * Creates a new promise based on a function that accepts resolve and reject handlers. */ - constructor(func: (resolve: (value?: R | IPromise) => void, reject: (error?: any) => void) => void); + constructor(func: (resolve: (value?: R | IPromise) => void, reject: (error?: any) => void) => void); /** * Creates a promise that resolves when all of the child promises resolve. */ - static all(promises: OfficeExtension.IPromise[]): IPromise; + static all(promises: OfficeExtension.IPromise[]): IPromise; /** * Creates a promise that is resolved. */ - static resolve(value: U): IPromise; + static resolve(value: U): IPromise; /** * Creates a promise that is rejected. */ - static reject(error: any): IPromise; + static reject(error: any): IPromise; /* This method will be called once the previous promise has been resolved. * Both the onFulfilled on onRejected callbacks are optional. @@ -2399,7 +2766,7 @@ declare namespace OfficeExtension { * @returns A new promise for the value or error that was returned from onFulfilled/onRejected. */ - then(onFulfilled?: (value: R) => IPromise, onRejected?: (error: any) => IPromise): IPromise; + then(onFulfilled?: (value: R) => IPromise, onRejected?: (error: any) => IPromise): IPromise; /** * This method will be called once the previous promise has been resolved. @@ -2408,7 +2775,7 @@ declare namespace OfficeExtension { * @returns A new promise for the value or error that was returned from onFulfilled/onRejected. */ - then(onFulfilled?: (value: R) => IPromise, onRejected?: (error: any) => U): IPromise; + then(onFulfilled?: (value: R) => IPromise, onRejected?: (error: any) => U): IPromise; /** * This method will be called once the previous promise has been resolved. @@ -2417,7 +2784,7 @@ declare namespace OfficeExtension { * @returns A new promise for the value or error that was returned from onFulfilled/onRejected. */ - then(onFulfilled?: (value: R) => IPromise, onRejected?: (error: any) => void): IPromise; + then(onFulfilled?: (value: R) => IPromise, onRejected?: (error: any) => void): IPromise; /** * This method will be called once the previous promise has been resolved. @@ -2426,7 +2793,7 @@ declare namespace OfficeExtension { * @returns A new promise for the value or error that was returned from onFulfilled/onRejected. */ - then(onFulfilled?: (value: R) => U, onRejected?: (error: any) => IPromise): IPromise; + then(onFulfilled?: (value: R) => U, onRejected?: (error: any) => IPromise): IPromise; /** * This method will be called once the previous promise has been resolved. @@ -2435,7 +2802,7 @@ declare namespace OfficeExtension { * @returns A new promise for the value or error that was returned from onFulfilled/onRejected. */ - then(onFulfilled?: (value: R) => U, onRejected?: (error: any) => U): IPromise; + then(onFulfilled?: (value: R) => U, onRejected?: (error: any) => U): IPromise; /** * This method will be called once the previous promise has been resolved. @@ -2444,73 +2811,73 @@ declare namespace OfficeExtension { * @returns A new promise for the value or error that was returned from onFulfilled/onRejected. */ - then(onFulfilled?: (value: R) => U, onRejected?: (error: any) => void): IPromise; + then(onFulfilled?: (value: R) => U, onRejected?: (error: any) => void): IPromise; /** * Catches failures or exceptions from actions within the promise, or from an unhandled exception earlier in the call stack. * @param onRejected function to be called if or when the promise rejects. */ - catch(onRejected?: (error: any) => IPromise): IPromise; + catch(onRejected?: (error: any) => IPromise): IPromise; /** * Catches failures or exceptions from actions within the promise, or from an unhandled exception earlier in the call stack. * @param onRejected function to be called if or when the promise rejects. */ - catch(onRejected?: (error: any) => U): IPromise; + catch(onRejected?: (error: any) => U): IPromise; /** * Catches failures or exceptions from actions within the promise, or from an unhandled exception earlier in the call stack. * @param onRejected function to be called if or when the promise rejects. */ - catch(onRejected?: (error: any) => void): IPromise; - } + catch(onRejected?: (error: any) => void): IPromise; + } } declare namespace OfficeExtension { - /** Collection of tracked objects, contained within a request context. See "context.trackedObjects" for more information. */ - class TrackedObjects { - /** Track a new object for automatic adjustment based on surrounding changes in the document. Only some object types require this. If you are using an object across ".sync" calls and outside the sequential execution of a ".run" batch, and get an "InvalidObjectPath" error when setting a property or invoking a method on the object, you needed to have added the object to the tracked object collection when the object was first created. */ - add(object: ClientObject): void; - /** Track a new object for automatic adjustment based on surrounding changes in the document. Only some object types require this. If you are using an object across ".sync" calls and outside the sequential execution of a ".run" batch, and get an "InvalidObjectPath" error when setting a property or invoking a method on the object, you needed to have added the object to the tracked object collection when the object was first created. */ - add(objects: ClientObject[]): void; - /** Release the memory associated with an object that was previously added to this collection. Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You will need to call "context.sync()" before the memory release takes effect. */ - remove(object: ClientObject): void; - /** Release the memory associated with an object that was previously added to this collection. Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You will need to call "context.sync()" before the memory release takes effect. */ - remove(objects: ClientObject[]): void; - } + /** Collection of tracked objects, contained within a request context. See "context.trackedObjects" for more information. */ + class TrackedObjects { + /** Track a new object for automatic adjustment based on surrounding changes in the document. Only some object types require this. If you are using an object across ".sync" calls and outside the sequential execution of a ".run" batch, and get an "InvalidObjectPath" error when setting a property or invoking a method on the object, you needed to have added the object to the tracked object collection when the object was first created. */ + add(object: ClientObject): void; + /** Track a new object for automatic adjustment based on surrounding changes in the document. Only some object types require this. If you are using an object across ".sync" calls and outside the sequential execution of a ".run" batch, and get an "InvalidObjectPath" error when setting a property or invoking a method on the object, you needed to have added the object to the tracked object collection when the object was first created. */ + add(objects: ClientObject[]): void; + /** Release the memory associated with an object that was previously added to this collection. Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You will need to call "context.sync()" before the memory release takes effect. */ + remove(object: ClientObject): void; + /** Release the memory associated with an object that was previously added to this collection. Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You will need to call "context.sync()" before the memory release takes effect. */ + remove(objects: ClientObject[]): void; + } } declare namespace OfficeExtension { - export class EventHandlers { - constructor(context: ClientRequestContext, parentObject: ClientObject, name: string, eventInfo: EventInfo); - add(handler: (args: T) => IPromise): EventHandlerResult; - remove(handler: (args: T) => IPromise): void; - } + export class EventHandlers { + constructor(context: ClientRequestContext, parentObject: ClientObject, name: string, eventInfo: EventInfo); + add(handler: (args: T) => IPromise): EventHandlerResult; + remove(handler: (args: T) => IPromise): void; + } - export class EventHandlerResult { - constructor(context: ClientRequestContext, handlers: EventHandlers, handler: (args: T) => IPromise); - remove(): void; - } + export class EventHandlerResult { + constructor(context: ClientRequestContext, handlers: EventHandlers, handler: (args: T) => IPromise); + remove(): void; + } - export interface EventInfo { - registerFunc: (callback: (args: any) => void) => IPromise; - unregisterFunc: (callback: (args: any) => void) => IPromise; - eventArgsTransformFunc: (args: any) => IPromise; - } + export interface EventInfo { + registerFunc: (callback: (args: any) => void) => IPromise; + unregisterFunc: (callback: (args: any) => void) => IPromise; + eventArgsTransformFunc: (args: any) => IPromise; + } } declare namespace OfficeExtension { /** - * Request URL and headers + * Request URL and headers */ - interface RequestUrlAndHeaderInfo { - /** Request URL */ - url: string; - /** Request headers */ - headers?: { - [name: string]: string; - }; - } + interface RequestUrlAndHeaderInfo { + /** Request URL */ + url: string; + /** Request headers */ + headers?: { + [name: string]: string; + }; + } } @@ -4874,7 +5241,7 @@ declare namespace Excel { /** * * Represents a collection of all the rows that are part of the table. - + Note that unlike Ranges or Columns, which will adjust if new rows/columns are added before them, a TableRow object represent the physical location of the table row, but not the data. That is, if the data is sorted or if new rows are added, a table row will continue @@ -4895,7 +5262,7 @@ declare namespace Excel { /** * * Adds one or more rows to the table. The return object will be the top of the newly added row(s). - + Note that unlike Ranges or Columns, which will adjust if new rows/columns are added before them, a TableRow object represent the physical location of the table row, but not the data. That is, if the data is sorted or if new rows are added, a table row will continue @@ -4917,7 +5284,7 @@ declare namespace Excel { /** * * Gets a row based on its position in the collection. - + Note that unlike Ranges or Columns, which will adjust if new rows/columns are added before them, a TableRow object represent the physical location of the table row, but not the data. That is, if the data is sorted or if new rows are added, a table row will continue @@ -4939,7 +5306,7 @@ declare namespace Excel { /** * * Represents a row in a table. - + Note that unlike Ranges or Columns, which will adjust if new rows/columns are added before them, a TableRow object represent the physical location of the table row, but not the data. That is, if the data is sorted or if new rows are added, a table row will continue @@ -6893,7 +7260,7 @@ declare namespace Excel { * * The first criterion used to filter data. Used as an operator in the case of "custom" filtering. For example ">50" for number greater than 50 or "=*s" for values ending in "s". - + Used as a number in the case of top/bottom items/percents. E.g. "5" for the top 5 items if filterOn is set to "topItems" * * [Api set: ExcelApi 1.2]