1 | import { ForAwaitable } from './iter.js';
|
2 | export declare type StreamBodyInit = ForAwaitable<string> | ReadableStream<string>;
|
3 | export declare type ByteStreamBodyInit = ForAwaitable<Uint8Array> | ReadableStream<Uint8Array>;
|
4 | export declare class StreamResponse extends Response {
|
5 | constructor(body?: StreamBodyInit | null, init?: ResponseInit);
|
6 | }
|
7 | export declare class ByteStreamResponse extends Response {
|
8 | constructor(body?: ByteStreamBodyInit | null, init?: ResponseInit);
|
9 | }
|
10 | /**
|
11 | * If for any reason you don't want to use streaming response bodies,
|
12 | * you can use this class instead, which will buffer the entire body before releasing it to the network.
|
13 | * Note that headers will still be sent immediately.
|
14 | */
|
15 | export declare class BufferedStreamResponse extends Response {
|
16 | constructor(body?: StreamBodyInit | null, init?: ResponseInit);
|
17 | }
|
18 | export declare class BufferedByteStreamResponse extends Response {
|
19 | constructor(body?: ByteStreamBodyInit | null, init?: ResponseInit);
|
20 | }
|
21 | export { BufferedStreamResponse as BufferedResponse };
|
22 | export declare type StreamRequestInit = Omit<RequestInit, 'body'> & {
|
23 | body?: StreamBodyInit;
|
24 | };
|
25 | export declare type ByteStreamRequestInit = Omit<RequestInit, 'body'> & {
|
26 | body?: ByteStreamBodyInit;
|
27 | };
|
28 | export declare class StreamRequest extends Request {
|
29 | constructor(input: RequestInfo, init?: StreamRequestInit);
|
30 | }
|
31 | export declare class ByteStreamRequest extends Request {
|
32 | constructor(input: RequestInfo, init?: ByteStreamRequestInit);
|
33 | }
|