Skip to content
1 min read · 11 words

Type Alias: GuestToHostEnvelope

ts
type GuestToHostEnvelope =
  | {
      encoderAvailable: boolean;
      t: "ready";
    }
  | {
      id: string;
      ok: true;
      t: "result";
      value: WireValue;
    }
  | {
      error: WireError;
      id: string;
      ok: false;
      t: "result";
    }
  | {
      delta: WireValue;
      id: string;
      t: "stream:delta";
    }
  | {
      id: string;
      t: "stream:end";
    }
  | {
      error: WireError;
      id: string;
      t: "stream:error";
    }
  | {
      channel: string;
      payload: WireValue;
      t: "event";
    };

Defined in: src/batteries/isolation/protocol.ts:63

Guest → host envelopes.