A class to read chunks from a ReadableStream and provide them in a structured format.

Hierarchy

  • BaseStreamReader<TextStreamInfo>
    • TextStreamReader

Constructors

Properties

Accessors

Methods

Constructors

  • A TextStreamReader instance can be used as an AsyncIterator that returns the entire string that has been received up to the current point in time.

    Parameters

    • info: TextStreamInfo
    • stream: ReadableStream<DataStream_Chunk>
    • OptionaltotalChunkCount: number

    Returns TextStreamReader

Properties

onProgress?: (progress: undefined | number) => void

Type declaration

    • (progress: undefined | number): void
    • Parameters

      • progress: undefined | number

        progress of the stream between 0 and 1. Undefined for streams of unknown size

      Returns void

Accessors

Methods

  • Async iterator implementation to allow usage of for await...of syntax. Yields structured chunks from the stream.

    Returns {
        next: () => Promise<IteratorResult<string, any>>;
        return(): Promise<IteratorResult<string, any>>;
    }

MMNEPVFCICPMFPCPTTAAATR