1 |
|
2 |
|
3 | interface Emitter<Event = string> {
|
4 | on(event: Event, listener: Function): Emitter;
|
5 | once(event: Event, listener: Function): Emitter;
|
6 | off(event?: Event, listener?: Function): Emitter;
|
7 | emit(event: Event, ...args: any[]): Emitter;
|
8 | listeners(event: Event): Function[];
|
9 | hasListeners(event: Event): boolean;
|
10 | removeListener(event?: Event, listener?: Function): Emitter;
|
11 | removeEventListener(event?: Event, listener?: Function): Emitter;
|
12 | removeAllListeners(event?: Event): Emitter;
|
13 | }
|
14 |
|
15 | declare const Emitter: {
|
16 | (obj?: object): Emitter;
|
17 | new(obj?: object): Emitter;
|
18 | };
|
19 |
|
20 | export = Emitter;
|