deno / 1.23.2 / ~ / readablestream.html /

ReadableStream

This Streams API interface represents a readable stream of byte data. The Fetch API offers a concrete instance of a ReadableStream through the body property of a Response object.

interface ReadableStream <R = any> {
readonly locked : boolean;
[[Symbol.asyncIterator]]( options?: {
preventCancel?: boolean;
}
) : AsyncIterableIterator<R>;
cancel( reason?: any) : Promise<void>;
getReader( options: {
mode: "byob";
}
) : ReadableStreamBYOBReader;
getReader( options?: {
mode?: undefined;
}
) : ReadableStreamDefaultReader<R>;
pipeThrough <T>( { writable, readable }: {
writable: WritableStream<R>;
readable: ReadableStream<T>;
}
, options?: PipeOptions) : ReadableStream<T>;
pipeTo( dest: WritableStream<R> , options?: PipeOptions) : Promise<void>;
tee() : [ReadableStream<R>, ReadableStream<R>];
}
var ReadableStream : {
prototype: ReadableStream;
new (underlyingSource: UnderlyingByteSource, strategy?: {
highWaterMark?: number;
size?: undefined;
}
): ReadableStream<Uint8Array>;
new <R = any>(underlyingSource?: UnderlyingSource<R>, strategy?: QueuingStrategy<R>): ReadableStream<R>;
}
;

Type Parameters

R = any

Properties

readonly locked : boolean

Methods

[[Symbol.asyncIterator]]( options?: {
preventCancel?: boolean;
}
) : AsyncIterableIterator<R>
cancel( reason?: any) : Promise<void>
getReader( options: {
mode: "byob";
}
) : ReadableStreamBYOBReader
getReader( options?: {
mode?: undefined;
}
) : ReadableStreamDefaultReader<R>
pipeThrough <T>( { writable, readable }: {
writable: WritableStream<R>;
readable: ReadableStream<T>;
}
, options?: PipeOptions) : ReadableStream<T>
pipeTo( dest: WritableStream<R> , options?: PipeOptions) : Promise<void>
tee() : [ReadableStream<R>, ReadableStream<R>]

© 2018–2022 the Deno authors
https://doc.deno.land/deno/stable/~/ReadableStream