IEventEmitter interface

Represents a EventEmitter from the net module in Node.js. This interface supports the framework and is not intended to be called directly for your code.

Methods

addListener(string | symbol, (args: any[]) => void)
emit(string | symbol, any[])
eventNames()
getMaxListeners()
listenerCount(string | symbol)
listeners(string | symbol)
off(string | symbol, (args: any[]) => void)
on(string | symbol, (args: any[]) => void)
once(string | symbol, (args: any[]) => void)
prependListener(string | symbol, (args: any[]) => void)
prependOnceListener(string | symbol, (args: any[]) => void)
rawListeners(string | symbol)
removeAllListeners(string | symbol)
removeListener(string | symbol, (args: any[]) => void)
setMaxListeners(number)

Method Details

addListener(string | symbol, (args: any[]) => void)

function addListener(event: string | symbol, listener: (args: any[]) => void): this

Parameters

event

string | symbol

listener

(args: any[]) => void

Returns

this

emit(string | symbol, any[])

function emit(event: string | symbol, args: any[]): boolean

Parameters

event

string | symbol

args

any[]

Returns

boolean

eventNames()

function eventNames(): Array<string | symbol>

Returns

Array<string | symbol>

getMaxListeners()

function getMaxListeners(): number

Returns

number

listenerCount(string | symbol)

function listenerCount(type: string | symbol): number

Parameters

type

string | symbol

Returns

number

listeners(string | symbol)

function listeners(event: string | symbol): Function[]

Parameters

event

string | symbol

Returns

Function[]

off(string | symbol, (args: any[]) => void)

function off(event: string | symbol, listener: (args: any[]) => void): this

Parameters

event

string | symbol

listener

(args: any[]) => void

Returns

this

on(string | symbol, (args: any[]) => void)

function on(event: string | symbol, listener: (args: any[]) => void): this

Parameters

event

string | symbol

listener

(args: any[]) => void

Returns

this

once(string | symbol, (args: any[]) => void)

function once(event: string | symbol, listener: (args: any[]) => void): this

Parameters

event

string | symbol

listener

(args: any[]) => void

Returns

this

prependListener(string | symbol, (args: any[]) => void)

function prependListener(event: string | symbol, listener: (args: any[]) => void): this

Parameters

event

string | symbol

listener

(args: any[]) => void

Returns

this

prependOnceListener(string | symbol, (args: any[]) => void)

function prependOnceListener(event: string | symbol, listener: (args: any[]) => void): this

Parameters

event

string | symbol

listener

(args: any[]) => void

Returns

this

rawListeners(string | symbol)

function rawListeners(event: string | symbol): Function[]

Parameters

event

string | symbol

Returns

Function[]

removeAllListeners(string | symbol)

function removeAllListeners(event?: string | symbol): this

Parameters

event

string | symbol

Returns

this

removeListener(string | symbol, (args: any[]) => void)

function removeListener(event: string | symbol, listener: (args: any[]) => void): this

Parameters

event

string | symbol

listener

(args: any[]) => void

Returns

this

setMaxListeners(number)

function setMaxListeners(n: number): this

Parameters

n

number

Returns

this