import type { Middleware } from "../types.mjs"; /** Structured log entry emitted by `withLogger`. Consumers can pipe this * into Pino, Winston, Logflare, Axiom, or \`console\`. */ export interface LogEntry { event: "send.start" | "send.success" | "send.error"; at: string; driver: string; stream?: string; attempt: number; messageId?: string; durationMs?: number; recipient?: string; subject?: string; error?: { code: string; message: string; status?: number; retryable: boolean; }; /** User-extensible metadata forwarded from \`ctx.meta\`. */ meta?: Record; } export interface LoggerOptions { /** Sink for log entries. Default: \`console.info\` for start/success, * \`console.error\` for errors. */ sink?: (entry: LogEntry) => void; /** Include the first 120 chars of the subject in logs. Default: true. */ includeSubject?: boolean; /** Include the first recipient's email address. Default: true. */ includeRecipient?: boolean; /** Redact the local-part of emails (ada@acme.com → a***@acme.com). * Default: false. */ redactLocalPart?: boolean; } /** Middleware that emits structured log entries around every send. Zero * runtime dependencies — use \`sink\` to plug in any logger. */ export declare function withLogger(options?: LoggerOptions): Middleware;