WebSocketMinimal
See source codeTable of contents
Minimal server-side WebSocket interface that is compatible with
- The standard WebSocket interface (cloudflare, deno, some node setups)
- The 'ws' WebSocket interface (some node setups)
- The Bun.serve socket implementation
interface WebSocketMinimal {}
Properties
addEventListener
optional
addEventListener?: (
type: 'close' | 'error' | 'message',
listener: (event: any) => void
) => void
close
close: (code?: number, reason?: string) => void
readyState
readyState: number
removeEventListener
optional
removeEventListener?: (
type: 'close' | 'error' | 'message',
listener: (event: any) => void
) => void
send
send: (data: string) => void
Prev
TLSyncLogNext
TLSyncUserInfo