import { Logger } from 'pino'; import type { ITransport, TTransportType } from '../types/public.js'; import { TrafficSniffer } from './trackers/traffic-sniffer.js'; import { TransportFactoryBase, TransportOptionsMap } from './factories/factories.js'; /** * Main factory class for Modbus transports. * Uses a static registry to manage and instantiate different transport types. */ export declare class TransportFactory { private static registry; /** * Registers a new factory for a specific transport type. * @param {TransportFactoryBase} factory - The factory to register. */ static register(factory: TransportFactoryBase): void; /** * Retrieves a registered factory for a specific transport type. * @template T The transport type. * @param {T} type - The transport type identifier. * @returns {TransportFactoryBase} The factory instance. * @throws {Error} If the transport type is not registered. */ static getFactory(type: T): TransportFactoryBase; /** * Creates a transport instance based on the provided type and options. * * @template T The transport type. * @param {T} type - The type of transport to create. * @param {TransportOptionsMap[T]} options - Configuration options for the transport. * @param {Logger} logger - Logger instance to pass to the transport. * @param {TrafficSniffer | null} [sniffer] - Optional sniffer for traffic monitoring. * @returns {Promise} A promise resolving to the created transport. */ static create(type: T, options: TransportOptionsMap[T], logger: Logger, sniffer?: TrafficSniffer | null): Promise; /** * Returns a list of all registered transport types. * @returns {TTransportType[]} Array of transport type keys. */ static getRegisteredTypes(): TTransportType[]; }