/**
 * Group expansion — turns a recipient string with group names into a flat
 * deduplicated address list. Shared between desktop (mailx-service) and
 * Android (mailx-store-web) so send paths produce the same result.
 *
 * Group source: contacts.jsonc → groups: Record<string, string[]>. Each
 * value is an array of either email addresses ("a@b" or "Name <a@b>") or
 * names of other groups (recursive aliasing). Cycles are detected; depth
 * is capped at 10 nested levels.
 */
/** Raw recipient string from a To/Cc/Bcc field; may contain group names. */
export type RecipientToken = string;
/** Map of group name → member list (each entry: address or another group name). */
export type GroupMap = Record<string, string[]>;
/** Result of expanding a recipient string. */
export interface ExpansionResult {
    /** Flat unique address list (preserving order of first occurrence). */
    addresses: string[];
    /** Group names that couldn't be resolved (typo / cycle) — surface in UI. */
    unresolved: string[];
}
/** Split a comma-or-semicolon recipient string into tokens. Respects
 *  angle-bracket address blocks ("Name, Suffix <a@b>") so a comma inside
 *  the display name doesn't split the entry. */
export declare function splitRecipients(raw: string): RecipientToken[];
/** Quick test: does the token look like an email address (with or without
 *  a display name)? Anything containing "@" with non-whitespace on both
 *  sides counts. */
export declare function isAddressToken(token: string): boolean;
/** Extract the bare email address from a token. Returns the original token
 *  lowercased if it has no angle-bracket form. */
export declare function extractAddress(token: string): string;
/** Expand a recipient string by resolving group names against `groups`.
 *  Group names take precedence: if a token matches a group name AND looks
 *  like an address, it's treated as a group. (In practice no one names a
 *  group "x@y.com", so this is rarely a real conflict.) */
export declare function expandRecipients(raw: string, groups: GroupMap): ExpansionResult;
//# sourceMappingURL=groups.d.ts.map