public addListener(event: "'error'", cb: (err: Error) => void): WebSocket
Parameters
-
event: "'error'"
-
cb: (err: Error) => void
Returns
WebSocket
public addListener(event: "'close'", cb: (code: number, message: string) => void): WebSocket
Parameters
-
event: "'close'"
-
cb: (code: number, message: string) => void
Returns
WebSocket
public addListener(event: "'message'", cb: (data: any, flags: { binary: boolean; }) => void): WebSocket
Parameters
-
event: "'message'"
-
cb: (data: any, flags: { binary: boolean; }) => void
Returns
WebSocket
public addListener(event: "'ping'", cb: (data: any, flags: { binary: boolean; }) => void): WebSocket
Parameters
-
event: "'ping'"
-
cb: (data: any, flags: { binary: boolean; }) => void
Returns
WebSocket
public addListener(event: "'pong'", cb: (data: any, flags: { binary: boolean; }) => void): WebSocket
Parameters
-
event: "'pong'"
-
cb: (data: any, flags: { binary: boolean; }) => void
Returns
WebSocket
public addListener(event: "'open'", cb: () => void): WebSocket
Parameters
-
event: "'open'"
-
cb: () => void
Returns
WebSocket
public addListener(event: string, listener: () => void): WebSocket
Parameters
-
event: string
-
listener: () => void
Returns
WebSocket