import { Observer } from 'rxjs'; import { Type } from '../di'; export interface BusEventOptions { } /** * An event that can be dispatched from the event bus. * @export * @class BusEvent * @template T The target type. */ export declare class BusEvent { protected _target: T; protected _options: BusEventOptions; protected _parent: BusEvent | null; private _promise; private _isPropagationStopped; /** * Creates an instance of BusEvent. * @param {T} _target * @param {BusEventOptions} [_options={}] * @param {(BusEvent|null)} [_parent=null] */ constructor(_target: T, _options?: BusEventOptions, _parent?: BusEvent | null); /** * The target of the event. * @readonly * @type {T} */ readonly target: T; /** * The origin event. * @readonly * @type {*} */ readonly origin: any; /** * Whether the propagation of this event is stopped. * @readonly * @type {boolean} */ readonly isPropagationStopped: boolean; /** * The options provided to this event. * @readonly * @type {BusEventOptions} */ readonly options: BusEventOptions; /** * A Promise that resolves when the event is 'done'. * @readonly * @type {Promise} */ readonly done: Promise>; /** * Adds a function that will execute and hold up the finishing of this event * until the given promise resolves. These are executed in the order the are received. * @param {function(): *} fn * @returns {void} */ wait(fn: () => any): void; /** * Creates a new event with a new target and setting this event as the _parent * of the new event. This will merge options with the previou event. * @template U * @param {Type} Ctor * @param {*} [target=this.target] * @param {BusEventOptions} [options={}] * @returns {U} */ delegate>(Ctor: Type, target?: any, options?: BusEventOptions): U; /** * Stops the propagation of the event. */ stopPropagation(): void; /** * Implements how this event is dispatched on the given event bus. * @param {Observer} subscriber */ dispatch(subscriber: Observer): void; }