import type { MailOptions, SendResult, SMTPConfig } from "../core/types.js"; /** A single pooled SMTP connection with a persistent session. */ export interface PooledConnection { /** Send one message over this connection. */ send(options: MailOptions): Promise; /** Whether this connection is idle and available for work. */ readonly idle: boolean; /** Number of messages sent on this connection. */ readonly messageCount: number; /** Whether this connection can accept more messages before recycle. */ readonly usable: boolean; /** Close the connection and end the SMTP session. */ close(): Promise; } /** Options for creating a pooled connection. */ export interface PooledConnectionOptions { /** SMTP configuration for the pooled session. */ config: SMTPConfig; /** Maximum messages before this connection is recycled. */ maxMessages: number; /** Hostname to connect to (may differ from config.host for direct MX). */ connectHost: string; /** Factory that creates the socket adapter for this connection. */ createAdapter: () => Promise; } /** * Create a pooled SMTP connection with an open authenticated session. */ export declare function createPooledConnection(options: PooledConnectionOptions): Promise;