This Streams API interface represents a readable stream of byte data.

interface ReadableStream<R> {
    locked: boolean;
    [asyncIterator](): AsyncIterableIterator<R>;
    cancel(reason?: any): Promise<void>;
    getReader(): ReadableStreamDefaultReader<R>;
    getReader(options: {
        mode: "byob";
    }): ReadableStreamBYOBReader;
    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?: {
        preventCancel?: boolean;
    }): AsyncIterableIterator<R>;
}

Type Parameters

  • R = any

Properties

locked: boolean

Methods

  • Parameters

    • Optionalreason: any

    Returns Promise<void>

  • Parameters

    Returns Promise<void>

  • Parameters

    • Optionaloptions: {
          preventCancel?: boolean;
      }
      • OptionalpreventCancel?: boolean

    Returns AsyncIterableIterator<R>