import type { SocketAdapter, TLSOptions } from "../core/types.js"; /** Configuration options for {@link NodeAdapter}. */ export interface NodeAdapterOptions { /** 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. */ tls?: TLSOptions; } /** * Node.js socket adapter using node:net and node:tls. */ export declare class NodeAdapter implements SocketAdapter { /** Underlying Node.js TCP or TLS socket. */ 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 Node.js socket adapter. */ constructor(options?: NodeAdapterOptions); /** 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; }