import { Topic, TopicSettings } from "../../models"; /** * A message bus where messages can be published and subscribed to based on a path * @class MessageBus */ export declare class MessageBus { private static _subscribers; private static _subscriptionConfigs; /** * Publishes a message on the topic */ static publish(topic: Topic, obj: T): void; /** * Clears the message cache for the topic */ static clearCache(topic: Topic): number; /** * Subscribes to the specified Topic and triggers function when a message is published */ static subscribe(topic: Topic, fn: (obj: T) => void): void; /** * Unsubscribes from the specified Topic */ static unsubscribe(topic: Topic, fn: (obj: T) => void): void; /** * Creates a topic that messages can be published to, if topic already exists it will throw exception */ static createTopic(topic: Topic, settings?: TopicSettings): void; /** * Creates a topic if it dosent exists, if it already exists it will ignore and continue without exception * @param topic * @param settings * @returns true/false created */ static ensureTopic(topic: Topic, settings?: TopicSettings): boolean; /** * Returns true if the topic exists already */ static topicExists(topic: Topic): boolean; /** * Builds the full path */ private static buildTopicPath; /** * Ensures the subscribers array on the path */ private static ensureSubscribers; }