Optional Readonlyfp32Opt in to the raw-bytes channel on fp32 / arrayFp32. Off by
default so a value-only consumer pays nothing: when this is not true the
decoder never allocates the per-value little-endian view (which, per fp32
element, roughly quartered array-decode throughput in a microbenchmark). Set
it true only in a bit-exact consumer (transcode / raw-bits oracle) that
needs raw to preserve a signaling NaN.
OptionalarrayStart of an array; count elements of kind follow.
OptionalarrayEnd of an array.
OptionalarrayOptionalarrayOne fp64 array element. value is exact — see fp64.
OptionalarrayOne signed array element. Number-first like signed.
OptionalarrayOne unsigned array element. Number-first like unsigned.
OptionalblobA chunk of a blob field.
Optionalfp32An IEEE-754 32-bit float field. When you set fp32Raw to true,
raw is a zero-copy little-endian view of the exact 4 wire bytes; use it —
not value — when the bytes must round-trip bit-for-bit (§4.6). value is
a JS number (a 64-bit double), and widening a signaling NaN into a
double quiets it (sets the is-quiet bit), so value cannot represent an
fp32 sNaN faithfully. The view aliases the decoder's working buffer and is
valid only for the duration of the call — copy it if you retain it, exactly
as with a string/blob chunk. Without fp32Raw, raw is undefined
(no allocation). fp64 needs no such channel: a double holds all 64 bits
verbatim (see fp64).
Optionalraw: Uint8Array<ArrayBufferLike>Optionalfp64An IEEE-754 64-bit double field. value is exact — a double is 64 bits wide.
OptionalsequenceStart of a nested sequence. Return a Visitor to route the nested fields to it (its Visitor.sequenceEnd fires at the matching end); return nothing to keep using the current visitor.
OptionalsequenceEnd of the nested sequence this visitor was handling.
OptionalsignedA signed integer field. Number-first like unsigned (|value| ≤ 2^53-1 ⇒ number).
OptionalstringA chunk of a UTF-8 string field.
OptionalunsignedAn unsigned integer field. Number-first: value is a number when it fits
exactly (≤ 2^53-1, covering ids, u8..u32 and small u64s) and a bigint
only beyond that, so the common case avoids a per-value bigint allocation.
Receives decoded fields from an IStream. Every method is optional and defaults to a no-op, so a visitor implements only the fields it cares about and silently skips the rest.
String and blob payloads arrive as one or more
chunks, each tagged with the field'stotallength and theoffsetof the chunk within the field, so a large payload never has to be held in one piece. Array elements arrive one at a time between Visitor.arrayBegin and Visitor.arrayEnd.