Documentation
    Preparing search index...

    Type Parameters

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    _isConnected: TransportStatus

    The status of the transport

    The client handling the encryption/decryption of messages

    name: string

    The name of the app

    newPeerListener?: (peer: T) => void

    The listener that will be invoked when a new peer is connected

    peerManager: PeerManager<K>
    type: TransportType = TransportType.P2P

    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: unknown, connectionInfo: ConnectionContext) => void

        The listener that will be registered

      Returns Promise<void>

    • Parameters

      • newPeer: T
      • Optional_sendPairingResponse: boolean

      Returns Promise<void>

    • Returns Promise<T[]>

    • 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

      Returns Promise<void>

    • Parameters

      • peerToBeRemoved: T

      Returns Promise<void>

    • Send a message through the transport

      Parameters

      • message: string

        The message to send

      • Optionalpeer: PeerInfo

      Returns Promise<void>