@ima/core
Version: 
IMA.js framework for isomorphic javascript application
56 lines • 1.74 kB
TypeScript
import { EventBus, EventBusListener, EventBusOptions } from './EventBus';
import { Window } from '../window/Window';
/**
 * Global name of IMA.js custom event.
 */
export declare const IMA_EVENT = "$IMA.CustomEvent";
/**
 * Helper for custom events.
 *
 * It offers public methods for firing custom events and two methods for
 * catching events (e.g. inside view components).
 */
export declare class EventBusImpl extends EventBus {
    private _window;
    /**
     * Map of listeners provided to the public API of this event bus to a
     * map of event targets to a map of event names to actual listeners
     * bound to the native API.
     *
     * The "listen all" event listeners are not registered in this map.
     */
    private _listeners;
    /**
     * Map of event targets to listeners executed on all IMA.js event bus
     * events.
     */
    private _allListenersTargets;
    static get $dependencies(): (typeof Window)[];
    /**
     * Initializes the custom event helper.
     *
     * @param window The IMA window helper.
     */
    constructor(window: Window);
    /**
     * @inheritDoc
     */
    fire(eventTarget: EventTarget, eventName: string, data: any, options?: EventBusOptions): this;
    /**
     * @inheritDoc
     */
    listenAll(eventTarget: EventTarget, listener: EventBusListener): this;
    /**
     * @inheritDoc
     */
    listen(eventTarget: EventTarget, eventName: string, listener: EventBusListener): this;
    /**
     * @inheritDoc
     */
    unlistenAll(eventTarget: EventTarget, listener: EventBusListener): this;
    /**
     * @inheritDoc
     */
    unlisten(eventTarget: EventTarget, eventName: string, listener: EventBusListener): this;
}
//# sourceMappingURL=EventBusImpl.d.ts.map