Skip to main content

interface RemoteChannel.Constructors

Defines the static RemoteChannel API.

Methods

createCross

Resolves to a new cross-channel RemoteChannel using the given configuration.

Definition

createCross<TSend = void, TReceive = TSend>(port: RemoteChannel.SimpleMessagePort, config: RemoteChannel.CrossConfig): Promise<CrossChannel<TSend, TReceive>>;

Type parameters

NameDefaultDescription
TSendvoidthe send message type
TReceiveTSendthe receive message type

Parameters

NameTypeDescription
portRemoteChannel.SimpleMessagePort
configRemoteChannel.CrossConfigthe channel configuration

createRead

Resolves to a new read-only RemoteChannel using the given configuration.

Definition

createRead<T = void>(port: RemoteChannel.SimpleMessagePort, config: RemoteChannel.ReadConfig): Promise<Channel.Read<T>>;

Type parameters

NameDefaultDescription
Tvoidthe message type

Parameters

NameTypeDescription
portRemoteChannel.SimpleMessagePort
configRemoteChannel.ReadConfigthe channel configuration

createWrite

Resolves to a new write-only RemoteChannel using the given configuration.

Definition

createWrite<T = void>(port: RemoteChannel.SimpleMessagePort, config: RemoteChannel.WriteConfig): Promise<Channel.Write<T>>;

Type parameters

NameDefaultDescription
Tvoidthe message type

Parameters

NameTypeDescription
portRemoteChannel.SimpleMessagePort
configRemoteChannel.WriteConfigthe channel configuration