/** * Isomorphic helper functions for email parsing, validation, and MIME string formatting. */ import { Ib } from '@ibgib/ts-gib/dist/types.mjs'; import { EmailAddress, EmailData_V1, EmailIb_V1, OutboundEmail } from './email-types.mjs'; /** * Validates whether an email string matches standard email formatting. */ export declare function validateEmail(email: string): boolean; /** Alias for validateEmail for email address format checking. */ export declare function validateEmailAddress(email: string): boolean; /** * Sanitizes header values by stripping carriage return (\r) and newline (\n) characters * to prevent MIME header injection. */ export declare function sanitizeHeaderValue(val: string): string; /** * Parses a string or EmailAddress object into a normalized EmailAddress object. * Examples: * - "Alice " -> { name: "Alice", address: "alice@example.com" } * - "alice@example.com" -> { address: "alice@example.com" } */ export declare function parseEmailAddress(addr: EmailAddress | string): EmailAddress; /** * Formats an EmailAddress or string into RFC 2822 format (e.g. `"Alice" `). */ export declare function formatEmailAddress(addr: EmailAddress | string): string; /** * Parses raw MIME headers string or header record into a key-value record with normalized header names. */ export declare function parseRawMimeHeaders(raw: string | Record): Record; /** * Formats an OutboundEmail object into a raw MIME string (RFC 2822). */ export declare function formatRawMimeString(email: OutboundEmail, charset?: string): string; /** * Decodes a quoted-printable encoded string. */ export declare function decodeQuotedPrintable(str: string): string; /** * Constructs the standard 'ib' string for an Email stone. * Format: `email ` * * Subject and body content are deliberately excluded to ensure the `ib` remains * a compact, space-delimited metadata locator. MessageId is sanitized via getSaferSubstring. */ export declare function getEmailIb({ data, timestampInTicks, messageId, }: { data?: Partial; timestampInTicks?: string | number; messageId?: string; }): Promise; /** * Parses a standard Email 'ib' string into its constituent parts. * Expected format: `email ` */ export declare function parseEmailIb({ ib, }: { ib: Ib; }): Promise; //# sourceMappingURL=email-helpers.d.mts.map