@robotlegsjs/core
Version:
An architecture-based IoC framework for JavaScript/TypeScript
47 lines (46 loc) • 1.1 kB
TypeScript
import { IEventDispatcher } from "../../../events/api/IEventDispatcher";
/**
* Relays events from a source to a destination
*/
export declare class EventRelay {
private _source;
private _destination;
private _types;
private _active;
/**
* Relays events from the source to the destination
*
* @param source Event Dispatcher
* @param destination Event Dispatcher
* @param types The list of event types to relay
*/
constructor(source: IEventDispatcher, destination: IEventDispatcher, types?: string[]);
/**
* Start relaying events
*
* @return Self
*/
start(): EventRelay;
/**
* Stop relaying events
*
* @return Self
*/
stop(): EventRelay;
/**
* Add a new event type to relay
*
* @param eventType
*/
addType(eventType: string): void;
/**
* Remove a relay event type
*
* @param eventType
*/
removeType(eventType: string): void;
private _addListener;
private _removeListener;
private _addListeners;
private _removeListeners;
}