first version
This commit is contained in:
46
types.d.ts
vendored
Normal file
46
types.d.ts
vendored
Normal 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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user