Partager via


IEventEmitter interface

Représente un EventEmitter à partir du module net dans Node.js. Cette interface prend en charge l’infrastructure et n’est pas destinée à être appelée directement pour votre code.

Méthodes

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)

Détails de la méthode

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

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

Paramètres

event

string | symbol

listener

(args: any[]) => void

Retours

this

emit(string | symbol, any[])

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

Paramètres

event

string | symbol

args

any[]

Retours

boolean

eventNames()

function eventNames(): Array<string | symbol>

Retours

Array<string | symbol>

getMaxListeners()

function getMaxListeners(): number

Retours

number

listenerCount(string | symbol)

function listenerCount(type: string | symbol): number

Paramètres

type

string | symbol

Retours

number

listeners(string | symbol)

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

Paramètres

event

string | symbol

Retours

Function[]

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

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

Paramètres

event

string | symbol

listener

(args: any[]) => void

Retours

this

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

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

Paramètres

event

string | symbol

listener

(args: any[]) => void

Retours

this

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

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

Paramètres

event

string | symbol

listener

(args: any[]) => void

Retours

this

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

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

Paramètres

event

string | symbol

listener

(args: any[]) => void

Retours

this

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

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

Paramètres

event

string | symbol

listener

(args: any[]) => void

Retours

this

rawListeners(string | symbol)

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

Paramètres

event

string | symbol

Retours

Function[]

removeAllListeners(string | symbol)

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

Paramètres

event

string | symbol

Retours

this

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

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

Paramètres

event

string | symbol

listener

(args: any[]) => void

Retours

this

setMaxListeners(number)

function setMaxListeners(n: number): this

Paramètres

n

number

Retours

this