From 38de405bdb5fd465415442c25706beb56cdf01fe Mon Sep 17 00:00:00 2001 From: Elizabeth Samuel Date: Wed, 10 Apr 2019 16:10:04 -0700 Subject: [PATCH] [office-js-preview] (Outlook) Add masterCategories --- types/office-js-preview/index.d.ts | 155 ++++++++++++++++++++++++++++- 1 file changed, 154 insertions(+), 1 deletion(-) diff --git a/types/office-js-preview/index.d.ts b/types/office-js-preview/index.d.ts index 9778889180..1d38421847 100644 --- a/types/office-js-preview/index.d.ts +++ b/types/office-js-preview/index.d.ts @@ -16912,6 +16912,21 @@ declare namespace Office { * `ItemCompose`, `ItemRead`, `MessageCompose`, `MessageRead`, `AppointmentCompose`, `AppointmentRead` */ item: Item & ItemCompose & ItemRead & MessageRead & MessageCompose & AppointmentRead & AppointmentCompose; + /** + * Gets an object that provides methods to manage the categories master list associated with a mailbox. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadMailbox
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
+ * + * @beta + */ + masterCategories: MasterCategories; /** * Gets the URL of the REST endpoint for this email account. * @@ -17400,7 +17415,8 @@ 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. + * The user defines {@link MasterCategories | categories in a master list} on their mailbox. + * They can then apply one or more categories to an item. * * [Api set: Mailbox Preview] * @@ -17555,6 +17571,143 @@ declare namespace Office { color: Office.MailboxEnums.CategoryColor; } + /** + * Represents the categories master list on the mailbox. + * + * 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] + * + * @remarks + * + * + * + *
{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}ReadMailbox
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
+ * + * @beta + */ + interface MasterCategories { + /** + * Adds categories to the master list on a mailbox. Each category must have a unique name but multiple categories can use the same color. + * + * @param categories - The categories to be added to the master list on the mailbox. + * @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}ReadWriteMailbox
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
ErrorsDuplicateCategory - One of the categories provided is already in the master category list.
PermissionDenied - The user does not have permission to perform this action.
+ * + * @beta + */ + addAsync(categories: CategoryDetails[], options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; + /** + * Adds categories to the master list on a mailbox. Each category must have a unique name but multiple categories can use the same color. + * + * @param categories - The categories to be added to the master list on the mailbox. + * @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}ReadWriteMailbox
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
ErrorsDuplicateCategory - One of the categories provided is already in the master category list.
PermissionDenied - The user does not have permission to perform this action.
+ * + * @beta + */ + addAsync(categories: CategoryDetails[], callback: (asyncResult: Office.AsyncResult) => void): void; + /** + * Gets the master list of categories on a mailbox. + * + * @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. 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}ReadMailbox
{@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 the master list of categories on a mailbox. + * + * @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}ReadMailbox
{@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 the master list on a mailbox. + * + * @param categories - The categories to be removed from the master list on the mailbox. + * @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. 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}ReadWriteMailbox
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
ErrorsPermissionDenied - The user does not have permission to perform this action.
+ * + * @beta + */ + removeAsync(categories: CategoryDetails[], options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; + /** + * Removes categories from the master list on a mailbox. + * + * @param categories - The categories to be removed from the master list on the mailbox. + * @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}ReadWriteMailbox
{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}Compose or Read
ErrorsPermissionDenied - The user does not have permission to perform this action.
+ * + * @beta + */ + removeAsync(categories: CategoryDetails[], callback: (asyncResult: Office.AsyncResult) => void): void; + } + /** * Represents a suggested meeting found in an item. Read mode only. *