IEventEmitter interface
代表 Node.js中 net
模組中的 EventEmitter。
此介面支持架構,並不適合直接為您的程式代碼呼叫。
方法
方法詳細資料
addListener(string | symbol, (args: any[]) => void)
function addListener(event: string | symbol, listener: (args: any[]) => void): this
參數
- event
-
string | symbol
- listener
-
(args: any[]) => void
傳回
this
emit(string | symbol, any[])
function emit(event: string | symbol, args: any[]): boolean
參數
- event
-
string | symbol
- args
-
any[]
傳回
boolean
eventNames()
function eventNames(): Array<string | symbol>
傳回
Array<string | symbol>
getMaxListeners()
function getMaxListeners(): number
傳回
number
listenerCount(string | symbol)
function listenerCount(type: string | symbol): number
參數
- type
-
string | symbol
傳回
number
listeners(string | symbol)
function listeners(event: string | symbol): Function[]
參數
- event
-
string | symbol
傳回
Function[]
off(string | symbol, (args: any[]) => void)
function off(event: string | symbol, listener: (args: any[]) => void): this
參數
- event
-
string | symbol
- listener
-
(args: any[]) => void
傳回
this
on(string | symbol, (args: any[]) => void)
function on(event: string | symbol, listener: (args: any[]) => void): this
參數
- event
-
string | symbol
- listener
-
(args: any[]) => void
傳回
this
once(string | symbol, (args: any[]) => void)
function once(event: string | symbol, listener: (args: any[]) => void): this
參數
- event
-
string | symbol
- listener
-
(args: any[]) => void
傳回
this
prependListener(string | symbol, (args: any[]) => void)
function prependListener(event: string | symbol, listener: (args: any[]) => void): this
參數
- event
-
string | symbol
- listener
-
(args: any[]) => void
傳回
this
prependOnceListener(string | symbol, (args: any[]) => void)
function prependOnceListener(event: string | symbol, listener: (args: any[]) => void): this
參數
- event
-
string | symbol
- listener
-
(args: any[]) => void
傳回
this
rawListeners(string | symbol)
function rawListeners(event: string | symbol): Function[]
參數
- event
-
string | symbol
傳回
Function[]
removeAllListeners(string | symbol)
function removeAllListeners(event?: string | symbol): this
參數
- event
-
string | symbol
傳回
this
removeListener(string | symbol, (args: any[]) => void)
function removeListener(event: string | symbol, listener: (args: any[]) => void): this
參數
- event
-
string | symbol
- listener
-
(args: any[]) => void
傳回
this
setMaxListeners(number)
function setMaxListeners(n: number): this
參數
- n
-
number
傳回
this