Interface ReadableStream<R>

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.

MDN Reference

interface ReadableStream<R> {
    locked: boolean;
    [asyncIterator](options?): AsyncIterableIterator<R>;
    cancel(reason?): Promise<void>;
    getReader(): ReadableStreamDefaultReader<R>;
    getReader(options): ReadableStreamBYOBReader;
    pipeThrough<T>(transform, options?): ReadableStream<T>;
    pipeTo(destination, options?): Promise<void>;
    tee(): [ReadableStream<R>, ReadableStream<R>];
    values(options?): AsyncIterableIterator<R>;
}

Type Parameters

  • R = any

Properties

locked: boolean

Methods

  • Parameters

    Returns AsyncIterableIterator<R>

  • Parameters

    • Optional reason: any

    Returns Promise<void>

  • Parameters

    Returns AsyncIterableIterator<R>