/** Authentication helpers — each returns a function the connection calls * with `send(command)` and `recv()` and returns on success or throws on * an auth failure reply. Keeping them pure lets unit tests drive them * with fake send/recv. */ import type { SmtpReply } from "./reply.mjs"; export type { SmtpReply } from "./reply.mjs"; export type AuthMethod = "LOGIN" | "PLAIN" | "CRAM-MD5" | "XOAUTH2"; export interface AuthContext { send: (line: string) => Promise; recv: () => Promise; } /** Pick the best advertised method given caller preference + capabilities. * Order reflects practical recommendations (Brevo/SendGrid/Mailgun docs): */ export declare function pickAuthMethod(advertised: ReadonlySet, prefer?: AuthMethod | "AUTO"): AuthMethod | null; export declare function authPlain(ctx: AuthContext, user: string, password: string): Promise; export declare function authLogin(ctx: AuthContext, user: string, password: string): Promise; export declare function authCramMd5(ctx: AuthContext, user: string, password: string, hmac: (key: string, data: string) => string): Promise; export declare function authXoauth2(ctx: AuthContext, user: string, accessToken: string): Promise;