import type { EmailRecord, Emitter } from './types.js'; /** * Listens to AdonisJS mail events and stores captured emails in a ring buffer. */ export declare class EmailCollector { #private; private buffer; private emitter; private handlers; constructor(maxEmails?: number); start(emitter: Emitter): Promise; stop(): void; getEmails(): EmailRecord[]; getLatest(n?: number): EmailRecord[]; getEmailHtml(id: number): string | null; getTotalCount(): number; getBufferInfo(): { current: number; max: number; }; clear(): void; /** * Push an externally-created email record into the buffer. * * Used by the Redis email bridge to ingest emails captured in * other processes (e.g., queue workers). The caller provides all * fields except `id`, which is assigned from the ring buffer's * auto-increment counter. */ ingest(partial: Omit): void; /** Register a callback that fires whenever a new email is recorded. */ onNewItem(cb: ((item: EmailRecord) => void) | null): void; /** Restore persisted records into the buffer and reset the ID counter. */ loadRecords(records: EmailRecord[]): void; }