Interface: WebSocketLike
Properties
| Property | Modifier | Type |
|---|---|---|
binaryType? | public | string |
onclose | public | | ((event: WebSocketCloseEvent) => void) | null |
onerror | public | ((event: unknown) => void) | null |
onmessage | public | | ((event: WebSocketMessageEvent) => void) | null |
onopen | public | (() => void) | null |
readyState | readonly | number |
Methods
close()
ts
close(code?: number, reason?: string): void;Parameters
| Parameter | Type |
|---|---|
code? | number |
reason? | string |
Returns
void
send()
ts
send(data: string): void;Parameters
| Parameter | Type |
|---|---|
data | string |
Returns
void
terminate()?
ts
terminate?(): void;Node.js extension used when a failed connection cannot close gracefully.
Returns
void