Properties
Optional
autoClose
autoClose?: boolean
Optional
beforeMessage
beforeMessage?: ((e) => any)
Optional
heartMessage
heartMessage?: string
Optional
heartTime
heartTime?: number
Optional
isReconnect
isReconnect?: boolean
Optional
onClose
onClose?: ((ws, e) => void)
Type declaration
- (ws, e): void
Parameters
- ws: WebSocket
- e: CloseEvent
Returns void
Optional
onError
onError?: ((ws, e) => void)
Type declaration
- (ws, e): void
Returns void
Optional
onFailed
onFailed?: (() => void)
Optional
onMessage
onMessage?: ((ws, e) => void)
Type declaration
- (ws, e): void
Parameters
- ws: WebSocket
- e: MessageEvent<any>
Returns void
Optional
onOpen
onOpen?: ((ws) => void)
Optional
protocols
protocols?: string | string[]
Optional
reconnectCount
reconnectCount?: number | (() => boolean)
Type declaration
- (): boolean
Returns boolean
Optional
reconnectTime
reconnectTime?: number
自动关闭