From 4d19b0553cbe65c7348d1252327c4f04b0d7e060 Mon Sep 17 00:00:00 2001 From: Alex Jerabek Date: Wed, 20 Jun 2018 09:55:40 -0700 Subject: [PATCH 1/5] Moving data from Binding.setDataAsync, LoadOption, and UI.displayDialogAsync into ref --- types/office-js/index.d.ts | 293 ++++++++++++++++++++++++++++++++----- 1 file changed, 255 insertions(+), 38 deletions(-) diff --git a/types/office-js/index.d.ts b/types/office-js/index.d.ts index fc2bcb51b9..8f10ec1659 100644 --- a/types/office-js/index.d.ts +++ b/types/office-js/index.d.ts @@ -596,6 +596,8 @@ declare namespace Office { } /** * Provides objects and methods that you can use to create and manipulate UI components, such as dialog boxes, in your Office Add-ins. + * + * Visit "{@link https://docs.microsoft.com/office/dev/add-ins/develop/dialog-api-in-office-add-ins | Use the Dialog API in your Office Add-ins}" for more information. */ interface UI { /** @@ -609,6 +611,8 @@ declare namespace Office { * The initial page must be on the same domain as the parent page (the startAddress parameter). After the initial page loads, you can go to other domains. * * Any page calling `office.context.ui.messageParent` must also be on the same domain as the parent page. + * + * **Design considerations**: * * The following design considerations apply to dialog boxes: * @@ -629,14 +633,75 @@ declare namespace Office { * - Temporarily increase the surface area that a user has available to complete a task. * * Do not use a dialog box to interact with a document. Use a task pane instead. + * + * For a design pattern that you can use to create a dialog box, see {@link https://github.com/OfficeDev/Office-Add-in-UX-Design-Patterns/blob/master/Patterns/Client_Dialog.md | Client Dialog} in the Office Add-in UX Design Patterns repository on GitHub. + * + * **displayDialogAsync Errors**: + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Code numberMeaning
12004The domain of the URL passed to displayDialogAsync is not trusted. The domain must be either the same domain as the host page (including protocol and port number), or it must be registered in the section of the add-in manifest.
12005The URL passed to displayDialogAsync uses the HTTP protocol. HTTPS is required. (In some versions of Office, the error message returned with 12005 is the same one returned for 12004.)
12007A dialog box is already opened from the task pane. A task pane add-in can only have one dialog box open at a time.
+ * + * **Examples**: + * For a simple example that uses the `displayDialogAsync` method, see {@link https://github.com/OfficeDev/Office-Add-in-Dialog-API-Simple-Example/ | Office Add-in Dialog API example} on GitHub. + * + * For examples that show authentication scenarios, see: + * + * - {@link https://github.com/OfficeDev/PowerPoint-Add-in-Microsoft-Graph-ASPNET-InsertChart | PowerPoint Add-in in Microsoft Graph ASP.Net Insert Chart} + * + * - {@link https://github.com/OfficeDev/Office-Add-in-Auth0 | Office Add-in Auth0} + * + * - {@link https://github.com/OfficeDev/Excel-Add-in-ASPNET-QuickBooks | Excel Add-in ASP.NET QuickBooks} + * + * - {@link https://github.com/dougperkes/Office-Add-in-AspNetMvc-ServerAuth/tree/Office2016DisplayDialog | Office Add-in Server Authentication Sample for ASP.net MVC} + * + * - {@link https://github.com/OfficeDev/Word-Add-in-AngularJS-Client-OAuth | Office Add-in Office 365 Client Authentication for AngularJS} * * @param startAddress - Accepts the initial HTTPS URL that opens in the dialog. - * @param options - Optional. Accepts a DialogOptions object to define dialog display. + * @param options - Optional. Accepts an {@link Office.DialogOptions} object to define dialog display. * @param callback - Optional. Accepts a callback method to handle the dialog creation attempt. If successful, the AsyncResult.value is a DialogHandler object. + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
PropertyUse to
AsyncResult.valueAccess the Dialog object.
AsyncResult.statusDetermine the success or failure of the operation.
AsyncResult.errorAccess an Error object that provides error information if the operation failed. + *
AsyncResult.asyncContextAccess your user-defined object or value, if you passed one as the asyncContext parameter.
*/ displayDialogAsync(startAddress: string, options?: DialogOptions, callback?: (result: AsyncResult) => void): void; /** - * Delivers a message from the dialog box to its parent/opener page. The page calling this API must be on the same domain as the parent. + * Delivers a message from the dialog box to its parent/opener page. The page calling this API must be on the same domain as the parent. You can use the properties of the AsyncResult object to return the following information. * @param messageObject Accepts a message from the dialog to deliver to the add-in. */ messageParent(messageObject: any): void; @@ -1487,9 +1552,87 @@ declare namespace Office { * Writes data to the bound section of the document represented by the specified binding object. * * @remarks + * * Hosts: Access, Excel, Word * * Available in Requirement sets: MatrixBindings, TableBindings, TextBindings + * + * The value passed for data contains the data to be written in the binding. The kind of value passed determines what will be written as described in the following table. + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
`data` valueData written
A stringPlain text or anything that can be coerced to a string will be written.
An array of arrays ("matrix")Tabular data without headers will be written. For example, to write data to three rows in two columns, you can pass an array like this: `[["R1C1", "R1C2"], ["R2C1", "R2C2"], ["R3C1", "R3C2"]]`. To write a single column of three rows, pass an array like this: `[["R1C1"], ["R2C1"], ["R3C1"]]`.
An {@link Office.TableData} objectA table with headers will be written.
+ * + * Additionally, these application-specific actions apply when writing data to a binding. For Word, the specified data is written to the binding as follows: + * + *
+ * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
`data` valueData written
A stringThe specified text is written.
An array of arrays ("matrix") or an {@link Office.TableData} objectA Word table is written.
HTMLThe specified HTML is written. If any of the HTML you write is invalid, Word will not raise an error. Word will write as much of the HTML as it can and will omit any invalid data.
Office Open XML ("Open XML")The specified the XML is written.
+ * + * For Excel, the specified data is written to the binding as follows: + * + *
+ * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
`data` valueData written
A stringThe specified text is inserted as the value of the first bound cell.You can also specify a valid formula to add that formula to the bound cell. For example, setting data to `"=SUM(A1:A5)"` will total the values in the specified range. However, when you set a formula on the bound cell, after doing so, you can't read the added formula (or any pre-existing formula) from the bound cell. If you call the Binding.getDataAsync method on the bound cell to read its data, the method can return only the data displayed in the cell (the formula's result).
An array of arrays ("matrix"), and the shape exactly matches the shape of the binding specifiedThe set of rows and columns are written.You can also specify an array of arrays that contain valid formulas to add them to the bound cells. For example, setting data to `[["=SUM(A1:A5)","=AVERAGE(A1:A5)"]]` will add those two formulas to a binding that contains two cells. Just as when setting a formula on a single bound cell, you can't read the added formulas (or any pre-existing formulas) from the binding with the `Binding.getDataAsync` method - it returns only the data displayed in the bound cells.
An {@link Office.TableData} object, and the shape of the table matches the bound table.The specified set of rows and/or headers are written, if no other data in surrounding cells will be overwritten. Note: If you specify formulas in the TableData object you pass for the *data* parameter, you might not get the results you expect due to the "calculated columns" feature of Excel, which automatically duplicates formulas within a column. To work around this when you want to write *data* that contains formulas to a bound table, try specifying the data as an array of arrays (instead of a TableData object), and specify the *coercionType* as Microsoft.Office.Matrix or "matrix".
+ * + * For Excel Online: + * + * - The total number of cells in the value passed to the data parameter can't exceed 20,000 in a single call to this method. + * + * - The number of formatting groups passed to the cellFormat parameter can't exceed 100. A single formatting group consists of a set of formatting applied to a specified range of cells. + * + * In all other cases, an error is returned. + * + * The setDataAsync method will write data in a subset of a table or matrix binding if the optional startRow and startColumn parameters are specified, and they specify a valid range. * * @param data The data to be set in the current selection. Possible data types by host: * @@ -1505,7 +1648,30 @@ declare namespace Office { * * @param options Provides options for how to set the data in a binding. * - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. You can use the properties of the AsyncResult object to return the following information. + * + *
+ * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
PropertyUse to...
AsyncResult.valueAlways returns undefined because there is no object or data to retrieve.
AsyncResult.statusDetermine the success or failure of the operation.
AsyncResult.errorAccess an Error object that provides error information if the operation failed.
AsyncResult.asyncContextA user-defined item of any type that is returned in the AsyncResult object without being altered.
*/ setDataAsync(data: TableData | any, options?: SetBindingDataOptions, callback?: (result: AsyncResult) => void): void; } @@ -2389,9 +2555,13 @@ declare namespace Office { * * @remarks * - * No more than two documents are allowed to be in memory; otherwise the Document.getFileAsync operation will fail. Use the File.closeAsync method to close the file when you are finished working with it. + * Hosts: PowerPoint, Word * - * In the callback function passed to the closeAsync method, you can use the properties of the AsyncResult object to return the following information. + * Available in Requirement set: File + * + * No more than two documents are allowed to be in memory; otherwise the Document.getFileAsync operation will fail. Use the File.closeAsync method to close the file when you are finished working with it. + * + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. When the function you passed to the callback parameter executes, it receives an AsyncResult object that you can access from the callback function's only parameter to return the following information. * * * @@ -2415,11 +2585,6 @@ declare namespace Office { * * *
A user-defined item of any type that is returned in the AsyncResult object without being altered.
- * - * Hosts: PowerPoint, Word - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. When the function you passed to the callback parameter executes, it receives an AsyncResult object that you can access from the callback function's only parameter. - * - * Available in Requirement set: File */ closeAsync(callback?: (result: AsyncResult) => void): void; /** @@ -2429,6 +2594,10 @@ declare namespace Office { * * In the callback function passed to the getSliceAsync method, you can use the properties of the AsyncResult object to return the following information. * + * Hosts: PowerPoint, Word + * @param sliceIndex Specifies the zero-based index of the slice to be retrieved. Required. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. When the function you passed to the callback parameter executes, it receives an AsyncResult object that you can access from the callback function's only parameter to return the following information. + * * * * @@ -2451,10 +2620,6 @@ declare namespace Office { * * *
PropertyA user-defined item of any type that is returned in the AsyncResult object without being altered.
- * - * Hosts: PowerPoint, Word - * @param sliceIndex Specifies the zero-based index of the slice to be retrieved. Required. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. When the function you passed to the callback parameter executes, it receives an AsyncResult object that you can access from the callback function's only parameter. * * Available in Requirement set: File */ @@ -2518,8 +2683,15 @@ declare namespace Office { * * @remarks * You can add multiple event handlers for the specified eventType as long as the name of each event handler function is unique. - * - * In the callback function passed to the addHandlerAsync method, you can use the properties of the AsyncResult object to return the following information. + * + * Hosts: Excel + * + * Available in Requirement set: Settings + * + * @param eventType Specifies the type of event to add. Required. + * @param handler The event handler function to add. Required. + * @param options 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 callback returns, whose only parameter is of type AsyncResult. When the function you passed to the callback parameter executes, it receives an AsyncResult object that you can access from the callback function's only parameter to return the following information. * * * @@ -2543,15 +2715,6 @@ declare namespace Office { * * *
A user-defined item of any type that is returned in the AsyncResult object without being altered.
- * - * Hosts: Excel - * - * Available in Requirement set: Settings - * - * @param eventType Specifies the type of event to add. Required. - * @param handler The event handler function to add. Required. - * @param options 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 callback returns, whose only parameter is of type AsyncResult. When the function you passed to the callback parameter executes, it receives an AsyncResult object that you can access from the callback function's only parameter. */ addHandlerAsync(eventType: EventType, handler: any, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** @@ -2576,6 +2739,12 @@ declare namespace Office { * * In the callback function passed to the refreshAsync method, you can use the properties of the AsyncResult object to return the following information. * + * Hosts: Access, Excel, PowerPoint, Word + * + * Available in Requirement set: Settings + * + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. When the function you passed to the callback parameter executes, it receives an AsyncResult object that you can access from the callback function's only parameter to return the following information. + * * * * @@ -2598,13 +2767,6 @@ declare namespace Office { * * *
PropertyA user-defined item of any type that is returned in the AsyncResult object without being altered.
- * - * Hosts: Access, Excel, PowerPoint, Word - * - * Available in Requirement set: Settings - * - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. When the function you passed to the callback parameter executes, it receives an AsyncResult object that you can access from the callback function's only parameter. - */ refreshAsync(callback?: (result: AsyncResult) => void): void; /** @@ -2647,7 +2809,9 @@ declare namespace Office { * * Note: The saveAsync method persists the in-memory settings property bag into the document file; however, the changes to the document file itself are saved only when the user (or AutoRecover setting) saves the document to the file system. The refreshAsync method is only useful in coauthoring scenarios (which are only supported in Word) when other instances of the same add-in might change the settings and those changes should be made available to all instances. * - * In the callback function passed to the saveAsync method, you can use the properties of the AsyncResult object to return the following information. + * Hosts: Access, Excel, PowerPoint, Word + * @param options Provides options for saving settings. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. When the function you passed to the callback parameter executes, it receives an AsyncResult object that you can access from the callback function's only parameter to return the following information. * * * @@ -2671,10 +2835,6 @@ declare namespace Office { * * *
A user-defined item of any type that is returned in the AsyncResult object without being altered.
- * - * Hosts: Access, Excel, PowerPoint, Word - * @param options Provides options for saving settings. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. When the function you passed to the callback parameter executes, it receives an AsyncResult object that you can access from the callback function's only parameter. */ saveAsync(options?: SaveSettingsOptions, callback?: (result: AsyncResult) => void): void; /** @@ -2897,10 +3057,35 @@ declare namespace Office { * Hosts: Excel * * Available in Requirement set: Not in a set + * + * * * @param tableOptions An object literal containing a list of property name-value pairs that define the table options to apply. * @param options 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 callback returns, whose only parameter is of type AsyncResult. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. You can use the properties of the AsyncResult object to return the following information. + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
PropertyUse to...
AsyncResult.valueAlways returns undefined because there is no data or object to retrieve when setting formats.
AsyncResult.statusDetermine the success or failure of the operation.
AsyncResult.errorAccess an Error object that provides error information if the operation failed.
AsyncResult.asyncContextA user-defined item of any type that is returned in the AsyncResult object without being altered.
*/ setTableOptionsAsync(tableOptions: any, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; } @@ -13559,10 +13744,42 @@ declare namespace OfficeExtension { } declare namespace OfficeExtension { + /** + * Represents an object that can be passed to the load method to specify the set of properties and relations to be loaded upon execution of sync() method that synchronizes the states between Office objects and corresponding JavaScript proxy objects. + * This takes in options such as select and expand parameters to specify a set of properties to be loaded on the object and also allows pagination on the collection. + * + * @remarks + * + * For Word, the preferred method for specifying the properties and paging information is by using a string literal. The first two examples show the preferred way to request the text and font size properties for paragraphs in a paragraph collection: + * + * `context.load(paragraphs, 'text, font/size');` + * + * `paragraphs.load('text, font/size');` + * + * Here is a similar example using object notation (includes paging): + * + * `context.load(paragraphs, {select: 'text, font/size', expand: 'font', top: 50, skip: 0});` + * + * `paragraphs.load({select: 'text, font/size', expand: 'font', top: 50, skip: 0});` + * + * Note that if we don't specify the specific properties on the font object in the select statement, the expand statement by itself would indicate that all of the font properties are loaded. + */ interface LoadOption { + /** + * Contains a comma delimited list or an array of parameter/relationship names. Optional. + */ select?: string | string[]; + /** + * Contains a comma delimited list or an array of relationship names. Optional. + */ expand?: string | string[]; + /** + * Specifies the maximum number of collection items that can be included in the result. Optional. You can only use this option when you use the object notation option. + */ top?: number; + /** + * Specify the number of items in the collection that are to be skipped and not included in the result. If top is specified, the result set will start after skipping the specified number of items. Optional. You can only use this option when you use the object notation option. + */ skip?: number; } interface UpdateOptions { From 8194248a300300d07f1341f44a29e68b9de22b70 Mon Sep 17 00:00:00 2001 From: Alex Jerabek Date: Wed, 20 Jun 2018 14:54:14 -0700 Subject: [PATCH 2/5] Cleaning up formatting --- types/office-js/index.d.ts | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/types/office-js/index.d.ts b/types/office-js/index.d.ts index 346fef880b..ee62c2aad5 100644 --- a/types/office-js/index.d.ts +++ b/types/office-js/index.d.ts @@ -656,21 +656,6 @@ declare namespace Office { * A dialog box is already opened from the task pane. A task pane add-in can only have one dialog box open at a time. * * - * - * **Examples**: - * For a simple example that uses the `displayDialogAsync` method, see {@link https://github.com/OfficeDev/Office-Add-in-Dialog-API-Simple-Example/ | Office Add-in Dialog API example} on GitHub. - * - * For examples that show authentication scenarios, see: - * - * - {@link https://github.com/OfficeDev/PowerPoint-Add-in-Microsoft-Graph-ASPNET-InsertChart | PowerPoint Add-in in Microsoft Graph ASP.Net Insert Chart} - * - * - {@link https://github.com/OfficeDev/Office-Add-in-Auth0 | Office Add-in Auth0} - * - * - {@link https://github.com/OfficeDev/Excel-Add-in-ASPNET-QuickBooks | Excel Add-in ASP.NET QuickBooks} - * - * - {@link https://github.com/dougperkes/Office-Add-in-AspNetMvc-ServerAuth/tree/Office2016DisplayDialog | Office Add-in Server Authentication Sample for ASP.net MVC} - * - * - {@link https://github.com/OfficeDev/Word-Add-in-AngularJS-Client-OAuth | Office Add-in Office 365 Client Authentication for AngularJS} * * @param startAddress - Accepts the initial HTTPS URL that opens in the dialog. * @param options - Optional. Accepts an {@link Office.DialogOptions} object to define dialog display. @@ -2377,7 +2362,7 @@ declare namespace Office { * * @param coercionType The type of data structure to return. * - * The possible values for the coercionType parameter vary by the host: + * The possible values for the {@link Office.CoercionType} parameter vary by the host: * * - Excel, Excel Online, PowerPoint, PowerPoint Online, Word, and Word Online only: `Office.CoercionType.Text` (string) * From 6b3c6b57a8ab3b4601cc89aee629d42f6b0fa331 Mon Sep 17 00:00:00 2001 From: Alex Jerabek Date: Wed, 20 Jun 2018 15:03:52 -0700 Subject: [PATCH 3/5] Fixing LoadOption link --- types/office-js/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/office-js/index.d.ts b/types/office-js/index.d.ts index ee62c2aad5..33fa172f3e 100644 --- a/types/office-js/index.d.ts +++ b/types/office-js/index.d.ts @@ -13889,7 +13889,7 @@ declare namespace OfficeExtension { /** Queues up a command to load the specified properties of the object. You must call `context.sync()` before reading the properties. * * @param object The object whose properties are loaded. - * @param option A comma-delimited string, or array of strings, that specifies the properties/relationships to load, or an {@link Office.OfficeExtension.LoadOption} object. + * @param option A comma-delimited string, or array of strings, that specifies the properties/relationships to load, or an {@link OfficeExtension.LoadOption} object. */ load(object: ClientObject, option?: string | string[] | LoadOption): void; From 0e77add1b6ce51a74763b086a446557073d1c340 Mon Sep 17 00:00:00 2001 From: Alex Jerabek Date: Wed, 20 Jun 2018 16:02:30 -0700 Subject: [PATCH 4/5] Moving tables and extra infrormaion --- types/office-js/index.d.ts | 137 ++++++++++++++++++++----------------- 1 file changed, 74 insertions(+), 63 deletions(-) diff --git a/types/office-js/index.d.ts b/types/office-js/index.d.ts index 33fa172f3e..1803015c3c 100644 --- a/types/office-js/index.d.ts +++ b/types/office-js/index.d.ts @@ -656,10 +656,8 @@ declare namespace Office { * A dialog box is already opened from the task pane. A task pane add-in can only have one dialog box open at a time. * * - * - * @param startAddress - Accepts the initial HTTPS URL that opens in the dialog. - * @param options - Optional. Accepts an {@link Office.DialogOptions} object to define dialog display. - * @param callback - Optional. Accepts a callback method to handle the dialog creation attempt. If successful, the AsyncResult.value is a DialogHandler object. + * + * In the callback function passed to the displayDialogAsync method, you can use the properties of the AsyncResult object to return the following information. * * * @@ -683,10 +681,14 @@ declare namespace Office { * * *
Access your user-defined object or value, if you passed one as the asyncContext parameter.
+ * + * @param startAddress - Accepts the initial HTTPS URL that opens in the dialog. + * @param options - Optional. Accepts an {@link Office.DialogOptions} object to define dialog display. + * @param callback - Optional. Accepts a callback method to handle the dialog creation attempt. If successful, the AsyncResult.value is a DialogHandler object. */ displayDialogAsync(startAddress: string, options?: DialogOptions, callback?: (result: AsyncResult) => void): void; /** - * Delivers a message from the dialog box to its parent/opener page. The page calling this API must be on the same domain as the parent. You can use the properties of the AsyncResult object to return the following information. + * Delivers a message from the dialog box to its parent/opener page. The page calling this API must be on the same domain as the parent. * @param messageObject Accepts a message from the dialog to deliver to the add-in. */ messageParent(messageObject: any): void; @@ -1618,22 +1620,8 @@ declare namespace Office { * In all other cases, an error is returned. * * The setDataAsync method will write data in a subset of a table or matrix binding if the optional startRow and startColumn parameters are specified, and they specify a valid range. - * - * @param data The data to be set in the current selection. Possible data types by host: - * - * string: Excel, Excel Online, Word, and Word Online only - * - * array of arrays: Excel and Word only - * - * {@link Office.TableData}: Access, Excel, and Word only - * - * HTML: Word and Word Online only - * - * Office Open XML: Word only - * - * @param options Provides options for how to set the data in a binding. - * - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. You can use the properties of the AsyncResult object to return the following information. + * + * In the callback function passed to the setDataAsync method, you can use the properties of the AsyncResult object to return the following information. * * * @@ -1657,6 +1645,22 @@ declare namespace Office { * * *
A user-defined item of any type that is returned in the AsyncResult object without being altered.
+ * + * @param data The data to be set in the current selection. Possible data types by host: + * + * string: Excel, Excel Online, Word, and Word Online only + * + * array of arrays: Excel and Word only + * + * {@link Office.TableData}: Access, Excel, and Word only + * + * HTML: Word and Word Online only + * + * Office Open XML: Word only + * + * @param options Provides options for how to set the data in a binding. + * + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. You can use the properties of the AsyncResult object to return the following information. */ setDataAsync(data: TableData | any, options?: SetBindingDataOptions, callback?: (result: AsyncResult) => void): void; } @@ -2359,26 +2363,8 @@ declare namespace Office { * Hosts: Access, Excel, PowerPoint, Project, Word * * Available in Requirement set: Selection - * - * @param coercionType The type of data structure to return. * - * The possible values for the {@link Office.CoercionType} parameter vary by the host: - * - * - Excel, Excel Online, PowerPoint, PowerPoint Online, Word, and Word Online only: `Office.CoercionType.Text` (string) - * - * - Excel, Word, and Word Online only: `Office.CoercionType.Matrix` (array of arrays) - * - * - Access, Excel, Word, and Word Online only: `Office.CoercionType.Table` (TableData object) - * - * - Word only: `Office.CoercionType.Html` - * - * - Word and Word Online only: `Office.CoercionType.Ooxml` (Office Open XML) - * - * - PowerPoint and PowerPoint Online only: `Office.CoercionType.SlideRange` - * - * @param options Provides options for customizing what data is returned and how it is formatted. - * - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. + * In the callback function that is passed to the getSelectedDataAsync method, you can use the properties of the AsyncResult object to return the following information. * * * @@ -2402,6 +2388,26 @@ declare namespace Office { * * *
A user-defined item of any type that is returned in the AsyncResult object without being altered.
+ * + * @param coercionType The type of data structure to return. + * + * The possible values for the {@link Office.CoercionType} parameter vary by the host: + * + * - Excel, Excel Online, PowerPoint, PowerPoint Online, Word, and Word Online only: `Office.CoercionType.Text` (string) + * + * - Excel, Word, and Word Online only: `Office.CoercionType.Matrix` (array of arrays) + * + * - Access, Excel, Word, and Word Online only: `Office.CoercionType.Table` (TableData object) + * + * - Word only: `Office.CoercionType.Html` + * + * - Word and Word Online only: `Office.CoercionType.Ooxml` (Office Open XML) + * + * - PowerPoint and PowerPoint Online only: `Office.CoercionType.SlideRange` + * + * @param options Provides options for customizing what data is returned and how it is formatted. + * + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. */ getSelectedDataAsync(coercionType: CoercionType, options?: GetSelectedDataOptions, callback?: (result: AsyncResult) => void): void; /** @@ -2635,8 +2641,8 @@ declare namespace Office { * Available in Requirement set: File * * No more than two documents are allowed to be in memory; otherwise the Document.getFileAsync operation will fail. Use the File.closeAsync method to close the file when you are finished working with it. - * - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. When the function you passed to the callback parameter executes, it receives an AsyncResult object that you can access from the callback function's only parameter to return the following information. + * + * In the callback function passed to the closeAsync method, you can use the properties of the AsyncResult object to return the following information. * * * @@ -2660,19 +2666,20 @@ declare namespace Office { * * *
A user-defined item of any type that is returned in the AsyncResult object without being altered.
+ * + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. When the function you passed to the callback parameter executes, it receives an AsyncResult object that you can access from the callback function's only parameter to return the following information. */ closeAsync(callback?: (result: AsyncResult) => void): void; /** * Returns the specified slice. * * @remarks + * Hosts: PowerPoint, Word + * + * Available in Requirement set: File * * In the callback function passed to the getSliceAsync method, you can use the properties of the AsyncResult object to return the following information. * - * Hosts: PowerPoint, Word - * @param sliceIndex Specifies the zero-based index of the slice to be retrieved. Required. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. When the function you passed to the callback parameter executes, it receives an AsyncResult object that you can access from the callback function's only parameter to return the following information. - * * * * @@ -2695,8 +2702,9 @@ declare namespace Office { * * *
PropertyA user-defined item of any type that is returned in the AsyncResult object without being altered.
- * - * Available in Requirement set: File + * + * @param sliceIndex Specifies the zero-based index of the slice to be retrieved. Required. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. When the function you passed to the callback parameter executes, it receives an AsyncResult object that you can access from the callback function's only parameter to return the following information. */ getSliceAsync(sliceIndex: number, callback?: (result: AsyncResult) => void): void; } @@ -2814,12 +2822,6 @@ declare namespace Office { * * In the callback function passed to the refreshAsync method, you can use the properties of the AsyncResult object to return the following information. * - * Hosts: Access, Excel, PowerPoint, Word - * - * Available in Requirement set: Settings - * - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. When the function you passed to the callback parameter executes, it receives an AsyncResult object that you can access from the callback function's only parameter to return the following information. - * * * * @@ -2842,6 +2844,12 @@ declare namespace Office { * * *
PropertyA user-defined item of any type that is returned in the AsyncResult object without being altered.
+ * + * Hosts: Access, Excel, PowerPoint, Word + * + * Available in Requirement set: Settings + * + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. When the function you passed to the callback parameter executes, it receives an AsyncResult object that you can access from the callback function's only parameter. */ refreshAsync(callback?: (result: AsyncResult) => void): void; /** @@ -2884,10 +2892,6 @@ declare namespace Office { * * Note: The saveAsync method persists the in-memory settings property bag into the document file; however, the changes to the document file itself are saved only when the user (or AutoRecover setting) saves the document to the file system. The refreshAsync method is only useful in coauthoring scenarios (which are only supported in Word) when other instances of the same add-in might change the settings and those changes should be made available to all instances. * - * Hosts: Access, Excel, PowerPoint, Word - * @param options Provides options for saving settings. - * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. When the function you passed to the callback parameter executes, it receives an AsyncResult object that you can access from the callback function's only parameter to return the following information. - * * * * @@ -2910,6 +2914,11 @@ declare namespace Office { * * *
PropertyA user-defined item of any type that is returned in the AsyncResult object without being altered.
+ * + * Hosts: Access, Excel, PowerPoint, Word + * + * @param options Provides options for saving settings. + * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. When the function you passed to the callback parameter executes, it receives an AsyncResult object that you can access from the callback function's only parameter to return the following information. */ saveAsync(options?: SaveSettingsOptions, callback?: (result: AsyncResult) => void): void; /** @@ -3133,11 +3142,7 @@ declare namespace Office { * * Available in Requirement set: Not in a set * - * - * - * @param tableOptions An object literal containing a list of property name-value pairs that define the table options to apply. - * @param options 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 callback returns, whose only parameter is of type AsyncResult. You can use the properties of the AsyncResult object to return the following information. + * In the callback function passed to the goToByIdAsync method, you can use the properties of the AsyncResult object to return the following information. * * * @@ -3161,6 +3166,12 @@ declare namespace Office { * * *
A user-defined item of any type that is returned in the AsyncResult object without being altered.
+ * + * @param tableOptions An object literal containing a list of property name-value pairs that define the table options to apply. + * @param options 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 callback returns, whose only parameter is of type AsyncResult. You can use the properties of the AsyncResult object to return the following information. + * + */ setTableOptionsAsync(tableOptions: any, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; } From 6ce3bf364440a119a16d464509c7778ece7f8fe4 Mon Sep 17 00:00:00 2001 From: Alex Jerabek Date: Thu, 21 Jun 2018 09:30:37 -0700 Subject: [PATCH 5/5] Adding closing table tags --- types/office-js/index.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/office-js/index.d.ts b/types/office-js/index.d.ts index 1803015c3c..5dd28287c3 100644 --- a/types/office-js/index.d.ts +++ b/types/office-js/index.d.ts @@ -1563,7 +1563,7 @@ declare namespace Office { * An {@link Office.TableData} object * A table with headers will be written. * - * + *
* * Additionally, these application-specific actions apply when writing data to a binding. For Word, the specified data is written to the binding as follows: * @@ -1588,7 +1588,7 @@ declare namespace Office { * Office Open XML ("Open XML") * The specified the XML is written. * - * + *
* * For Excel, the specified data is written to the binding as follows: * @@ -1609,7 +1609,7 @@ declare namespace Office { * An {@link Office.TableData} object, and the shape of the table matches the bound table. * The specified set of rows and/or headers are written, if no other data in surrounding cells will be overwritten. Note: If you specify formulas in the TableData object you pass for the *data* parameter, you might not get the results you expect due to the "calculated columns" feature of Excel, which automatically duplicates formulas within a column. To work around this when you want to write *data* that contains formulas to a bound table, try specifying the data as an array of arrays (instead of a TableData object), and specify the *coercionType* as Microsoft.Office.Matrix or "matrix". * - * + *
* * For Excel Online: *