Abstract
Optional
protocols: string | string[]Abstract
readyA WebSocket.readyState
property that is compatible with the native property
(https://developer.mozilla.org/docs/Web/API/WebSocket/readyState) and the ws
package's
property (https://github.com/websockets/ws/blob/HEAD/doc/ws.md#websocketreadystate)
Abstract
sendA WebSocket.send
method that is compatible with the native method
(https://developer.mozilla.org/docs/Web/API/WebSocket/send) and the ws
package's method
(https://github.com/websockets/ws/blob/HEAD/doc/ws.md#websocketsenddata-options-callback)
Abstract
addA WebSocket.addEventListener
method that is compatible with the native method
(https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) and the ws
package's method
(https://github.com/websockets/ws/blob/HEAD/doc/ws.md#websocketaddeventlistenertype-listener-options)
Optional
options: CommonWebSocketListenerOptionsAbstract
closeA WebSocket.close
method that is compatible with the native method
(https://developer.mozilla.org/docs/Web/API/WebSocket/close) and the ws
package's method
(https://github.com/websockets/ws/blob/HEAD/doc/ws.md#websocketclosecode-reason)
Abstract
removeA WebSocket.removeEventListener
method that is compatible with the native method
(https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) and the ws
package's method
(https://github.com/websockets/ws/blob/HEAD/doc/ws.md#websocketremoveeventlistenertype-listener)
A WebSocket interface that matches both client-side WebSockets and host-side WebSockets.
Package
@rest-vir/define-service