API reference / @evolu/common / WebSocket / WebSocketOptions
Interface: WebSocketOptions
Defined in: packages/common/src/WebSocket.ts:52
Options for creating WebSocket
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
binaryType? | public | "blob" | "arraybuffer" | Sets the binary type for the data being received. | packages/common/src/WebSocket.ts:57 |
onClose? | public | (event) => void | Callback when the connection is closed. | packages/common/src/WebSocket.ts:66 |
onError? | public | (error) => void | Callback when an error occurs. | packages/common/src/WebSocket.ts:63 |
onMessage? | public | (data) => void | Callback when message data is received. | packages/common/src/WebSocket.ts:69 |
onOpen? | public | () => void | Callback when the connection is established. | packages/common/src/WebSocket.ts:60 |
protocols? | public | string | string[] | Protocol(s) to use with the WebSocket connection. | packages/common/src/WebSocket.ts:54 |
retryOptions? | public | Omit<RetryOptions<WebSocketRetryError>, "signal"> | Options for retry behavior. | packages/common/src/WebSocket.ts:72 |
WebSocketConstructor? | public | { (url, protocols?): WebSocket; CLOSED: 3; CLOSING: 2; CONNECTING: 0; OPEN: 1; prototype: WebSocket; } | For custom WebSocket implementations. This suppors blob: https://github.com/callstackincubator/react-native-fast-io | packages/common/src/WebSocket.ts:81 |
WebSocketConstructor.CLOSED | readonly | 3 | - | node_modules/typescript/lib/lib.dom.d.ts:36131 |
WebSocketConstructor.CLOSING | readonly | 2 | - | node_modules/typescript/lib/lib.dom.d.ts:36130 |
WebSocketConstructor.CONNECTING | readonly | 0 | - | node_modules/typescript/lib/lib.dom.d.ts:36128 |
WebSocketConstructor.OPEN | readonly | 1 | - | node_modules/typescript/lib/lib.dom.d.ts:36129 |
WebSocketConstructor.prototype | public | WebSocket | - | node_modules/typescript/lib/lib.dom.d.ts:36126 |