46 lines
1.0 KiB
TypeScript
46 lines
1.0 KiB
TypeScript
declare module 'mailparser' {
|
|
export function simpleParser(source: Buffer | string | Readable, options?: any): Promise<ParsedMail>;
|
|
|
|
export interface ParsedMail {
|
|
headers: Map<string, any>;
|
|
subject?: string;
|
|
from?: AddressObject;
|
|
to?: AddressObject | AddressObject[];
|
|
cc?: AddressObject | AddressObject[];
|
|
bcc?: AddressObject | AddressObject[];
|
|
date?: Date;
|
|
messageId?: string;
|
|
inReplyTo?: string;
|
|
replyTo?: AddressObject;
|
|
references?: string | string[];
|
|
html?: string | false;
|
|
text?: string;
|
|
textAsHtml?: string;
|
|
attachments: Attachment[];
|
|
}
|
|
|
|
export interface AddressObject {
|
|
value: Mailbox[];
|
|
html: string;
|
|
text: string;
|
|
}
|
|
|
|
export interface Mailbox {
|
|
name: string;
|
|
address: string;
|
|
}
|
|
|
|
export interface Attachment {
|
|
type: string;
|
|
contentType: string;
|
|
partId: string;
|
|
filename?: string;
|
|
contentDisposition?: string;
|
|
checksum: string;
|
|
size: number;
|
|
headers: Map<string, any>;
|
|
content: Buffer;
|
|
cid?: string;
|
|
related?: boolean;
|
|
}
|
|
} |