From bb0e5dd38fb61360d517ca12eb7d1b104868d3b0 Mon Sep 17 00:00:00 2001 From: Elizabeth Samuel Date: Wed, 3 Apr 2019 16:34:02 -0700 Subject: [PATCH 1/4] [office-js-preview] (Outlook) Add Feb-Mar preview features --- types/office-js-preview/index.d.ts | 309 +++++++++++++++++++++++++++++ 1 file changed, 309 insertions(+) diff --git a/types/office-js-preview/index.d.ts b/types/office-js-preview/index.d.ts index 32719bafe9..6a5857604f 100644 --- a/types/office-js-preview/index.d.ts +++ b/types/office-js-preview/index.d.ts @@ -9573,6 +9573,124 @@ declare namespace Office { */ Removed = "removed" } + /** + * Specifies the category color. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
+ * + * @beta + */ + enum CategoryColor { + /** + * Default color + */ + None, + /** + * Red + */ + Red, + /** + * Orange + */ + Orange, + /** + * Yellow + */ + Yellow, + /** + * Green + */ + Green, + /** + * Teal + */ + Teal, + /** + * Olive + */ + Olive, + /** + * Blue + */ + Blue, + /** + * Purple + */ + Purple, + /** + * Peach/Brown + */ + Peach, // TODO: Confirm if this or Brown + /** + * Maroon/Cranberry + */ + Maroon, // TODO: Confirm if this or Cranberry + /** + * Dark peach/Dark brown + */ + DarkPeach, // TODO: Confirm if this or DarkBrown(Graph) + /** + * Dark maroon/Dark cranberry + */ + DarkMaroon, // TODO: Confirm if this or DarkCranberry(Graph) + /** + * Steel + */ + Steel, + /** + * Dark steel + */ + DarkSteel, + /** + * Gray + */ + Gray, + /** + * Dark gray + */ + DarkGray, + /** + * Black + */ + Black, + /** + * Dark red + */ + DarkRed, + /** + * Dark orange + */ + DarkOrange, + /** + * Dark yellow + */ + DarkYellow, + /** + * Dark green + */ + DarkGreen, + /** + * Dark teal + */ + DarkTeal, + /** + * Dark olive + */ + DarkOlive, + /** + * Dark blue + */ + DarkBlue, + /** + * Dark purple + */ + DarkPurple + } /** * Specifies an attachment's type. * @@ -11875,6 +11993,21 @@ declare namespace Office { * */ body: Body; + /** + * Gets an object that provides methods for managing the item's categories. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Organizer
+ * + * @beta + */ + categories: Categories; /** * Gets or sets the date and time that the appointment is to end. * @@ -12746,6 +12879,21 @@ declare namespace Office { * */ body: Body; + /** + * Gets an object that provides methods for managing the item's categories. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Appointment Attendee
+ * + * @beta + */ + categories: Categories; /** * Gets the date and time that an item was created. * @@ -13515,6 +13663,21 @@ declare namespace Office { * */ body: Body; + /** + * Gets an object that provides methods for managing the item's categories. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
+ * + * @beta + */ + categories: Categories; /** * Gets the type of item that an instance represents. * @@ -14898,6 +15061,21 @@ declare namespace Office { * */ body: Body; + /** + * Gets an object that provides methods for managing the item's categories. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
+ * + * @beta + */ + categories: Categories; /** * Provides access to the Cc (carbon copy) recipients of a message. The type of object and level of access depends on the mode of the * current item. @@ -15739,6 +15917,21 @@ declare namespace Office { * */ body: Body; + /** + * Gets an object that provides methods for managing the item's categories. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Read
+ * + * @beta + */ + categories: Categories; /** * Provides access to the Cc (carbon copy) recipients of a message. The type of object and level of access depends on the mode of the * current item. @@ -17200,6 +17393,122 @@ declare namespace Office { removeHandlerAsync(eventType: Office.EventType, callback?: (asyncResult: Office.AsyncResult) => void): void; } + /** + * Represents the categories on an item. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
+ * + * @beta + */ + interface Categories { + /** + * Adds categories to an item. Each category name must be unique to that mailbox but multiple categories can use the same color. + * + * @param categories - The categories to be added to the item. + * @param options - Optional. An object literal that contains one or more of the following properties. + * asyncContext: Developers can provide any object they wish to access in the callback method. + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type Office.AsyncResult. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
+ * + * @beta + */ + addAsync(categories: string[], options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; + /** + * Gets an item's categories. + * + * @param options - An object literal that contains one or more of the following properties. + * asyncContext: Developers can provide any object they wish to access in the callback method. + * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of + * type Office.AsyncResult. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
+ * + * @beta + */ + getAsync(options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult) => void): void; + /** + * Gets an item's categories. + * + * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of + * type Office.AsyncResult. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
+ * + * @beta + */ + getAsync(callback: (asyncResult: Office.AsyncResult) => void): void; + /** + * Removes categories from an item. + * + * @param categories - The categories to be removed from the item. + * @param options - Optional. An object literal that contains one or more of the following properties. + * asyncContext: Developers can provide any object they wish to access in the callback method. + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of + * type Office.AsyncResult. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
+ * + * @beta + */ + removeAsync(categories: string[], options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; + } + + /** + * Represents the details of an item's category. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
+ * + * @beta + */ + interface CategoryDetails { + /** + * The name of the category. Maximum length is 255 characters. + */ + displayName: string; + /** + * The color of the category. + */ + color: Office.MailboxEnums.CategoryColor; + } + /** * Represents a suggested meeting found in an item. Read mode only. * From 0b13574a737beb6f7663f67c187555ea4508da26 Mon Sep 17 00:00:00 2001 From: Elizabeth Samuel Date: Thu, 4 Apr 2019 16:02:13 -0700 Subject: [PATCH 2/4] Initial update based on feedback --- types/office-js-preview/index.d.ts | 162 +++++++++++++++++------------ 1 file changed, 96 insertions(+), 66 deletions(-) diff --git a/types/office-js-preview/index.d.ts b/types/office-js-preview/index.d.ts index 6a5857604f..7b94243c31 100644 --- a/types/office-js-preview/index.d.ts +++ b/types/office-js-preview/index.d.ts @@ -9587,109 +9587,109 @@ declare namespace Office { */ enum CategoryColor { /** - * Default color + * Default color or no color mapped */ None, /** * Red */ - Red, + Preset0, /** * Orange */ - Orange, + Preset1, + /** + * Brown + */ + Preset2, /** * Yellow */ - Yellow, + Preset3, /** * Green */ - Green, + Preset4, /** * Teal */ - Teal, + Preset5, /** * Olive */ - Olive, + Preset6, /** * Blue */ - Blue, + Preset7, /** * Purple */ - Purple, + Preset8, /** - * Peach/Brown + * Cranberry */ - Peach, // TODO: Confirm if this or Brown - /** - * Maroon/Cranberry - */ - Maroon, // TODO: Confirm if this or Cranberry - /** - * Dark peach/Dark brown - */ - DarkPeach, // TODO: Confirm if this or DarkBrown(Graph) - /** - * Dark maroon/Dark cranberry - */ - DarkMaroon, // TODO: Confirm if this or DarkCranberry(Graph) + Preset9, /** * Steel */ - Steel, + Preset10, /** - * Dark steel + * DarkSteel */ - DarkSteel, + Preset11, /** * Gray */ - Gray, + Preset12, /** - * Dark gray + * DarkGray */ - DarkGray, + Preset13, /** * Black */ - Black, + Preset14, /** - * Dark red + * DarkRed */ - DarkRed, + Preset15, /** - * Dark orange + * DarkOrange */ - DarkOrange, + Preset16, /** - * Dark yellow + * DarkBrown */ - DarkYellow, + Preset17, /** - * Dark green + * DarkYellow */ - DarkGreen, + Preset18, /** - * Dark teal + * DarkGreen */ - DarkTeal, + Preset19, /** - * Dark olive + * DarkTeal */ - DarkOlive, + Preset20, /** - * Dark blue + * DarkOlive */ - DarkBlue, + Preset21, /** - * Dark purple + * DarkBlue */ - DarkPurple + Preset22, + /** + * DarkPurple + */ + Preset23, + /** + * DarkCranberry + */ + Preset24 } /** * Specifies an attachment's type. @@ -15061,21 +15061,6 @@ declare namespace Office { * */ body: Body; - /** - * Gets an object that provides methods for managing the item's categories. - * - * [Api set: Mailbox Preview] - * - * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
- * - * @beta - */ - categories: Categories; /** * Provides access to the Cc (carbon copy) recipients of a message. The type of object and level of access depends on the mode of the * current item. @@ -17395,6 +17380,9 @@ declare namespace Office { /** * Represents the categories on an item. + * + * In Outlook, a user can group messages and appointments by using a category to color-code them. + * The user defines categories in a master list on their mailbox. They can then apply one or more categories to an item. * * [Api set: Mailbox Preview] * @@ -17409,6 +17397,7 @@ declare namespace Office { interface Categories { /** * Adds categories to an item. Each category name must be unique to that mailbox but multiple categories can use the same color. + * Each category must also be in the categories master list. * * @param categories - The categories to be added to the item. * @param options - Optional. An object literal that contains one or more of the following properties. @@ -17422,18 +17411,41 @@ declare namespace Office { * * * + * + * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
ErrorsNumberOfCategoriesExceeded - The number of categories exceeded the maximum amount.
InvalidCategory - Invalid categories were provided.
* * @beta */ addAsync(categories: string[], options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; + /** + * Adds categories to an item. Each category name must be unique to that mailbox but multiple categories can use the same color. + * Each category must also be in the categories master list. + * + * @param categories - The categories to be added to the item. + * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of + * type Office.AsyncResult. If adding categories fails, the asyncResult.error property will contain an error code. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
ErrorsNumberOfCategoriesExceeded - The number of categories exceeded the maximum amount.
InvalidCategory - Invalid categories were provided.
+ * + * @beta + */ + addAsync(categories: string[], callback: (asyncResult: Office.AsyncResult) => void): void; /** * Gets an item's categories. * * @param options - An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of - * type Office.AsyncResult. + * type Office.AsyncResult. If adding categories fails, the asyncResult.error property will contain an error code. * * [Api set: Mailbox Preview] * @@ -17445,7 +17457,7 @@ declare namespace Office { * * @beta */ - getAsync(options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult) => void): void; + getAsync(options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult) => void): void; /** * Gets an item's categories. * @@ -17462,7 +17474,7 @@ declare namespace Office { * * @beta */ - getAsync(callback: (asyncResult: Office.AsyncResult) => void): void; + getAsync(callback: (asyncResult: Office.AsyncResult) => void): void; /** * Removes categories from an item. * @@ -17470,7 +17482,7 @@ declare namespace Office { * @param options - Optional. An object literal that contains one or more of the following properties. * asyncContext: Developers can provide any object they wish to access in the callback method. * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type Office.AsyncResult. + * type Office.AsyncResult. If removing categories fails, the asyncResult.error property will contain an error code. * * [Api set: Mailbox Preview] * @@ -17483,10 +17495,28 @@ declare namespace Office { * @beta */ removeAsync(categories: string[], options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; + /** + * Removes categories from an item. + * + * @param categories - The categories to be removed from the item. + * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of + * type Office.AsyncResult. If removing categories fails, the asyncResult.error property will contain an error code. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
+ * + * @beta + */ + removeAsync(categories: string[], callback: (asyncResult: Office.AsyncResult) => void): void; } /** - * Represents the details of an item's category. + * Represents an item's category details like name and associated color. * * [Api set: Mailbox Preview] * From 5862db33f651ea5f68260994ca0e09b9640d559c Mon Sep 17 00:00:00 2001 From: Elizabeth Samuel Date: Thu, 4 Apr 2019 16:07:55 -0700 Subject: [PATCH 3/4] Remove categories property from Item --- types/office-js-preview/index.d.ts | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/types/office-js-preview/index.d.ts b/types/office-js-preview/index.d.ts index 7b94243c31..aa29c3c25e 100644 --- a/types/office-js-preview/index.d.ts +++ b/types/office-js-preview/index.d.ts @@ -13663,21 +13663,6 @@ declare namespace Office { * */ body: Body; - /** - * Gets an object that provides methods for managing the item's categories. - * - * [Api set: Mailbox Preview] - * - * @remarks - * - * - * - * - *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
- * - * @beta - */ - categories: Categories; /** * Gets the type of item that an instance represents. * From fb502e72bc0faa883f959c17b2bf4ee40e18719b Mon Sep 17 00:00:00 2001 From: Elizabeth Samuel Date: Fri, 5 Apr 2019 15:03:11 -0700 Subject: [PATCH 4/4] Updates based on feedback --- types/office-js-preview/index.d.ts | 47 +++++++++++++++++++++++++----- 1 file changed, 39 insertions(+), 8 deletions(-) diff --git a/types/office-js-preview/index.d.ts b/types/office-js-preview/index.d.ts index aa29c3c25e..9778889180 100644 --- a/types/office-js-preview/index.d.ts +++ b/types/office-js-preview/index.d.ts @@ -9576,6 +9576,9 @@ declare namespace Office { /** * Specifies the category color. * + * **Note**: The actual color depends on how the Outlook client renders it. + * In this case, the colors noted on each preset are for the Outlook desktop client. + * * [Api set: Mailbox Preview] * * @remarks @@ -13663,6 +13666,21 @@ declare namespace Office { * */ body: Body; + /** + * Gets an object that provides methods for managing the item's categories. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
+ * + * @beta + */ + categories: Categories; /** * Gets the type of item that an instance represents. * @@ -15046,6 +15064,21 @@ declare namespace Office { * */ body: Body; + /** + * Gets an object that provides methods for managing the item's categories. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Message Compose
+ * + * @beta + */ + categories: Categories; /** * Provides access to the Cc (carbon copy) recipients of a message. The type of object and level of access depends on the mode of the * current item. @@ -17381,8 +17414,8 @@ declare namespace Office { */ interface Categories { /** - * Adds categories to an item. Each category name must be unique to that mailbox but multiple categories can use the same color. - * Each category must also be in the categories master list. + * Adds categories to an item. Each category must be in the categories master list on that mailbox and so must have a unique name + * but multiple categories can use the same color. * * @param categories - The categories to be added to the item. * @param options - Optional. An object literal that contains one or more of the following properties. @@ -17396,16 +17429,15 @@ declare namespace Office { * * * - * - * + * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
ErrorsNumberOfCategoriesExceeded - The number of categories exceeded the maximum amount.
InvalidCategory - Invalid categories were provided.
ErrorsInvalidCategory - Invalid categories were provided.
* * @beta */ addAsync(categories: string[], options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** - * Adds categories to an item. Each category name must be unique to that mailbox but multiple categories can use the same color. - * Each category must also be in the categories master list. + * Adds categories to an item. Each category must be in the categories master list on that mailbox and so must have a unique name + * but multiple categories can use the same color. * * @param categories - The categories to be added to the item. * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of @@ -17417,8 +17449,7 @@ declare namespace Office { * * * - * - * + * *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadWriteItem
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
ErrorsNumberOfCategoriesExceeded - The number of categories exceeded the maximum amount.
InvalidCategory - Invalid categories were provided.
ErrorsInvalidCategory - Invalid categories were provided.
* * @beta