Last change
on this file since 6a3a178 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
703 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | // Type definitions for component-emitter v1.2.1
|
---|
| 2 | // Project: https://www.npmjs.com/package/component-emitter
|
---|
| 3 | // Definitions by: Peter Snider <https://github.com/psnider>
|
---|
| 4 | // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
---|
| 5 |
|
---|
| 6 | // TypeScript Version: 2.2
|
---|
| 7 |
|
---|
| 8 | interface Emitter<Event = string> {
|
---|
| 9 | on(event: Event, listener: Function): Emitter;
|
---|
| 10 | once(event: Event, listener: Function): Emitter;
|
---|
| 11 | off(event?: Event, listener?: Function): Emitter;
|
---|
| 12 | emit(event: Event, ...args: any[]): Emitter;
|
---|
| 13 | listeners(event: Event): Function[];
|
---|
| 14 | hasListeners(event: Event): boolean;
|
---|
| 15 | }
|
---|
| 16 |
|
---|
| 17 | declare const Emitter: {
|
---|
| 18 | (obj?: object): Emitter;
|
---|
| 19 | new (obj?: object): Emitter;
|
---|
| 20 | };
|
---|
| 21 |
|
---|
| 22 | export = Emitter;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.