Options
All
  • Public
  • Public/Protected
  • All
Menu

Class BrowserWebSocket

Hierarchy

  • EventEmitter
    • BrowserWebSocket

Index

Constructors

constructor

  • Parameters

    • url: string

    Returns BrowserWebSocket

Properties

readyState

readyState: number

Static CLOSED

CLOSED: 3

Static CLOSING

CLOSING: 2

Static CONNECTING

CONNECTING: 0

Static OPEN

OPEN: 1

Static defaultMaxListeners

defaultMaxListeners: number

Methods

addListener

  • addListener(event: string | symbol, listener: (...args: any[]) => void): BrowserWebSocket
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns BrowserWebSocket

close

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

    • Optional code: number
    • Optional reason: string

    Returns void

emit

  • emit(event: string | symbol, ...args: any[]): boolean
  • Parameters

    • event: string | symbol
    • Rest ...args: any[]

    Returns boolean

eventNames

  • eventNames(): (string | symbol)[]
  • Returns (string | symbol)[]

getMaxListeners

  • getMaxListeners(): number
  • Returns number

listenerCount

  • listenerCount(type: string | symbol): number
  • Parameters

    • type: string | symbol

    Returns number

listeners

  • listeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

off

  • off(event: string | symbol, listener: (...args: any[]) => void): BrowserWebSocket
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns BrowserWebSocket

on

  • on(event: string | symbol, listener: (...args: any[]) => void): BrowserWebSocket
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns BrowserWebSocket

once

  • once(event: string | symbol, listener: (...args: any[]) => void): BrowserWebSocket
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns BrowserWebSocket

prependListener

  • prependListener(event: string | symbol, listener: (...args: any[]) => void): BrowserWebSocket
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns BrowserWebSocket

prependOnceListener

  • prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): BrowserWebSocket
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns BrowserWebSocket

rawListeners

  • rawListeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

removeAllListeners

  • Parameters

    • Optional event: string | symbol

    Returns BrowserWebSocket

removeEventListener

  • removeEventListener(event: string | symbol, listener: (...args: any[]) => void): BrowserWebSocket
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns BrowserWebSocket

removeListener

  • removeListener(event: string | symbol, listener: (...args: any[]) => void): BrowserWebSocket
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns BrowserWebSocket

send

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

    • data: string | ArrayBuffer | SharedArrayBuffer | Blob | ArrayBufferView

    Returns void

setMaxListeners

  • Parameters

    • n: number

    Returns BrowserWebSocket

terminate

  • terminate(): void
  • Returns void

Static listenerCount

  • listenerCount(emitter: EventEmitter, event: string | symbol): number
  • deprecated

    since v4.0.0

    Parameters

    • emitter: EventEmitter
    • event: string | symbol

    Returns number

Generated using TypeDoc