Skip to content

Commit

Permalink
Allow event name symbols in events$EventEmitter.
Browse files Browse the repository at this point in the history
  • Loading branch information
mirek committed Feb 18, 2019
1 parent 0eb0133 commit fc36949
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions lib/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -776,27 +776,26 @@ declare module "dns" {

declare class events$EventEmitter {
// deprecated
static listenerCount(emitter: events$EventEmitter, event: string): number;
static listenerCount(emitter: events$EventEmitter, event: string | Symbol): number;
static defaultMaxListeners: number;

addListener(event: string, listener: Function): this;
emit(event: string, ...args:Array<any>): boolean;
eventNames(): Array<string>;
listeners(event: string): Array<Function>;
listenerCount(event: string): number;
on(event: string, listener: Function): this;
once(event: string, listener: Function): this;
prependListener(event: string, listener: Function): this;
prependOnceListener(event: string, listener: Function): this;
removeAllListeners(event?: string): this;
removeListener(event: string, listener: Function): this;
off(event: string, listener: Function): this;
addListener(event: string | Symbol, listener: Function): this;
emit(event: string | Symbol, ...args: Array<any>): boolean;
eventNames(): Array<string | Symbol>;
listeners(event: string | Symbol): Array<Function>;
listenerCount(event: string | Symbol): number;
on(event: string | Symbol, listener: Function): this;
once(event: string | Symbol, listener: Function): this;
prependListener(event: string | Symbol, listener: Function): this;
prependOnceListener(event: string | Symbol, listener: Function): this;
removeAllListeners(event?: string | Symbol): this;
removeListener(event: string | Symbol, listener: Function): this;
off(event: string | Symbol, listener: Function): this;
setMaxListeners(n: number): this;
getMaxListeners(): number;
rawListeners(event: string): Array<Function>;
rawListeners(event: string | Symbol): Array<Function>;
}


declare module "events" {
// TODO: See the comment above the events$EventEmitter declaration
declare class EventEmitter extends events$EventEmitter {
Expand Down

0 comments on commit fc36949

Please sign in to comment.