import type { Address, AddressInput } from "./types.js"; /** * Assert that a raw address or display-name value contains no forbidden * control characters. Throws immediately (fail closed) — the library never * attempts to strip or rewrite hostile input into an accepted value. * * The check is intentionally performed on the RAW input, before any trimming * or normalization, so hostile values are rejected rather than repaired. * * @param value - The raw, untransformed string to validate. * @param label - Field label used in the error message (e.g. "address"). * @throws {Error} If the value contains any forbidden control character. */ export declare function assertSafeAddress(value: string, label?: string): void; /** * Normalize any AddressInput form into Address[]. * * Every address and display name is validated against control-character * injection before any transformation. This is the single chokepoint shared * by all transports and address fields (From, To, Cc, Bcc, Reply-To), so the * protection is uniform and secure by default. * * @throws {Error} If any address or name contains a forbidden control character. */ export declare function parseAddresses(input: AddressInput): Address[]; /** * Format an Address for SMTP envelope commands (MAIL FROM / RCPT TO). */ export declare function toEnvelope(address: Address): string; /** * Format an Address for use in a MIME header (From, To, CC, etc.). * * Re-validates the address and name at render time so a header can never be * emitted with an embedded control character, even if the {@link Address} was * constructed without going through {@link parseAddresses}. * * @throws {Error} If the address or name contains a forbidden control character. */ export declare function toMIMEHeader(address: Address): string; /** * Extract plain email strings from any AddressInput. */ export declare function extractEmails(input: AddressInput): string[]; /** * Basic email format validation (format only, no DNS lookup). * * Rejects any control character (including CR, LF, tab, and NUL) before * applying the structural check, so a "valid" result is always safe to place * into a header or SMTP command. */ export declare function isValidEmail(email: string): boolean;