Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface RcWebSocket

Hierarchy

  • WebSocket
    • RcWebSocket

Index

Properties

CLOSED

CLOSED: number

CLOSING

CLOSING: number

CONNECTING

CONNECTING: number

OPEN

OPEN: number

WebSocket

WebSocket: object

Type declaration

binaryType

binaryType: BinaryType

bufferedAmount

bufferedAmount: number

extensions

extensions: string

id

id: number

Websocket identifier implemented for visibility/debugging purposes.

onclose

onclose: function | null

onerror

onerror: function | null

onmessage

onmessage: function | null

onopen

onopen: function | null

protocol

protocol: string

readyState

readyState: number

url

url: string

Methods

addEventListener

  • addEventListener<K>(type: K, listener: function, options?: boolean | AddEventListenerOptions): void
  • addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void
  • Type parameters

    • K: keyof WebSocketEventMap

    Parameters

    • type: K
    • listener: function
        • (this: WebSocket, ev: WebSocketEventMap[K]): any
        • Parameters

          • this: WebSocket
          • ev: WebSocketEventMap[K]

          Returns any

    • Optional options: boolean | AddEventListenerOptions

    Returns void

  • Parameters

    • type: string
    • listener: EventListenerOrEventListenerObject
    • Optional options: boolean | AddEventListenerOptions

    Returns void

close

  • close(code?: undefined | number, reason?: undefined | string): void
  • Parameters

    • Optional code: undefined | number
    • Optional reason: undefined | string

    Returns void

dispatchEvent

  • dispatchEvent(event: Event): boolean
  • Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.

    Parameters

    • event: Event

    Returns boolean

removeEventListener

  • removeEventListener<K>(type: K, listener: function, options?: boolean | EventListenerOptions): void
  • removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void
  • Type parameters

    • K: keyof WebSocketEventMap

    Parameters

    • type: K
    • listener: function
        • (this: WebSocket, ev: WebSocketEventMap[K]): any
        • Parameters

          • this: WebSocket
          • ev: WebSocketEventMap[K]

          Returns any

    • Optional options: boolean | EventListenerOptions

    Returns void

  • Parameters

    • type: string
    • listener: EventListenerOrEventListenerObject
    • Optional options: boolean | EventListenerOptions

    Returns void

send

  • send(data: string | ArrayBufferLike | Blob | ArrayBufferView): void
  • Parameters

    • data: string | ArrayBufferLike | Blob | ArrayBufferView

    Returns void

Generated using TypeDoc