From fdb98730086da8309dd67c81948334b3fdd48a1f Mon Sep 17 00:00:00 2001 From: Alex Jerabek Date: Thu, 14 Jun 2018 13:52:16 -0700 Subject: [PATCH 1/3] Adding LoadOption comments --- types/office-js/index.d.ts | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/types/office-js/index.d.ts b/types/office-js/index.d.ts index 9a2f8981a5..a5f51c7601 100644 --- a/types/office-js/index.d.ts +++ b/types/office-js/index.d.ts @@ -10198,10 +10198,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 72abb55f7538ff7806b8cbd0a595f73817ffc2d1 Mon Sep 17 00:00:00 2001 From: Alex Jerabek Date: Wed, 20 Jun 2018 10:21:46 -0700 Subject: [PATCH 2/3] Removing erroneous text --- types/office-js/index.d.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/types/office-js/index.d.ts b/types/office-js/index.d.ts index 440df63e88..c8cb56fa16 100644 --- a/types/office-js/index.d.ts +++ b/types/office-js/index.d.ts @@ -13589,12 +13589,11 @@ declare namespace OfficeExtension { expand?: string | string[]; /** * Only usable on collection types. Specifies the maximum number of collection items that can be included in the result. - * You can only use this option when you use the object notation option. */ top?: number; /** - * Only usable on collection types. Specifies 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. You can only use this option when you use the object notation option. - */ + * Only usable on collection types. Specifies 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. + */ skip?: number; } /** From 49e1c1d7a858aec82db46319337c0f93fa00713f Mon Sep 17 00:00:00 2001 From: Alex Jerabek Date: Wed, 20 Jun 2018 10:23:08 -0700 Subject: [PATCH 3/3] Removing erroneous text --- types/office-js/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/office-js/index.d.ts b/types/office-js/index.d.ts index c8cb56fa16..eea1cd2bb0 100644 --- a/types/office-js/index.d.ts +++ b/types/office-js/index.d.ts @@ -13588,12 +13588,12 @@ declare namespace OfficeExtension { */ expand?: string | string[]; /** - * Only usable on collection types. Specifies the maximum number of collection items that can be included in the result. + * Only usable on collection types. Specifies the maximum number of collection items that can be included in the result. */ top?: number; /** * Only usable on collection types. Specifies 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. - */ + */ skip?: number; } /**