Options
All
  • Public
  • Public/Protected
  • All
Menu

Implementation of WebCrypto interface

  • getRandomValues native implementation
  • Symmetric cryptography uses native implementation
  • Asymmetric cryptography uses calls to Server

Hierarchy

  • EventEmitter
    • Client

Index

Constructors

constructor

Properties

Protected Optional cipher

cipher: AsymmetricRatchet

double ratchet session

Protected messageCounter

messageCounter: number = 0

Optional serviceInfo

serviceInfo: ServerInfo

Protected Optional socket

socket: WebSocket

stack

stack: {}

Type declaration

Protected storage

Static defaultMaxListeners

defaultMaxListeners: number

Accessors

state

Methods

addListener

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

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

          • Rest ...args: any[]

          Returns void

    Returns this

challenge

  • challenge(): Promise<string>

Protected checkSocketState

  • checkSocketState(): void

close

  • close(): void

connect

  • connect(address: string, options?: ClientOptions): this
  • Connects to Service Steps:

    1. Requests info data from Server
    • if server not found emits error
    1. Create 2key-ratchet session from PreKeyBundle

    Parameters

    • address: string
    • Optional options: ClientOptions

    Returns this

emit

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

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

    Returns boolean

eventNames

  • eventNames(): Array<string | symbol>
  • Returns Array<string | symbol>

getMaxListeners

  • getMaxListeners(): number
  • Returns number

Protected getServerInfo

  • getServerInfo(address: string): Promise<ServerInfo>

isLoggedIn

  • isLoggedIn(): Promise<boolean>

listenerCount

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

    • type: string | symbol

    Returns number

listeners

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

    • event: string | symbol

    Returns Function[]

login

  • login(): Promise<void>

off

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

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

          • Rest ...args: any[]

          Returns void

    Returns this

on

  • on(event: "event", listener: (e: ActionProto) => void): this
  • on(event: "listening", listener: (e: ClientListeningEvent) => void): this
  • on(event: "close", listener: (e: ClientCloseEvent) => void): this
  • on(event: "error", listener: (e: ClientErrorEvent) => void): this

Protected onMessage

  • onMessage(message: ArrayBuffer): Promise<void>

once

  • once(event: "listening", listener: (e: ClientListeningEvent) => void): this
  • once(event: "close", listener: (e: ClientCloseEvent) => void): this
  • once(event: "error", listener: (e: ClientErrorEvent) => void): this
  • once(event: string | symbol, listener: (...args: any[]) => void): this

prependListener

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

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

          • Rest ...args: any[]

          Returns void

    Returns this

prependOnceListener

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

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

          • Rest ...args: any[]

          Returns void

    Returns this

rawListeners

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

    • event: string | symbol

    Returns Function[]

removeAllListeners

  • removeAllListeners(event?: string | symbol): this
  • Parameters

    • Optional event: string | symbol

    Returns this

removeListener

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

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

          • Rest ...args: any[]

          Returns void

    Returns this

send

  • send(data?: ActionProto): Promise<ArrayBuffer>

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