@shazow/whatsabi
    Preparing search index...

    Interface ReadableStream<R>

    The ReadableStream interface of the Streams API 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 = 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>;
    }

    Type Parameters

    • R = any
    Index
    • The cancel() method of the ReadableStream interface returns a Promise that resolves when the stream is canceled.

      MDN Reference

      Parameters

      • Optionalreason: any

      Returns Promise<void>

    • The pipeTo() method of the ReadableStream interface pipes the current ReadableStream to a given WritableStream and returns a Promise that fulfills when the piping process completes successfully, or rejects if any errors were encountered.

      MDN Reference

      Parameters

      Returns Promise<void>

    • The tee() method of the ReadableStream interface tees the current readable stream, returning a two-element array containing the two resulting branches as new ReadableStream instances.

      MDN Reference

      Returns [ReadableStream<R>, ReadableStream<R>]

    locked: boolean

    The locked read-only property of the ReadableStream interface returns whether or not the readable stream is locked to a reader.

    MDN Reference