forked from sindresorhus/component-emitter
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6bd7817
commit 908fbc4
Showing
2 changed files
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
interface Emitter<Event = string> { | ||
on(event: Event, listener: Function): Emitter; | ||
once(event: Event, listener: Function): Emitter; | ||
off(event?: Event, listener?: Function): Emitter; | ||
emit(event: Event, ...args: any[]): Emitter; | ||
listeners(event: Event): Function[]; | ||
hasListeners(event: Event): boolean; | ||
removeListener(event?: Event, listener?: Function): Emitter; | ||
removeEventListener(event?: Event, listener?: Function): Emitter; | ||
removeAllListeners(event?: Event): Emitter; | ||
} | ||
|
||
declare const Emitter: { | ||
(obj?: object): Emitter; | ||
new (obj?: object): Emitter; | ||
}; | ||
|
||
export = Emitter; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters