export type Subscription = (value: T) => void; export type Unsubscribe = () => void; type Observer = (subscriber: Subscriber) => Unsubscribe; export type Observable = { subscribe(handler: Subscription): Unsubscribe; toRxObserver(): (subscriber: Subscriber) => Unsubscribe; }; type Subscriber = { next(value?: T): void; error?(error: any): void; complete?(): void; }; /** * * * @export * @class EventBus * @implements {Observable} * @template T */ export declare class EventBus implements Observable { private readonly _subscriptions; private readonly _onComplete; private _completed; /** * * * @param {T} value * @returns {this} * @memberof EventBus */ emit(value: T): this; /** * * * @param {Subscription} handler * @returns {Unsubscribe} {Unsubscribe} * @memberof EventBus */ subscribe(handler: Subscription): Unsubscribe; /** * * * @memberof EventBus * @returns {void} */ complete(): void; /** * * * @returns {Observer} * @example * import { Observable } from "rxjs"; * * const bus = new EventBus(); * const observable = new Observable(bus.toRxObserver()); * // Observable */ toRxObserver(): Observer; } export {};