forked from mozilla-comm/jsmime
-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.d.ts
33 lines (29 loc) · 869 Bytes
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
export type Headers = { [key: string]: string[] };
interface Attachment {
content: Uint8Array;
headers: Headers;
size: number;
fileName?: string;
contentType?: string;
contentDisposition?: string;
contentId?: string;
}
type Address = { name: string, email: string };
type Group = { name: string, group: Address[] };
type AddressOrGroup = Address | Group;
export interface ParsedMessage {
attachments: Attachment[];
headers: Headers;
body: {
html: string | null; // 'text/html' body parts, joined together separated by <br>\n
text: string | null; // 'text/plain' body parts, joined together separated by \n
},
date?: Date;
subject?: string,
from?: Address,
to?: AddressOrGroup[],
cc?: AddressOrGroup[],
bcc?: AddressOrGroup[],
'reply-to'?: Address
}
export function parseMail(message: string | Uint8Array): ParsedMessage;