WebSocketAPI - v1.1.5-1 › Globals › "client/socket"
Ƭ stateChangeEvent: "OPEN" | "CLOSED" | "ERROR" | "READY" | "AUTHFAILED"
Defined in lib/client/socket.ts:18
• ready: Boolean = false
Defined in lib/client/socket.ts:22
• socket: WebSocket | null = null
Defined in lib/client/socket.ts:21
• stateChangeEvents: function[] = []
Defined in lib/client/socket.ts:19
▸ fetch(id: number, api: string, body?: any, options?: requestOptions): Promise‹RequestData›
Defined in lib/client/socket.ts:213
Create a fetch request from the server
Parameters:
| Name | Type | Description |
|---|---|---|
id |
number | The data request id |
api |
string | the api endpoint |
body? |
any | the body to send to the server |
options? |
requestOptions | options for the request |
Returns: Promise‹RequestData›
▸ registerSnapshot(id: number, api: string, body: any, callback: function): unregister
Defined in lib/client/socket.ts:260
Register a event to fire each time that id gets sent
Returns a function to unregister the event
Parameters:
▪ id: number
the event id to use
▪ api: string
the api string
▪ body: any
the request body to send to the server
▪ callback: function
the callback to run on each message
▸ (data: RequestData): void
Parameters:
| Name | Type |
|---|---|
data |
RequestData |
Returns: unregister
▸ send(body: object): void
Defined in lib/client/socket.ts:297
Send a payload to the server
Parameters:
| Name | Type | Description |
|---|---|---|
body |
object | The data to send to the server |
Returns: void
▸ setup(): void
Defined in lib/client/socket.ts:24
Returns: void