import { Disposable } from "../disposable"; import { Logger } from "../logging/logger"; import { Context } from "../services/context"; import { AbstractType, Type } from "../type"; /** * Singleton application service handling in-process event publishing/subscribing. * * @export * @class EventHub */ export declare class EventHub { private _subscriptions; private _logger; /** * Creates an instance of EventHub. * * @param {Logger} logger The logger. * @memberof EventHub */ constructor(logger?: Logger); /** * Gets the logger. * * @readonly * @protected * @type {Logger} * @memberof EventHub */ protected get logger(): Logger; /** * Publishes the event asynchronously to its subscribers. * * @param {*} event The event. * @param {Context} [context] Optional. The context. * @returns {Promise} The promise. * @memberof EventHub */ publishAsync(event: any, context?: Context): Promise; /** * Subscribes to the event(s) matching the criteria. * * @template T The event type. * @param {(AbstractType | Type)} match Specifies the match type. * @param {((event: T, context?: Context) => Promise | void)} callback The callback. * @returns {Disposable} A disposable event subscription. * @memberof EventHub */ subscribe(match: AbstractType | Type, callback: (event: T, context?: Context) => Promise | void): Disposable; private _getMatch; }