import { EventEmitter } from 'events'; import type { ILogObj } from 'tslog'; import { Logger } from 'tslog'; import type { IConnectionManager } from './i-connection-manager.js'; /** * Abstract base class for managing a message transport connection. * * Implementations are responsible for establishing, maintaining, and closing * connections to a specific transport backend (e.g. RabbitMQ, Kafka). * * Emits: * - `connected` when a connection is established (with the connection object as argument) * - `disconnected` when the connection is lost * - `error` on connection errors * * @template TConnection The transport-specific connection type returned by {@link connect}. */ export declare abstract class AbstractConnectionManager extends EventEmitter implements IConnectionManager { protected _logger: Logger; state: string; constructor(logger?: Logger); /** * Establishes a connection to the transport backend. * Implementations should handle in-progress connection attempts and * return the existing connection if already connected. */ abstract connect(): Promise; /** * Gracefully closes the connection. */ abstract close(): Promise; /** * Returns true if there is an active connection. */ abstract isConnected(): boolean; }