/** * Decode-side byte I/O: a bounds-checked `Reader`, the interning-table read (`decodeStringTable`), the * `FieldDecoder` the decode walker builds on, and the JsonValue decoder. This half runs in tooling * (never on a user's page), so it favors clarity; it must never be reachable from the encode entry — * hence the physical split. Each primitive is the exact inverse of its `field-encoder.ts` peer; the * round-trip corpus is what proves it. * * (`FieldDecoder` was named `Decoder` before the encode/decode split.) */ import type { RelMs, DurationMs } from '../time.js'; import type { JsonValue } from '../json.js'; /** Cursor over a byte buffer. Every read is bounds-checked so a truncated/corrupt file fails loudly. */ export declare class Reader { private readonly buf; private readonly view; pos: number; constructor(buf: Uint8Array); get atEnd(): boolean; private need; u8(): number; varuint(): number; zigzag(): number; f64(): number; bytes(n: number): Uint8Array; } /** * Read the interned string table (the mirror of `StringTable.encode`). A free function, not a static on * `StringTable`, so pulling in the decoder never drags the interning-build `Map`/`intern` code along. */ export declare function decodeStringTable(r: Reader): string[]; export declare const fromTicks: (us: number) => number; /** FieldDecoder = a `Reader` plus the already-decoded string table. The mirror of `FieldEncoder`, * including the v3 tick rules: every tick was divided by the body's `scale` prelude, and R values are * zigzag deltas chained per decoder scope (a section, a manifest-record tail, a columnar column). */ export declare class FieldDecoder { readonly r: Reader; readonly strings: readonly string[]; /** µs-tick multiplier (the body prelude). unpack() sets it on every section decoder. */ scale: number; /** Chain state: the previous R tick decoded in THIS decoder's scope. */ private lastTick; constructor(r: Reader, strings: readonly string[]); u8(): number; varuint(): number; zigzag(): number; f64(): number; /** A page-timeline point (RelMs): scaled tick delta accumulated onto the scope's chain. */ rel(): RelMs; /** A duration (DurationMs): scaled ticks, absolute (not chained). */ dur(): DurationMs; /** A non-negative µs tick delta (the columnar profile-slice start column), unscaled back to µs. */ tickDelta(): number; /** Swap the R-chain state (columnar columns are independent delta sequences); returns the previous * tick for restoring the enclosing scope. Mirror of FieldEncoder.chainSwap. */ chainSwap(tick?: number): number; /** A standalone decoder over length-prefixed tail bytes, inheriting table + scale with a fresh * chain scope. Mirror of FieldEncoder.sub. */ sub(bytes: Uint8Array): FieldDecoder; bool(): boolean; str(): string; strArray(): string[]; presence(n: number): boolean[]; } /** * `JsonValue` decoder — the mirror of `encodeJson`. The 1-byte tag keeps `null` distinct from an absent * field and preserves object/array/scalar shape exactly. */ export declare function decodeJson(d: FieldDecoder): JsonValue; //# sourceMappingURL=field-decoder.d.ts.map