interface Mailbox { address: string | null; name: string | null; } /************************************************************************** * PARSER ***************************************************************************/ /** * Parser */ declare class Parser { private regexes; /** * Constructor */ constructor(); /** * Parses the subject part of the email */ parseSubject(subject: string): string; /** * Parses the body part of the email */ parseBody(body: string, forwarded?: boolean): { body: string; message: string; email: string; } | { body?: undefined; message?: undefined; email?: undefined; }; /** * Parses the original forwarded email */ parseOriginalEmail(text: string, body: string): { body: string; from: Mailbox; to: Mailbox | Mailbox[]; cc: Mailbox | Mailbox[]; subject: string; date: string; }; /** * Initializes regexes */ private initRegexes; /** * Builds 'line' alternative regex */ private buildLineRegex; /** * Parses the body part */ private parseOriginalBody; /** * Parses the author (From) */ private parseOriginalFrom; /** * Parses the primary recipient(s) (To) */ private parseOriginalTo; /** * Parses the carbon-copy recipient(s) (Cc) */ private parseOriginalCc; /** * Parses mailboxes(s) */ private parseMailbox; /** * Parses the subject part */ private parseOriginalSubject; /** * Parses the date part */ private parseOriginalDate; /** * Prepares mailbox */ private prepareMailbox; } export default Parser;