import { MqttConfig } from "./mqtt"; import { MqttCallbacks } from "./mqtt"; import { MqttClient } from "./mqtt"; /** * MQTT连接池 * 用于管理MQTT连接 * 单例模式 */ export declare class MqttConnectionPool { private static instance; private connections; private connectionConfigs; private constructor(); static getInstance(): MqttConnectionPool; /** * 生成连接的唯一标识 */ private generateConnectionKey; /** * 获取或创建连接 */ getOrCreateConnection(config: MqttConfig, callbacks?: MqttCallbacks): Promise; /** * 检查连接是否存在 */ hasConnection(config: MqttConfig): boolean; /** * 获取所有连接 */ getAllConnections(): Map; /** * 关闭指定连接 */ closeConnection(config: MqttConfig): boolean; /** * 关闭所有连接 */ closeAllConnections(): boolean; } /** * 连接池管理函数 */ export declare const MqttConnectionPoolManager: { /** * 获取连接池实例 */ getInstance: () => MqttConnectionPool; /** * 检查是否存在指定配置的连接 */ hasConnection: (config: MqttConfig) => boolean; /** * 关闭指定配置的连接 */ closeConnection: (config: MqttConfig) => boolean; /** * 关闭所有连接 */ closeAllConnections: () => void; /** * 关闭并移除key中uuid为uuid的连接 * @param uuid 连接的唯一标识 */ removeConnectionByUUID: (uuid: string) => void; };