Skip to content

Transport

Transport = object

Defined in: packages/postal/src/transport.ts:45

A transport bridges postal across execution boundaries (iframes, workers, tabs).

Implementers provide send (push envelopes to the remote) and subscribe (receive envelopes from the remote). Postal handles the wiring — echo prevention, filtering, and local dispatch are managed internally.

optional dispose: () => void

Defined in: packages/postal/src/transport.ts:51

Optional cleanup when the transport is removed or reset.

void


send: (envelope, meta?) => void

Defined in: packages/postal/src/transport.ts:47

Send an envelope to the remote side.

Envelope

TransportSendMeta

void


subscribe: (callback) => () => void

Defined in: packages/postal/src/transport.ts:49

Listen for envelopes arriving from the remote side. Returns an unsubscribe function.

(envelope) => void

(): void

void