Interface ReadableStream<R>
interface ReadableStream<R = any> {
locked: boolean;
"[asyncIterator]"(
options?: ReadableStreamIteratorOptions,
): ReadableStreamAsyncIterator<R>;
cancel(reason?: any): Promise<void>;
getReader(options: { mode: "byob" }): ReadableStreamBYOBReader;
getReader(): ReadableStreamDefaultReader<R>;
getReader(
options?: ReadableStreamGetReaderOptions,
): ReadableStreamReader<R>;
pipeThrough<T>(
transform: ReadableWritablePair<T, R>,
options?: StreamPipeOptions,
): ReadableStream<T>;
pipeTo(
destination: WritableStream<R>,
options?: StreamPipeOptions,
): Promise<void>;
tee(): [ReadableStream<R>, ReadableStream<R>];
values(
options?: ReadableStreamIteratorOptions,
): ReadableStreamAsyncIterator<R>;
}
locked: boolean;
"[asyncIterator]"(
options?: ReadableStreamIteratorOptions,
): ReadableStreamAsyncIterator<R>;
cancel(reason?: any): Promise<void>;
getReader(options: { mode: "byob" }): ReadableStreamBYOBReader;
getReader(): ReadableStreamDefaultReader<R>;
getReader(
options?: ReadableStreamGetReaderOptions,
): ReadableStreamReader<R>;
pipeThrough<T>(
transform: ReadableWritablePair<T, R>,
options?: StreamPipeOptions,
): ReadableStream<T>;
pipeTo(
destination: WritableStream<R>,
options?: StreamPipeOptions,
): Promise<void>;
tee(): [ReadableStream<R>, ReadableStream<R>];
values(
options?: ReadableStreamIteratorOptions,
): ReadableStreamAsyncIterator<R>;
}
Type Parameters
Index
Properties
Methods
Methods
[asyncIterator]
- "[asyncIterator]"(
options?: ReadableStreamIteratorOptions,
): ReadableStreamAsyncIterator<R> Parameters
Optional
options: ReadableStreamIteratorOptions
Returns ReadableStreamAsyncIterator<R>
cancel
getReader
- getReader(options: { mode: "byob" }): ReadableStreamBYOBReader
Parameters
- options: { mode: "byob" }
Returns ReadableStreamBYOBReader
- getReader(): ReadableStreamDefaultReader<R>
Returns ReadableStreamDefaultReader<R>
- getReader(options?: ReadableStreamGetReaderOptions): ReadableStreamReader<R>
Parameters
Optional
options: ReadableStreamGetReaderOptions
Returns ReadableStreamReader<R>
pipeThrough
- pipeThrough<T>(
transform: ReadableWritablePair<T, R>,
options?: StreamPipeOptions,
): ReadableStream<T> Type Parameters
Parameters
- transform: ReadableWritablePair<T, R>
Optional
options: StreamPipeOptions
Returns ReadableStream<T>
pipeTo
- pipeTo(
destination: WritableStream<R>,
options?: StreamPipeOptions,
): Promise<void> Parameters
- destination: WritableStream<R>
Optional
options: StreamPipeOptions
Returns Promise<void>
tee
- tee(): [ReadableStream<R>, ReadableStream<R>]
Returns [ReadableStream<R>, ReadableStream<R>]
values
- values(options?: ReadableStreamIteratorOptions): ReadableStreamAsyncIterator<R>
Parameters
Optional
options: ReadableStreamIteratorOptions
Returns ReadableStreamAsyncIterator<R>
MDN Reference