From 63d8cf1a1facd5d188f73f58f4968e94edd5cbbf Mon Sep 17 00:00:00 2001 From: Alex Jerabek Date: Tue, 5 Jun 2018 18:13:12 -0700 Subject: [PATCH 1/4] Removing redundant mode guidance --- types/office-js/index.d.ts | 121 ++++++++++++++++++------------------- 1 file changed, 60 insertions(+), 61 deletions(-) diff --git a/types/office-js/index.d.ts b/types/office-js/index.d.ts index 718f1bd34f..c6628f722a 100644 --- a/types/office-js/index.d.ts +++ b/types/office-js/index.d.ts @@ -6435,43 +6435,6 @@ declare namespace Office { * Important: This is an internal Outlook object, not directly exposed through existing interfaces. You should treat this as a mode of Office.context.mailbox.item. Refer to the [Object Model pages for more information](https://review.docs.microsoft.com/en-us/javascript/office/objectmodel/preview-requirement-set/office-item?branch=AlexJ-OMPreservation). */ interface Appointment extends Item { - /** - * Gets or sets the recurrence pattern of an appointment. Gets the recurrence pattern of a meeting request. Read and compose modes for appointment items. Read mode for meeting request items. - * - * The recurrence property returns a recurrence object for recurring appointments or meetings requests if an item is a series or an instance in a series. null is returned for single appointments and meeting requests of single appointments. undefined is returned for messages that are not meeting requests. - * - * Note: Meeting requests have an itemClass value of IPM.Schedule.Meeting.Request. - * - * Note: If the recurrence object is null, this indicates that the object is a single appointment or a meeting request of a single appointment and NOT a part of a series. - * - * [Api set: Mailbox Preview] - * - * @remarks - * - * Minimum permission level: ReadItem - * - * Applicable Outlook mode: Compose or read - */ - recurrence: Recurrence; - - /** - * Gets the id of the series that an instance belongs to. - * - * In OWA and Outlook, the seriesId returns the Exchange Web Services (EWS) ID of the parent (series) item that this item belongs to. However, in iOS and Android, the seriesId returns the REST ID of the parent item. - * - * Note: The identifier returned by the seriesId property is the same as the Exchange Web Services item identifier. The seriesId property is not identical to the Outlook IDs used by the Outlook REST API. Before making REST API calls using this value, it should be converted using Office.context.mailbox.convertToRestId. For more details, see [Use the Outlook REST APIs from an Outlook add-in](https://docs.microsoft.com/outlook/add-ins/use-rest-api). - * - * The seriesId property returns null for items that do not have parent items such as single appointments, series items, or meeting requests and returns undefined for any other items that are not meeting requests. - * - * [Api set: Mailbox Preview] - * - * @remarks - * - * Minimum permission level: ReadItem - * - * Applicable Outlook mode: Compose or read - */ - seriesId: string; } /** * Important: This is an internal Outlook object, not directly exposed through existing interfaces. You should treat this as a mode of Office.context.mailbox.item. Refer to the [Object Model pages for more information](https://review.docs.microsoft.com/en-us/javascript/office/objectmodel/preview-requirement-set/office-item?branch=AlexJ-OMPreservation). @@ -6570,11 +6533,26 @@ declare namespace Office { * Important: This is an internal Outlook object, not directly exposed through existing interfaces. You should treat this as a mode of Office.context.mailbox.item. Refer to the [Object Model pages for more information](https://review.docs.microsoft.com/en-us/javascript/office/objectmodel/preview-requirement-set/office-item?branch=AlexJ-OMPreservation). */ interface AppointmentRead extends Appointment, ItemRead { + /** + * Gets the date and time that the appointment is to end. + * + * The end property is expressed as a Coordinated Universal Time (UTC) date and time value. You can use the convertToLocalClientTime method to convert the end property value to the client's local date and time. + * + * The end property returns a Date object. + * + * When you use the Time.setAsync method to set the end time, you should use the convertToUtcClientTime method to convert the local time on the client to UTC for the server. + * + * [Api set: Mailbox 1.0] + * + * @remarks + * + * Minimum permission level: ReadItem + * + * Applicable Outlook mode: Compose or read + */ end: Date; /** - * Gets or sets the location of an appointment. - * - * *Read mode* + * Gets the location of an appointment. * * The location property returns a string that contains the location of the appointment. * @@ -6590,8 +6568,6 @@ declare namespace Office { /** * Provides access to the optional attendees of an event. The type of object and level of access depends on the mode of the current item. * - * *Read mode* - * * The optionalAttendees property returns an array that contains an EmailAddressDetails object for each optional attendee to the meeting. * * [Api set: Mailbox 1.0] @@ -6618,8 +6594,6 @@ declare namespace Office { /** * Provides access to the required attendees of an event. The type of object and level of access depends on the mode of the current item. * - * *Read mode* - * * The requiredAttendees property returns an array that contains an EmailAddressDetails object for each required attendee to the meeting. * * [Api set: Mailbox 1.0] @@ -6632,12 +6606,10 @@ declare namespace Office { */ requiredAttendees: EmailAddressDetails[]; /** - * Gets or sets the date and time that the appointment is to begin. + * Gets the date and time that the appointment is to begin. * * The start property is expressed as a Coordinated Universal Time (UTC) date and time value. You can use the convertToLocalClientTime method to convert the value to the client's local date and time. * - * *Read mode* - * * The start property returns a Date object. * * [Api set: Mailbox 1.0] @@ -6650,6 +6622,7 @@ declare namespace Office { */ start: Date; } + interface AppointmentForm { /** * Gets an object that provides methods for manipulating the body of an item. @@ -6871,6 +6844,44 @@ declare namespace Office { */ notificationMessages: NotificationMessages; + /** + * Gets or sets the recurrence pattern of an appointment. Gets the recurrence pattern of a meeting request. Read and compose modes for appointment items. Read mode for meeting request items. + * + * The recurrence property returns a recurrence object for recurring appointments or meetings requests if an item is a series or an instance in a series. null is returned for single appointments and meeting requests of single appointments. undefined is returned for messages that are not meeting requests. + * + * Note: Meeting requests have an itemClass value of IPM.Schedule.Meeting.Request. + * + * Note: If the recurrence object is null, this indicates that the object is a single appointment or a meeting request of a single appointment and NOT a part of a series. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * Minimum permission level: ReadItem + * + * Applicable Outlook mode: Compose or read + */ + recurrence: Recurrence; + + /** + * Gets the id of the series that an instance belongs to. + * + * In OWA and Outlook, the seriesId returns the Exchange Web Services (EWS) ID of the parent (series) item that this item belongs to. However, in iOS and Android, the seriesId returns the REST ID of the parent item. + * + * Note: The identifier returned by the seriesId property is the same as the Exchange Web Services item identifier. The seriesId property is not identical to the Outlook IDs used by the Outlook REST API. Before making REST API calls using this value, it should be converted using Office.context.mailbox.convertToRestId. For more details, see [Use the Outlook REST APIs from an Outlook add-in](https://docs.microsoft.com/outlook/add-ins/use-rest-api). + * + * The seriesId property returns null for items that do not have parent items such as single appointments, series items, or meeting requests and returns undefined for any other items that are not meeting requests. + * + * [Api set: Mailbox Preview] + * + * @remarks + * + * Minimum permission level: ReadItem + * + * Applicable Outlook mode: Compose or read + */ + seriesId: string; + /** * Adds an event handler for a supported event. * @@ -6980,8 +6991,6 @@ declare namespace Office { * * The subject property gets or sets the entire subject of the item, as sent by the email server. * - * *Compose mode* - * * The subject property returns a Subject object that provides methods to get and set the subject. * * [Api set: Mailbox 1.0] @@ -7638,12 +7647,10 @@ declare namespace Office { */ normalizedSubject: string; /** - * Gets or sets the description that appears in the subject field of an item. + * Gets the description that appears in the subject field of an item. * * The subject property gets or sets the entire subject of the item, as sent by the email server. * - * *Read mode* - * * The subject property returns a string. Use the normalizedSubject property to get the subject minus any leading prefixes such as RE: and FW:. * * [Api set: Mailbox 1.0] @@ -7915,9 +7922,7 @@ declare namespace Office { */ conversationId: string; } - /** - * Important: This is an internal Outlook object, not directly exposed through existing interfaces. You should treat this as a mode of Office.context.mailbox.item. Refer to the [Object Model pages for more information](https://review.docs.microsoft.com/en-us/javascript/office/objectmodel/preview-requirement-set/office-item?branch=AlexJ-OMPreservation). - */ + interface MessageCompose extends Message, ItemCompose { /** * Gets an object that provides methods to get or update the recipients on the Bcc (blind carbon copy) line of a message. Compose mode only. @@ -7966,8 +7971,6 @@ declare namespace Office { /** * Provides access to the recipients on the To line of a message. The type of object and level of access depends on the mode of the current item. * - * *Compose mode* - * * The to property returns a Recipients object that provides methods to get or update the recipients on the To line of the message. * * [Api set: Mailbox 1.0] @@ -7987,8 +7990,6 @@ declare namespace Office { /** * 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. * - * *Read mode* - * * The cc property returns an array that contains an EmailAddressDetails object for each recipient listed on the Cc line of the message. The collection is limited to a maximum of 100 members. * * [Api set: Mailbox 1.0] @@ -8049,8 +8050,6 @@ declare namespace Office { /** * Provides access to the recipients on the To line of a message. The type of object and level of access depends on the mode of the current item. * - * *Read mode* - * * The to property returns an array that contains an EmailAddressDetails object for each recipient listed on the To line of the message. The collection is limited to a maximum of 100 members. * * [Api set: Mailbox 1.0] From cc2065ff1f30e1144ccaaf1fda4fc894de5c9c22 Mon Sep 17 00:00:00 2001 From: Alex Jerabek Date: Wed, 6 Jun 2018 08:27:37 -0700 Subject: [PATCH 2/4] Documenting the ReplyFormData and ReplyFormAttachment types --- types/office-js/index.d.ts | 50 ++++++++++++++++++++++++++------------ 1 file changed, 34 insertions(+), 16 deletions(-) diff --git a/types/office-js/index.d.ts b/types/office-js/index.d.ts index c6628f722a..dc122635c1 100644 --- a/types/office-js/index.d.ts +++ b/types/office-js/index.d.ts @@ -7682,14 +7682,7 @@ declare namespace Office { * * @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 - * htmlBody: A string that contains text and HTML and that represents the body of the reply form. The string is limited to 32 KB. - * attachments: An array of JSON objects that are either file or item attachments. - * attachments.type: Indicates the type of attachment. Must be file for a file attachment or item for an item attachment. - * attachments.name: A string that contains the name of the attachment, up to 255 characters in length. - * attachments.url: Only used if type is set to file. The URI of the location for the file. - * attachments.isLine: Only used if type is set to file. If true, indicates that the attachment will be shown inline in the message body, and should not be displayed in the attachment list. - * attachments.itemId: Only used if type is set to item. The EWS item id of the attachment. This is a string up to 100 characters. + * A ReplyFormData object that contains body or attachment data and a callback function */ displayReplyAllForm(formData: string | ReplyFormData): void; /** @@ -7713,14 +7706,7 @@ declare namespace Office { * * @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. The object is defined as follows. - * htmlBody: A string that contains text and HTML and that represents the body of the reply form. The string is limited to 32 KB. - * attachments: An array of JSON objects that are either file or item attachments. - * attachments.type: Indicates the type of attachment. Must be file for a file attachment or item for an item attachment. - * attachments.name: A string that contains the name of the attachment, up to 255 characters in length. - * attachments.url: Only used if type is set to file. The URI of the location for the file. - * attachments.isLine: Only used if type is set to file. If true, indicates that the attachment will be shown inline in the message body, and should not be displayed in the attachment list. - * attachments.itemId: Only used if type is set to item. The EWS item id of the attachment. This is a string up to 100 characters. + * A ReplyFormData object that contains body or attachment data and a callback function. */ displayReplyForm(formData: string | ReplyFormData): void; /** @@ -9401,15 +9387,47 @@ declare namespace Office { firstDayOfWeek: MailboxEnums.Days; } + /** + * A file or item attachment. Used when displaying a reply form + */ export interface ReplyFormAttachment { + /** + * Indicates the type of attachment. Must be file for a file attachment or item for an item attachment. + */ type: string; + /** + * A string that contains the name of the attachment, up to 255 characters in length. + */ name: string; + /** + * Only used if type is set to file. The URI of the location for the file. + */ url?: string; + /** + * Only used if type is set to file. If true, indicates that the attachment will be shown inline in the message body, and should not be displayed in the attachment list. + */ + inLine?: boolean; + /** + * Only used if type is set to item. The EWS item id of the attachment. This is a string up to 100 characters. + */ itemId?: string; } + + /** + * A ReplyFormData object that contains body or attachment data and a callback function. Used when displaying a reply form. + */ interface ReplyFormData { + /** + * A string that contains text and HTML and that represents the body of the reply form. The string is limited to 32 KB. + */ htmlBody?: string; + /** + * An array of ReplyFormAttachments that are either file or item attachments. + */ attachments?: ReplyFormAttachment[]; + /** + * When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. On success, the initialization data is provided in the asyncResult.value property as a string. If there is no initialization context, the asyncResult object will contain an Error object with its code property set to 9020 and its name property set to GenericResponseError. + */ callback?: (result: AsyncResult) => void; } /** From 10af13f86145337bfc346b277fd00eb88c8919c9 Mon Sep 17 00:00:00 2001 From: Alex Jerabek Date: Wed, 6 Jun 2018 11:23:05 -0700 Subject: [PATCH 3/4] Correcting callback description --- 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 dc122635c1..93cf3ee07a 100644 --- a/types/office-js/index.d.ts +++ b/types/office-js/index.d.ts @@ -9388,7 +9388,7 @@ declare namespace Office { } /** - * A file or item attachment. Used when displaying a reply form + * A file or item attachment. Used when displaying a reply form. */ export interface ReplyFormAttachment { /** @@ -9426,7 +9426,7 @@ declare namespace Office { */ attachments?: ReplyFormAttachment[]; /** - * When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. On success, the initialization data is provided in the asyncResult.value property as a string. If there is no initialization context, the asyncResult object will contain an Error object with its code property set to 9020 and its name property set to GenericResponseError. + * When the reply display call completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. */ callback?: (result: AsyncResult) => void; } From 84137149e466c9964c8dd56d72b7e395ea104ac2 Mon Sep 17 00:00:00 2001 From: Alex Jerabek Date: Wed, 6 Jun 2018 11:41:49 -0700 Subject: [PATCH 4/4] Correcting callback description --- types/office-js/index.d.ts | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/types/office-js/index.d.ts b/types/office-js/index.d.ts index 93cf3ee07a..5af6916816 100644 --- a/types/office-js/index.d.ts +++ b/types/office-js/index.d.ts @@ -6432,12 +6432,12 @@ declare namespace Office { } /** - * Important: This is an internal Outlook object, not directly exposed through existing interfaces. You should treat this as a mode of Office.context.mailbox.item. Refer to the [Object Model pages for more information](https://review.docs.microsoft.com/en-us/javascript/office/objectmodel/preview-requirement-set/office-item?branch=AlexJ-OMPreservation). + * Important: This is an internal Outlook object, not directly exposed through existing interfaces. You should treat this as a mode of Office.context.mailbox.item. Refer to the Object Model pages for more information. */ interface Appointment extends Item { } /** - * Important: This is an internal Outlook object, not directly exposed through existing interfaces. You should treat this as a mode of Office.context.mailbox.item. Refer to the [Object Model pages for more information](https://review.docs.microsoft.com/en-us/javascript/office/objectmodel/preview-requirement-set/office-item?branch=AlexJ-OMPreservation). + * Important: This is an internal Outlook object, not directly exposed through existing interfaces. You should treat this as a mode of Office.context.mailbox.item. Refer to the Object Model pages for more information. */ interface AppointmentCompose extends Appointment, ItemCompose { /** @@ -6530,7 +6530,7 @@ declare namespace Office { start: Time; } /** - * Important: This is an internal Outlook object, not directly exposed through existing interfaces. You should treat this as a mode of Office.context.mailbox.item. Refer to the [Object Model pages for more information](https://review.docs.microsoft.com/en-us/javascript/office/objectmodel/preview-requirement-set/office-item?branch=AlexJ-OMPreservation). + * Important: This is an internal Outlook object, not directly exposed through existing interfaces. You should treat this as a mode of Office.context.mailbox.item. Refer to the Object Model pages for more information. */ interface AppointmentRead extends Appointment, ItemRead { /** @@ -6983,7 +6983,7 @@ declare namespace Office { removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void; } /** - * Important: This is an internal Outlook object, not directly exposed through existing interfaces. You should treat this as a mode of Office.context.mailbox.item. Refer to the [Object Model pages for more information](https://review.docs.microsoft.com/en-us/javascript/office/objectmodel/preview-requirement-set/office-item?branch=AlexJ-OMPreservation). + * Important: This is an internal Outlook object, not directly exposed through existing interfaces. You should treat this as a mode of Office.context.mailbox.item. Refer to the Object Model pages for more information. */ interface ItemCompose extends Item { /** @@ -7577,7 +7577,7 @@ declare namespace Office { setSelectedDataAsync(data: string, callback: (result: AsyncResult) => void): void; } /** - * Important: This is an internal Outlook object, not directly exposed through existing interfaces. You should treat this as a mode of Office.context.mailbox.item. Refer to the [Object Model pages for more information](https://review.docs.microsoft.com/en-us/javascript/office/objectmodel/preview-requirement-set/office-item?branch=AlexJ-OMPreservation). + * Important: This is an internal Outlook object, not directly exposed through existing interfaces. You should treat this as a mode of Office.context.mailbox.item. Refer to the Object Model pages for more information. */ interface ItemRead extends Item { /** @@ -7888,7 +7888,7 @@ declare namespace Office { getSelectedRegExMatches(): any; } /** - * Important: This is an internal Outlook object, not directly exposed through existing interfaces. You should treat this as a mode of Office.context.mailbox.item. Refer to the [Object Model pages for more information](https://review.docs.microsoft.com/en-us/javascript/office/objectmodel/preview-requirement-set/office-item?branch=AlexJ-OMPreservation). + * Important: This is an internal Outlook object, not directly exposed through existing interfaces. You should treat this as a mode of Office.context.mailbox.item. Refer to the Object Model pages for more information. */ interface Message extends Item { /** @@ -7909,6 +7909,9 @@ declare namespace Office { conversationId: string; } + /** + * Important: This is an internal Outlook object, not directly exposed through existing interfaces. You should treat this as a mode of Office.context.mailbox.item. Refer to the Object Model pages for more information. + */ interface MessageCompose extends Message, ItemCompose { /** * Gets an object that provides methods to get or update the recipients on the Bcc (blind carbon copy) line of a message. Compose mode only. @@ -7970,7 +7973,7 @@ declare namespace Office { to: Recipients; } /** - * Important: This is an internal Outlook object, not directly exposed through existing interfaces. You should treat this as a mode of Office.context.mailbox.item. Refer to the [Object Model pages for more information](https://review.docs.microsoft.com/en-us/javascript/office/objectmodel/preview-requirement-set/office-item?branch=AlexJ-OMPreservation). + * Important: This is an internal Outlook object, not directly exposed through existing interfaces. You should treat this as a mode of Office.context.mailbox.item. Refer to the Object Model pages for more information. */ interface MessageRead extends Message, ItemRead { /**