Skip to content

Commit dfb194a

Browse files
[office-js][office-js-preview] (Outlook) Document support for Base64 attachments in reply forms (DefinitelyTyped#71431)
1 parent 6a37d9c commit dfb194a

File tree

2 files changed

+115
-44
lines changed

2 files changed

+115
-44
lines changed

types/office-js-preview/index.d.ts

Lines changed: 58 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8874,26 +8874,40 @@ declare namespace Office {
88748874
*
88758875
* @remarks
88768876
*
8877+
* [Api set: Mailbox 1.1]
8878+
*
88778879
* **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read
88788880
*/
88798881
enum AttachmentType {
88808882
/**
8881-
* The attachment is a file.
8882-
*/
8883-
File = "file",
8884-
/**
8885-
* The attachment is an Exchange item.
8883+
* The attachment is a Base64-encoded file.
8884+
*
8885+
* **Important**: The `base64` attachment type is only supported by the `displayReplyAllForm`, `displayReplyAllFormAsync`, `displayReplyForm`, and
8886+
* `displayReplyFormAsync` methods.
8887+
*
8888+
* [Api set: Mailbox 1.15]
88868889
*/
8887-
Item = "item",
8890+
Base64 = "base64",
88888891
/**
88898892
* The attachment is stored in a cloud location, such as OneDrive.
88908893
*
88918894
* **Important**: In Read mode, the `id` property of the attachment's {@link Office.AttachmentDetails | details} object
88928895
* contains a URL to the file.
88938896
* From requirement set 1.8, the `url` property included in the attachment's {@link Office.AttachmentDetailsCompose | details} object
88948897
* contains a URL to the file in Compose mode.
8898+
*
8899+
* The `cloud` attachment type isn't supported by the `displayNewMessageForm`, `displayNewMessageFormAsync`, `displayReplyAllForm`, `displayReplyAllFormAsync`,
8900+
* `displayReplyForm`, and `displayReplyFormAsync` methods.
8901+
*/
8902+
Cloud = "cloud",
8903+
/**
8904+
* The attachment is a file.
88958905
*/
8896-
Cloud = "cloud"
8906+
File = "file",
8907+
/**
8908+
* The attachment is an Exchange item.
8909+
*/
8910+
Item = "item"
88978911
}
88988912
/**
88998913
* Specifies the category color.
@@ -17678,9 +17692,10 @@ declare namespace Office {
1767817692
*
1767917693
* `htmlBody`: The HTML body of the message. The body content is limited to a maximum size of 32 KB.
1768017694
*
17681-
* `attachments`: An array of JSON objects that are either file or item attachments.
17695+
* `attachments`: An array of JSON objects that are either file or Exchange item attachments.
1768217696
*
17683-
* `attachments.type`: Indicates the type of attachment. Must be `file` for a file attachment or `item` for an item attachment.
17697+
* `attachments.type`: Indicates the type of attachment. Must be `Office.MailboxEnums.AttachmentType.File` for a file attachment or
17698+
* `Office.MailboxEnums.AttachmentType.Item` for an Exchange item attachment.
1768417699
*
1768517700
* `attachments.name`: A string that contains the name of the attachment, up to 255 characters in length.
1768617701
*
@@ -17725,9 +17740,10 @@ declare namespace Office {
1772517740
*
1772617741
* `htmlBody`: The HTML body of the message. The body content is limited to a maximum size of 32 KB.
1772717742
*
17728-
* `attachments`: An array of JSON objects that are either file or item attachments.
17743+
* `attachments`: An array of JSON objects that are either file or Exchange item attachments.
1772917744
*
17730-
* `attachments.type`: Indicates the type of attachment. Must be `file` for a file attachment or `item` for an item attachment.
17745+
* `attachments.type`: Indicates the type of attachment. Must be `Office.MailboxEnums.AttachmentType.File` for a file attachment or
17746+
* `Office.MailboxEnums.AttachmentType.Item` for an Exchange item attachment.
1773117747
*
1773217748
* `attachments.name`: A string that contains the name of the attachment, up to 255 characters in length.
1773317749
*
@@ -17776,9 +17792,10 @@ declare namespace Office {
1777617792
*
1777717793
* `htmlBody`: The HTML body of the message. The body content is limited to a maximum size of 32 KB.
1777817794
*
17779-
* `attachments`: An array of JSON objects that are either file or item attachments.
17795+
* `attachments`: An array of JSON objects that are either file or Exchange item attachments.
1778017796
*
17781-
* `attachments.type`: Indicates the type of attachment. Must be `file` for a file attachment or `item` for an item attachment.
17797+
* `attachments.type`: Indicates the type of attachment. Must be `Office.MailboxEnums.AttachmentType.File` for a file attachment or
17798+
* `Office.MailboxEnums.AttachmentType.Item` for an Exchange item attachment.
1778217799
*
1778317800
* `attachments.name`: A string that contains the name of the attachment, up to 255 characters in length.
1778417801
*
@@ -22443,29 +22460,49 @@ declare namespace Office {
2244322460
*/
2244422461
interface ReplyFormAttachment {
2244522462
/**
22446-
* Indicates the type of attachment. Must be file for a file attachment or item for an item attachment.
22463+
* Indicates the type of attachment.
22464+
*
22465+
* @remarks
22466+
*
22467+
* **Important**:
22468+
*
22469+
* - The `base64` attachment type was introduced in Mailbox requirement set 1.15. It's only supported by the `displayReplyAllForm`, `displayReplyAllFormAsync`, `displayReplyForm`, and
22470+
* `displayReplyFormAsync` methods.
22471+
*
22472+
* - The `cloud` attachment type isn't supported by the `displayNewMessageForm`, `displayNewMessageFormAsync`, `displayReplyAllForm`, `displayReplyAllFormAsync`,
22473+
* `displayReplyForm`, and `displayReplyFormAsync` methods.
2244722474
*/
22448-
type: string;
22475+
type: MailboxEnums.AttachmentType;
2244922476
/**
2245022477
* A string that contains the name of the attachment, up to 255 characters in length.
2245122478
*/
2245222479
name: string;
2245322480
/**
22454-
* Only used if type is set to file. The URI of the location for the file.
22481+
* The URI of the location for the file. Only use if `type` is set to `file`.
2245522482
*
22456-
* **Important**: This link must be publicly accessible, without need for authentication by Exchange Online servers. However, with
22483+
* @remarks
22484+
*
22485+
* **Important**: This link must be publicly accessible without need for authentication by Exchange Online servers. However, with
2245722486
* on-premises Exchange, the link can be accessible on a private network as long as it doesn't need further authentication.
2245822487
*/
2245922488
url?: string;
2246022489
/**
22461-
* 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
22462-
* displayed in the attachment list.
22490+
* If true, indicates that the attachment will be shown inline in the message body and shouldn't be displayed in the attachment list.
22491+
* Only use if `type` is set to `file`.
2246322492
*/
2246422493
inLine?: boolean;
2246522494
/**
22466-
* Only used if type is set to item. The EWS item ID of the attachment. This is a string up to 100 characters.
22495+
* The EWS item ID of the attachment. This is a string up to 100 characters. Only use if `type` is set to `item`.
2246722496
*/
2246822497
itemId?: string;
22498+
/**
22499+
* The Base64-encoded string of the file to be attached. Only use if `type` is set to `base64`.
22500+
*
22501+
* @remarks
22502+
*
22503+
* [Api set: Mailbox 1.15]
22504+
*/
22505+
base64File?: string;
2246922506
}
2247022507
/**
2247122508
* A ReplyFormData object that contains body or attachment data and a callback function. Used when displaying a reply form.
@@ -22476,7 +22513,7 @@ declare namespace Office {
2247622513
*/
2247722514
htmlBody?: string;
2247822515
/**
22479-
* An array of {@link Office.ReplyFormAttachment | ReplyFormAttachment} that are either file or item attachments.
22516+
* An array of {@link Office.ReplyFormAttachment | ReplyFormAttachment} that are Base64-encoded files, Exchange items, or file attachments.
2248022517
*/
2248122518
attachments?: ReplyFormAttachment[];
2248222519
/**

types/office-js/index.d.ts

Lines changed: 57 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8822,27 +8822,40 @@ declare namespace Office {
88228822
*
88238823
* @remarks
88248824
*
8825+
* [Api set: Mailbox 1.1]
8826+
*
88258827
* **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read
88268828
*/
88278829
enum AttachmentType {
88288830
/**
8829-
* The attachment is a file.
8830-
*/
8831-
File = "file",
8832-
/**
8833-
* The attachment is an Exchange item.
8831+
* The attachment is a Base64-encoded file.
8832+
*
8833+
* **Important**: The `base64` attachment type is only supported by the `displayReplyAllForm`, `displayReplyAllFormAsync`, `displayReplyForm`, and
8834+
* `displayReplyFormAsync` methods.
8835+
*
8836+
* [Api set: Mailbox 1.15]
88348837
*/
8835-
Item = "item",
8838+
Base64 = "base64",
88368839
/**
88378840
* The attachment is stored in a cloud location, such as OneDrive.
88388841
*
88398842
* **Important**: In Read mode, the `id` property of the attachment's {@link Office.AttachmentDetails | details} object
88408843
* contains a URL to the file.
8841-
* From requirement set 1.8, the `url` property included in the attachment's
8842-
* {@link https://learn.microsoft.com/javascript/api/outlook/office.attachmentdetailscompose?view=outlook-js-1.8 | details} object
8844+
* From requirement set 1.8, the `url` property included in the attachment's {@link Office.AttachmentDetailsCompose | details} object
88438845
* contains a URL to the file in Compose mode.
8846+
*
8847+
* The `cloud` attachment type isn't supported by the `displayNewMessageForm`, `displayNewMessageFormAsync`, `displayReplyAllForm`, `displayReplyAllFormAsync`,
8848+
* `displayReplyForm`, and `displayReplyFormAsync` methods.
8849+
*/
8850+
Cloud = "cloud",
8851+
/**
8852+
* The attachment is a file.
88448853
*/
8845-
Cloud = "cloud"
8854+
File = "file",
8855+
/**
8856+
* The attachment is an Exchange item.
8857+
*/
8858+
Item = "item"
88468859
}
88478860
/**
88488861
* Specifies the category color.
@@ -15503,9 +15516,10 @@ declare namespace Office {
1550315516
*
1550415517
* `htmlBody`: The HTML body of the message. The body content is limited to a maximum size of 32 KB.
1550515518
*
15506-
* `attachments`: An array of JSON objects that are either file or item attachments.
15519+
* `attachments`: An array of JSON objects that are either file or Exchange item attachments.
1550715520
*
15508-
* `attachments.type`: Indicates the type of attachment. Must be `file` for a file attachment or `item` for an item attachment.
15521+
* `attachments.type`: Indicates the type of attachment. Must be `Office.MailboxEnums.AttachmentType.File` for a file attachment or
15522+
* `Office.MailboxEnums.AttachmentType.Item` for an Exchange item attachment.
1550915523
*
1551015524
* `attachments.name`: A string that contains the name of the attachment, up to 255 characters in length.
1551115525
*
@@ -15550,9 +15564,10 @@ declare namespace Office {
1555015564
*
1555115565
* `htmlBody`: The HTML body of the message. The body content is limited to a maximum size of 32 KB.
1555215566
*
15553-
* `attachments`: An array of JSON objects that are either file or item attachments.
15567+
* `attachments`: An array of JSON objects that are either file or Exchange item attachments.
1555415568
*
15555-
* `attachments.type`: Indicates the type of attachment. Must be `file` for a file attachment or `item` for an item attachment.
15569+
* `attachments.type`: Indicates the type of attachment. Must be `Office.MailboxEnums.AttachmentType.File` for a file attachment or
15570+
* `Office.MailboxEnums.AttachmentType.Item` for an Exchange item attachment.
1555615571
*
1555715572
* `attachments.name`: A string that contains the name of the attachment, up to 255 characters in length.
1555815573
*
@@ -15601,9 +15616,10 @@ declare namespace Office {
1560115616
*
1560215617
* `htmlBody`: The HTML body of the message. The body content is limited to a maximum size of 32 KB.
1560315618
*
15604-
* `attachments`: An array of JSON objects that are either file or item attachments.
15619+
* `attachments`: An array of JSON objects that are either file or Exchange item attachments.
1560515620
*
15606-
* `attachments.type`: Indicates the type of attachment. Must be `file` for a file attachment or `item` for an item attachment.
15621+
* `attachments.type`: Indicates the type of attachment. Must be `Office.MailboxEnums.AttachmentType.File` for a file attachment or
15622+
* `Office.MailboxEnums.AttachmentType.Item` for an Exchange item attachment.
1560715623
*
1560815624
* `attachments.name`: A string that contains the name of the attachment, up to 255 characters in length.
1560915625
*
@@ -20049,29 +20065,47 @@ declare namespace Office {
2004920065
*/
2005020066
interface ReplyFormAttachment {
2005120067
/**
20052-
* Indicates the type of attachment. Must be file for a file attachment or item for an item attachment.
20068+
* Indicates the type of attachment.
20069+
*
20070+
* @remarks
20071+
*
20072+
* **Important**:
20073+
*
20074+
* - The `base64` attachment type was introduced in Mailbox requirement set 1.15. It's only supported by the `displayReplyAllForm`, `displayReplyAllFormAsync`, `displayReplyForm`, and
20075+
* `displayReplyFormAsync` methods.
20076+
*
20077+
* - The `cloud` attachment type isn't supported by the `displayNewMessageForm`, `displayNewMessageFormAsync`, `displayReplyAllForm`, `displayReplyAllFormAsync`,
20078+
* `displayReplyForm`, and `displayReplyFormAsync` methods.
2005320079
*/
20054-
type: string;
20080+
type: MailboxEnums.AttachmentType;
2005520081
/**
2005620082
* A string that contains the name of the attachment, up to 255 characters in length.
2005720083
*/
2005820084
name: string;
2005920085
/**
20060-
* Only used if type is set to file. The URI of the location for the file.
20086+
* The URI of the location for the file. Only use if `type` is set to `file`.
2006120087
*
20062-
* **Important**: This link must be publicly accessible, without need for authentication by Exchange Online servers. However, with
20088+
* **Important**: This link must be publicly accessible without need for authentication by Exchange Online servers. However, with
2006320089
* on-premises Exchange, the link can be accessible on a private network as long as it doesn't need further authentication.
2006420090
*/
2006520091
url?: string;
2006620092
/**
20067-
* 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
20068-
* displayed in the attachment list.
20093+
* If true, indicates that the attachment will be shown inline in the message body and shouldn't be displayed in the attachment list.
20094+
* Only use if `type` is set to `file`.
2006920095
*/
2007020096
inLine?: boolean;
2007120097
/**
20072-
* Only used if type is set to item. The EWS item ID of the attachment. This is a string up to 100 characters.
20098+
* The EWS item ID of the attachment. This is a string up to 100 characters. Only use if `type` is set to `item`.
2007320099
*/
2007420100
itemId?: string;
20101+
/**
20102+
* The Base64-encoded string of the file to be attached. Only use if `type` is set to `base64`.
20103+
*
20104+
* @remarks
20105+
*
20106+
* [Api set: Mailbox 1.15]
20107+
*/
20108+
base64File?: string;
2007520109
}
2007620110
/**
2007720111
* A ReplyFormData object that contains body or attachment data and a callback function. Used when displaying a reply form.
@@ -20082,7 +20116,7 @@ declare namespace Office {
2008220116
*/
2008320117
htmlBody?: string;
2008420118
/**
20085-
* An array of {@link Office.ReplyFormAttachment | ReplyFormAttachment} that are either file or item attachments.
20119+
* An array of {@link Office.ReplyFormAttachment | ReplyFormAttachment} that are Base64-encoded files, Exchange items, or file attachments.
2008620120
*/
2008720121
attachments?: ReplyFormAttachment[];
2008820122
/**

0 commit comments

Comments
 (0)