Skip to content

DecodeStream

Defined in: packages/format-core/src/decode-stream.ts:43

Chunks in, decoded values out — a Decoder driven by a DecodeDriver and exposed as a TransformStream, for any incremental, non-live source (a Node Readable, a Web ReadableStream, a file being read in chunks).

Unlike net-core’s FrameLink, there is no transport to pause: backpressure comes from the Web Streams queue itself. A decoder that returns pending is supported — a TransformStreamDefaultController stays valid after transform() returns, so enqueueing from the setTimeout callback below is legal — and on flush(), DecodeDriver.close() resolves any outstanding pending immediately rather than waiting out the full silence window.

  • TransformStream<Chunk, T>

T

View = Uint8Array

Chunk = View

W = never

new DecodeStream<T, View, Chunk, W>(decoder, options): DecodeStream<T, View, Chunk, W>

Defined in: packages/format-core/src/decode-stream.ts:49

Decoder<T, View, W>

DecodeStreamOptions<T, View, Chunk, W>

DecodeStream<T, View, Chunk, W>

TransformStream<Chunk, T>.constructor

readonly readable: ReadableStream<T>

Defined in: node_modules/.store/@types-web-npm-0.0.361-9908d15a9c/package/index.d.ts:37861

The readable read-only property of the TransformStream interface returns the ReadableStream instance controlled by this TransformStream. This stream emits the transformed output data.

MDN Reference

TransformStream.readable


readonly writable: WritableStream<Chunk>

Defined in: node_modules/.store/@types-web-npm-0.0.361-9908d15a9c/package/index.d.ts:37867

The writable read-only property of the TransformStream interface returns the WritableStream instance controlled by this TransformStream. This stream accepts input data that will be transformed and emitted to the readable stream.

MDN Reference

TransformStream.writable