import type { Email } from "../email.mjs"; import type { EmailQueue, WorkerOptions } from "./index.mjs"; /** A running worker. Call \`stop()\` to halt the loop; any in-flight sends * finish first. \`waitForIdle()\` resolves when the queue is empty and no * send is in flight. */ export interface QueueWorker { start: () => void; stop: () => Promise; waitForIdle: () => Promise; /** Run a single tick manually — useful in tests. */ tick: () => Promise; } /** Build a worker that drains \`queue\` by sending each item through * \`email\`. Keep the loop simple: pull → send → ack/fail. Advanced * drivers can skip this worker and drive \`email.send\` directly from * their own transport. */ export declare function startWorker(email: Email, queue: EmailQueue, options?: WorkerOptions): QueueWorker;