Updated events module to include exported EventEmitter CLASS so it can be extended, like in the Azure library.

This commit is contained in:
Andrew Gaspar
2013-03-31 02:08:09 -05:00
parent 4306205fa5
commit 9c35a42514
2 changed files with 74 additions and 5 deletions

11
node/node.d.ts vendored
View File

@@ -225,7 +225,16 @@ declare module "events" {
emit(event: string, arg1?: any, arg2?: any): void;
}
export var EventEmitter: NodeEventEmitter;
export class EventEmitter implements NodeEventEmitter {
addListener(event: string, listener: Function);
on(event: string, listener: Function): any;
once(event: string, listener: Function): void;
removeListener(event: string, listener: Function): void;
removeAllListener(event: string): void;
setMaxListeners(n: number): void;
listeners(event: string): { Function; }[];
emit(event: string, arg1?: any, arg2?: any): void;
}
}
declare module "http" {