API reference / @evolu/common / WebSocket / WebSocketOptions

Interface: WebSocketOptions

Defined in: packages/common/src/WebSocket.ts:47

Options for creating WebSocket

Properties

PropertyModifierTypeDescriptionDefined in
binaryType?public"blob" | "arraybuffer"Sets the binary type for the data being received.packages/common/src/WebSocket.ts:52
onClose?public(event) => voidCallback when the connection is closed.packages/common/src/WebSocket.ts:61
onError?public(error) => voidCallback when an error occurs.packages/common/src/WebSocket.ts:58
onMessage?public(data) => voidCallback when message data is received.packages/common/src/WebSocket.ts:64
onOpen?public() => voidCallback when the connection is established.packages/common/src/WebSocket.ts:55
protocols?publicstring | string[]Protocol(s) to use with the WebSocket connection.packages/common/src/WebSocket.ts:49
retryOptions?publicOmit<RetryOptions<WebSocketRetryError>, "signal">Options for retry behavior.packages/common/src/WebSocket.ts:67
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-iopackages/common/src/WebSocket.ts:76
WebSocketConstructor.CLOSEDreadonly3-node_modules/typescript/lib/lib.dom.d.ts:26778
WebSocketConstructor.CLOSINGreadonly2-node_modules/typescript/lib/lib.dom.d.ts:26777
WebSocketConstructor.CONNECTINGreadonly0-node_modules/typescript/lib/lib.dom.d.ts:26775
WebSocketConstructor.OPENreadonly1-node_modules/typescript/lib/lib.dom.d.ts:26776
WebSocketConstructor.prototypepublicWebSocket-node_modules/typescript/lib/lib.dom.d.ts:26773

Was this page helpful?