Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Channel

Hierarchy

  • EventEmitter
  • EventEmitter
    • Channel

Index

Constructors

constructor

Properties

closed

closed: boolean

id

id: number | null

isOpen

isOpen: boolean

Private requestMap

requestMap: {}

Type declaration

Private sendQueue

sendQueue: Array<ICommand>

Private sendToClient

sendToClient: (cmd: Command) => void

Type declaration

state

state: CREATED | ATTACHED | null

Static defaultMaxListeners

defaultMaxListeners: number

Methods

addListener

  • addListener(event: string | symbol, listener: (...args: any[]) => void): this
  • addListener(event: "command", listener: typeof command): this
  • addListener(event: "error", listener: typeof error): this
  • addListener(event: "close", listener: typeof close): this
  • addListener(event: "open", listener: typeof open): this

close

emit

  • emit(event: string | symbol, ...args: any[]): boolean
  • emit(event: "command", ...args: Parameters<typeof command>): boolean
  • emit(event: "error", ...args: Parameters<typeof error>): boolean
  • emit(event: "close", ...args: Parameters<typeof close>): boolean
  • emit(event: "open", ...args: Parameters<typeof open>): boolean

Private enqueueSend

eventNames

  • eventNames(): Array<string | symbol>
  • eventNames(): Array<"command" | "error" | "close" | "open">
  • Returns Array<string | symbol>

  • Returns Array<"command" | "error" | "close" | "open">

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): this
  • off(event: "command", listener: typeof command): this
  • off(event: "error", listener: typeof error): this
  • off(event: "close", listener: typeof close): this
  • off(event: "open", listener: typeof open): this
  • Parameters

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

          • Rest ...args: any[]

          Returns void

    Returns this

  • Parameters

    • event: "command"
    • listener: typeof command

    Returns this

  • Parameters

    • event: "error"
    • listener: typeof error

    Returns this

  • Parameters

    • event: "close"
    • listener: typeof close

    Returns this

  • Parameters

    • event: "open"
    • listener: typeof open

    Returns this

on

  • on(event: string | symbol, listener: (...args: any[]) => void): this
  • on(event: "command", listener: typeof command): this
  • on(event: "error", listener: typeof error): this
  • on(event: "close", listener: typeof close): this
  • on(event: "open", listener: typeof open): this
  • Parameters

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

          • Rest ...args: any[]

          Returns void

    Returns this

  • Parameters

    • event: "command"
    • listener: typeof command

    Returns this

  • Parameters

    • event: "error"
    • listener: typeof error

    Returns this

  • Parameters

    • event: "close"
    • listener: typeof close

    Returns this

  • Parameters

    • event: "open"
    • listener: typeof open

    Returns this

once

  • once(event: string | symbol, listener: (...args: any[]) => void): this
  • once(event: "command", listener: typeof command): this
  • once(event: "error", listener: typeof error): this
  • once(event: "close", listener: typeof close): this
  • once(event: "open", listener: typeof open): this

prependListener

  • prependListener(event: string | symbol, listener: (...args: any[]) => void): this
  • prependListener(event: "command", listener: typeof command): this
  • prependListener(event: "error", listener: typeof error): this
  • prependListener(event: "close", listener: typeof close): this
  • prependListener(event: "open", listener: typeof open): this

prependOnceListener

  • prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this
  • prependOnceListener(event: "command", listener: typeof command): this
  • prependOnceListener(event: "error", listener: typeof error): this
  • prependOnceListener(event: "close", listener: typeof close): this
  • prependOnceListener(event: "open", listener: typeof open): this

rawListeners

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

    • event: string | symbol

    Returns Function[]

removeAllListeners

  • removeAllListeners(event?: string | symbol): this
  • removeAllListeners(event?: "command" | "error" | "close" | "open"): this
  • Parameters

    • Optional event: string | symbol

    Returns this

  • Parameters

    • Optional event: "command" | "error" | "close" | "open"

    Returns this

removeListener

  • removeListener(event: string | symbol, listener: (...args: any[]) => void): this
  • removeListener(event: "command", listener: typeof command): this
  • removeListener(event: "error", listener: typeof error): this
  • removeListener(event: "close", listener: typeof close): this
  • removeListener(event: "open", listener: typeof open): this

request

send

setMaxListeners

  • setMaxListeners(n: number): this
  • Parameters

    • n: number

    Returns this

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