transports.ts

Declarations
#

3 declarations

view source

Transport
#

TransportName
#

Transports
#

transports.ts view source

allow_fallback

Whether to allow fallback to other transports if the current one is not available.

type boolean

register_transport

Registers a transport.

type (transport: Transport): void

transport
returns void

set_current_transport

type (transport_name: string): void

transport_name
type string
returns void

get_transport

Gets either the current transport or the first ready transport depending on allow_fallback, or throws an error.

type (transport_name?: string | undefined): Transport | null

transport_name?

Optional transport to use instead of the current

type string | undefined
optional
returns Transport | null
throws
  • when - no transport available or ready

is_ready

type (): boolean | null

returns boolean | null

get_current_transport

type (): Transport | null

returns Transport | null

get_current_transport_name

type (): string | null

returns string | null

get_transport_by_name

type (transport_name: string): Transport | null

transport_name
type string
returns Transport | null

Imported by
#