UNPKG

650 BTypeScriptView Raw
1import { StreamResponse, StreamRequest } from "@worker-tools/stream-response";
2export declare type JSONStreamBodyInit = ReadableStream<string> | AsyncIterable<string> | any;
3export declare type JSONStreamRequestInit = Omit<RequestInit, 'body'> & {
4 body?: JSONStreamBodyInit;
5};
6export declare class JSONStreamRequest extends StreamRequest {
7 static contentType: string;
8 static accept: string;
9 constructor(input: RequestInfo | URL, init?: JSONStreamRequestInit);
10}
11export declare class JSONStreamResponse extends StreamResponse {
12 static contentType: string;
13 constructor(body?: JSONStreamBodyInit | null, init?: ResponseInit);
14}