@omnia/fx
Version:
Provide Omnia Fx typings and tooling for clientside Omnia development.
31 lines (30 loc) • 1.52 kB
TypeScript
import { Topic, TopicSettings, IMessageBusSubscriptionHandler, IMessageBusTopicSubscription, IMessageBusTopicPublishSubscriber, IMessageBusTopicPublication, TopicCreatedFunc } from "../../models";
export declare class SubscriptionHandler implements IMessageBusSubscriptionHandler {
private unSubcribeHandlers;
constructor();
/**
* Unsubscribe to the related subscription(s)
* and/or any subscriptions added using add method)
* */
unsubscribe: () => void;
/**
* Adds another unsubscribe handler, all will be unsubscribed to if calling unsubscribe
* @param unSubscriptionHandler
*/
add: (unSubscriptionHandler: IMessageBusSubscriptionHandler) => void;
}
export declare class MessageBusExposeOnlySubscription<T> implements IMessageBusTopicSubscription<T> {
subscribe: (fn: (obj: T) => void) => IMessageBusSubscriptionHandler;
constructor(publishSubscriber: IMessageBusTopicPublishSubscriber<T>);
}
export declare class MessageBusExposeOnlyPublication<T> implements IMessageBusTopicPublication<T> {
publish: (msg: T) => void;
constructor(publishSubscriber: IMessageBusTopicPublishSubscriber<T>);
}
export declare class MessageBusTopicMediator<T> implements IMessageBusTopicPublishSubscriber<T> {
private _topic;
constructor(topic: Topic<T>, settings?: TopicSettings, onTopicCreated?: TopicCreatedFunc<T>);
publish: (msg: T) => void;
subscribe: (fn: (obj: T) => void) => IMessageBusSubscriptionHandler;
clearMessageCache: () => number;
}