interface · Browser and Node
Transport
@toip-tools/trust-coreView sourceimport { type Transport } from "@toip-tools/trust-core";
Declaration
interface Transport {
/** Registers the function that receives wires addressed to `vid`. It resolves once the wire is processed. */
attach(vid: string, deliver: (wire: Uint8Array) => Promise<void>): void;
detach(vid: string): void;
post(from: string, to: string, wire: Uint8Array): Promise<Delivery>;
}
Methods
attach
Registers the function that receives wires addressed to vid. It resolves once the wire is processed.
attach(vid: string, deliver: (wire: Uint8Array) => Promise<void>): void;
Parameters
vidrequiredstringdeliverrequired(wire: Uint8Array) => Promise<void>
Returns
voiddetach
detach(vid: string): void;
Parameters
vidrequiredstring
Returns
voidpost
post(from: string, to: string, wire: Uint8Array): Promise<Delivery>;
Parameters
fromrequiredstringtorequiredstringwirerequiredUint8Array<ArrayBufferLike>
Returns
Promise<Delivery>