Class Transport<T, K, S>Abstract

Internalapi

Type Parameters

Hierarchy

Constructors

Properties

_isConnected: TransportStatus

The status of the transport

client: S

The client handling the encryption/decryption of messages

listeners: any

The listeners that will be notified when new messages are coming in

name: string

The name of the app

newPeerListener?: ((peer) => void)

Type declaration

    • (peer): void
    • The listener that will be invoked when a new peer is connected

      Parameters

      • peer: T

      Returns void

peerManager: PeerManager<K>

The type of the transport

Accessors

  • get connectionStatus(): TransportStatus
  • Return the status of the connection

    Returns TransportStatus

Methods

  • Add a listener to be called when a new message is received

    Parameters

    • listener: ((message, connectionInfo) => void)

      The listener that will be registered

        • (message, connectionInfo): void
        • Parameters

          Returns void

    Returns Promise<void>

  • Parameters

    • newPeer: T
    • Optional _sendPairingResponse: boolean

    Returns Promise<void>

  • Connect the transport

    Returns Promise<void>

  • Disconnect the transport

    Returns Promise<void>

  • Returns Promise<T[]>

  • Parameters

    • publicKey: string

    Returns Promise<void>

  • Notify the listeners when a new message comes in

    Parameters

    • message: unknown

      Message

    • connectionInfo: ConnectionContext

      Context info about the connection

    Returns Promise<void>

  • Returns Promise<void>

  • Remove a listener

    Parameters

    • listener: ((message, connectionInfo) => void)
        • (message, connectionInfo): void
        • Parameters

          Returns void

    Returns Promise<void>

  • Parameters

    • peerToBeRemoved: T

    Returns Promise<void>

  • Send a message through the transport

    Parameters

    • message: string

      The message to send

    • Optional peer: PeerInfo

    Returns Promise<void>

  • Parameters

    Returns void

  • Returns a promise that resolves to true if the transport is available, false if it is not

    Returns Promise<boolean>

Generated using TypeDoc