Skip to content

DecodeStreamOptions

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

Options for DecodeStream.

T

View

Chunk = View

W = never

readonly buffer: DecodeBuffer<View, Chunk>

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

Accumulates undecoded input between transform() calls.

Supplied rather than constructed here because the buffer is what pins the view type: ByteAccumulator for a byte decoder, TextBuffer for a text one, ChunkListBuffer for a cursor one. Each carries its own mandatory retention ceiling, which is the constraint net-core’s FrameLink documents.


readonly optional onError?: (error) => void

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

Called for a recoverable violation instead of ending the stream. Web Streams have no non-fatal error channel, so recovery is a policy the caller supplies. Omit it and the first recoverable error ends the stream.

unknown

void


readonly optional onWarnings?: (warnings, value) => void

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

Called alongside a decoded value that carries best-effort diagnostics.

readonly W[]

T

void