UNPKG

712 BTypeScriptView Raw
1import EventInterface from './EventInterface';
2declare class Event<EventPayload> implements EventInterface<EventPayload> {
3 constructor();
4 addHandler<T>(handler: EventInterface.HandlerInterface<EventPayload, T>, context?: T): Event<EventPayload>;
5 removeHandler<T>(handler: EventInterface.HandlerInterface<EventPayload, T>, context?: T): Event<EventPayload>;
6 isHandlerAttached<T>(handler: EventInterface.HandlerInterface<EventPayload, T>, context?: T): boolean;
7 dispatch: (payload: EventPayload) => void;
8 hasHandlers: boolean;
9 private _updateHasHandlers;
10 private _getHandlerIndex;
11 private _createDispatcher;
12 private _handlers;
13 private _contexts;
14}
15export default Event;