type alias ResponseSnapshot
Since 0.2.0

Discriminated union representing the possible shapes of an IResponse snapshot. When streaming is false, body is a buffered Uint8Array | string | null. When streaming is true, body is a live ReadableStream<Uint8Array>.

Definition

{ readonly streaming: false; readonly status: number; readonly headers: Headers; readonly body: Uint8Array | string | null; readonly responseInit?: ResponseSnapshotInit | undefined; }
| { readonly streaming: true; readonly status: number; readonly headers: Headers; readonly body: ReadableStream<Uint8Array>; readonly responseInit?: ResponseSnapshotInit | undefined; }

Usage

import { type ResponseSnapshot } from "common/src/index.ts";