import type { ConnectionOptions, SmtpConnection } from "./connection.mjs"; /** Options for the pool layer. A subset of `SmtpDriverOptions`. */ export interface PoolOptions { enabled: boolean; maxConnections: number; maxMessagesPerConnection: number; idleTimeoutMs: number; disposeGraceMs: number; connection: ConnectionOptions; } /** A FIFO connection pool with graceful dispose. Fixes the v0 leak: both * idle AND in-flight connections are tracked, so `dispose()` can wait on * in-flight sends and then quit everything. */ export interface ConnectionPool { acquire: () => Promise; release: (conn: SmtpConnection, failed?: boolean) => Promise; dispose: () => Promise; size: () => { idle: number; inFlight: number; waiters: number; }; } export declare function createPool(options: PoolOptions): ConnectionPool;