import type { Handler, Topic, SubscriberToken, IPubSub } from '../../../types'; declare class StreamPubSub implements IPubSub { private recieiveQueue; private sendQueue; private _channel; private _channelSubscribed; private _topicHandlersMap; private _subscriberTokenMap; constructor(recieiveQueue?: any, sendQueue?: any); private _getChannel; private _getHandlers; private _subscribeChannel; /** * Publishes a topic asynchronously, passing the data to its subscribers. * Asynchronous publication helps in that the originator of the topics will not be blocked while consumers process them. * @param topic The topic's name * @param payload The data to be passed to its subscribers */ publish(topic: string, payload: string): void; /** * Subscribe to events of interest with a specific topic name and a callback function, to be executed when the topic/event is observed. * @param topic The topic's name. * @param handler Callback function to execute on topic message, taking one argument: {string} payload. The payload passed when publishing a message to channel. * @return The subscriber's token */ subscribe(topic: string, handler: Handler): SubscriberToken; /** * Checks if there are subscribers for a specific topic. If topic is not provided, checks if there is at least one subscriber. * @return true if the topic exist and has subscribers, otherwise false. */ hasSubscribers(topic?: Topic): boolean; /** * @returns true if the topic exist and has been removed, or false if the topic does not exist. */ unSubsribeByTopic(topic: Topic): boolean; /** * @returns true if the subscriber token exist and has been removed, or false the subscriber token does not exist. */ unSubsribeByToken(token: SubscriberToken): boolean; /** * @returns true if the subscriber handler exist and has been removed, or false the subscriber handler does not exist. */ unSubsribeByHandler(handler: Handler): boolean; clearAllSubscriptions(): void; } export declare const PubSub: StreamPubSub; export {};