export type ImapValue = string | ImapValue[]; /** * Parses a parenthesized IMAP list (quoted strings, atoms, nested parens) * into nested arrays. * * Example: `(("" "/") ("Archive" "/"))` → [["", "/"], ["Archive", "/"]] */ export declare function parseImapList(text: string): ImapValue[]; /** * Quotes a string as an IMAP quoted string, escaping backslashes and quotes. */ export declare function quote(value: string): string; /** * Returns the value as-is if it is a safe IMAP atom, otherwise quoted. */ export declare function quoteIfNeeded(value: string): string; /** Formats a Date as an IMAP search date: dd-Mmm-yyyy */ export declare function formatImapDate(value: Date): string; /** Formats a Date as an IMAP internal date: dd-Mmm-yyyy HH:mm:ss +ZZZZ */ export declare function formatInternalDate(value: Date): string; /** * Parses an IMAP date-time string (RFC 9051 §9: dd-MMM-yyyy HH:mm:ss +ZZZZ, * e.g. "17-Jul-1996 02:44:25 -0700") into a Date deterministically. * Returns an invalid Date when the input cannot be parsed. */ export declare function parseInternalDate(value: string): Date; /** * Encodes a string as modified UTF-7 (RFC 2152), the mailbox name encoding * used by IMAP4rev1. Printable ASCII (except "&") is passed through; other * characters are base64-encoded UTF-16BE between "&" and "-". */ export declare function encodeMutf7(input: string): string; /** Decodes a modified UTF-7 (RFC 2152) string back into Unicode. */ export declare function decodeMutf7(input: string): string; /** * Splits the content of a [...] response code section into top-level * tokens, keeping parenthesized groups (e.g. PERMANENTFLAGS (\Seen \Deleted)) * together. */ export declare function splitResponseCodes(bracketContent: string): string[];