/** * Represents the result of processing an outbound topic name, * containing either the original topic name, a topic alias integer, or both. */ export interface OutboundTopicAlias { /** * The topic name. * Will be empty (`""`) when a valid alias mapping has already been established. */ topicName: string; /** * The numeric alias assigned to the topic, if aliases are enabled. */ topicAlias?: number; } /** * Manages outbound MQTT topic aliases using a Least Recently Used (LRU) caching strategy. */ export declare class OutboundTopicAliasManager { /** * The maximum number of topic aliases supported by the broker/client. */ private readonly maxAliases; /** * Internal mapping from topic names to assigned aliases. * Leverages JavaScript's Map insertion-order behavior to act as an LRU cache. */ private readonly topicToAlias; /** * Creates an instance of `OutboundTopicAliasManager`. * * @param clientTopicAliasMaximum - The maximum number of topic aliases allowed (defaults to `0`, meaning disabled). */ constructor(clientTopicAliasMaximum?: number); /** * Processes an outbound topic name and returns the appropriate payload metadata * (`OutboundTopcAlias`) based on alias availability and caching state. * * - If aliases are disabled (`maxAliases === 0`), returns only the original `topicName`. * - If the topic is already cached (cache hit), refreshes its LRU position and returns the `topicAlias` with an empty `topicName`. * - If the topic is not cached (cache miss), assigns a new alias or evicts the least recently used topic alias mapping. * * @param topic - The outbound MQTT topic name to process. * @returns An object containing the formatted `topicName` and optional `topicAlias`. */ processTopic(topic: string): OutboundTopicAlias; /** * Clears all internal topic alias mappings and releases cached resources. */ destroy(): void; } //# sourceMappingURL=outboundTopicAliasManager.d.ts.map