Skip to content

Commit

Permalink
Merge pull request #36 from chocolateboy/add-newable-type
Browse files Browse the repository at this point in the history
Add TypeScript types to make TinyEmitter newable
  • Loading branch information
scottcorgan committed Jun 27, 2019
2 parents a6026cc + f5ab124 commit 088f949
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,13 @@ export declare class TinyEmitter {
once(event: string, callback: Function, ctx?: any): this;
emit(event: string, ...args: any[]): this;
off(event: string, callback?: Function): this;
}
}

interface TinyEmitterStatic {
(): TinyEmitter;
new(): TinyEmitter;
}

declare const Emitter: TinyEmitterStatic;

export = Emitter;

0 comments on commit 088f949

Please sign in to comment.