EventInterface.d.ts 460 B

12345678910
  1. interface EventInterface<EventPayload> {
  2. addHandler<T>(handler: EventInterface.HandlerInterface<EventPayload, T>, context?: T): EventInterface<EventPayload>;
  3. removeHandler<T>(handler: EventInterface.HandlerInterface<EventPayload, T>, context?: T): EventInterface<EventPayload>;
  4. }
  5. declare module EventInterface {
  6. interface HandlerInterface<EventPayload, T> {
  7. (payload: EventPayload, context: T): void;
  8. }
  9. }
  10. export default EventInterface;