import type { SocketAdapter, TLSOptions } from "../core/types.js"; /** Configuration options for {@link BunAdapter}. */ export interface BunAdapterOptions { /** Use implicit TLS on connect (port 465). Default: false. */ secure?: boolean; /** Socket connect timeout in milliseconds. Default: 30_000. */ connectionTimeout?: number; /** TLS options passed to node:tls (Bun Node compat layer). */ tls?: TLSOptions; } /** * Bun socket adapter using node:net and node:tls (Node compat layer). */ export declare class BunAdapter implements SocketAdapter { /** Underlying TCP or TLS socket (Node compat layer). */ private socket; /** Whether the connection is currently encrypted. */ private _secure; /** Whether the socket is connected. */ private _connected; /** Socket connect timeout in milliseconds. */ private readonly connectionTimeout; /** TLS options for direct TLS and STARTTLS upgrades. */ private readonly tlsOptions; /** Creates a Bun socket adapter (requires the Bun runtime). */ constructor(options?: BunAdapterOptions); /** Whether the connection uses TLS. */ get secure(): boolean; /** Whether the socket is currently connected. */ get connected(): boolean; /** Opens a TCP or TLS connection to the given host and port. */ connect(host: string, port: number): Promise; /** Upgrades a plain connection to TLS via STARTTLS. */ startTLS(options?: TLSOptions): Promise; /** Writes raw bytes to the socket. */ write(data: Uint8Array): Promise; /** Reads incoming socket data as an async iterable of byte chunks. */ read(): AsyncGenerator; /** Closes the socket connection. */ close(): Promise; /** Opens a plain TCP connection to the SMTP server. */ private connectPlain; /** Opens a direct TLS connection to the SMTP server. */ private connectTls; }