first version

This commit is contained in:
2025-09-17 16:43:44 -05:00
parent 810fad4beb
commit 6d12e7e151
28 changed files with 939 additions and 153 deletions

46
types.d.ts vendored Normal file
View File

@@ -0,0 +1,46 @@
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;
}
}