declare module 'mailparser' { export function simpleParser(source: Buffer | string | Readable, options?: any): Promise; export interface ParsedMail { headers: Map; 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; content: Buffer; cid?: string; related?: boolean; } }