LiveKit JS Client SDK - v2.15.7
    Preparing search index...

    Class TextStreamReader

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

    Hierarchy

    • BaseStreamReader<TextStreamInfo>
      • TextStreamReader
    Index

    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
      • OptionaloutOfBandFailureRejectingFuture: Future<never>

      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

    signal?: AbortSignal

    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>>;
      }

    • Injects an AbortSignal, which if aborted, will terminate the currently active stream iteration operation.

      Note that when using AbortSignal.timeout(...), the timeout applies across the whole iteration operation, not just one individual chunk read.

      Parameters

      • signal: AbortSignal

      Returns TextStreamReader