import { MessageBusHandle, IMessageBusCallback } from './message-bus-handle'; export interface IMessageBusService { id: string; publish(topic: string, title: string, data?: any): void; subscribe(topic: string, callback: IMessageBusCallback): MessageBusHandle; unsubscribe(handle: MessageBusHandle): any; } /** * Simple message bus service, used for subscribing and unsubsubscribing to topics. * @see {@link https://gist.github.com/floatingmonkey/3384419} */ export declare class MessageBusService implements IMessageBusService { private cache; private confirms; id: string; constructor(); /** * Publish to a topic */ publish(topic: string, title: string, data?: any): void; /** * Subscribe to a topic * @param {string} topic The desired topic of the message. * @param {IMessageBusCallback} callback The callback to call. */ subscribe(topic: string, callback: IMessageBusCallback): MessageBusHandle; /** * Unsubscribe to a topic by providing its handle */ unsubscribe(handle: MessageBusHandle): void; }