export declare class Writer { private buf; private view; private pos; constructor(); private reserve; writeBytes(bytes: Uint8Array): void; writeU8(v: number): void; writeU16Le(v: number): void; writeU32Le(v: number): void; writeI32Le(v: number): void; /** * Canonicalize `v` identically to `F32Scalar::new()` / `canonicalize_f32()` * in Rust, then write 4 bytes LE. * * Caller contract: `v` must already be an exact f32-representable value. * Do not feed f64 intermediate results into this method. */ writeF32Le(v: number): void; /** 1 byte: 0x00 = false, 0x01 = true. */ writeBool(v: boolean): void; /** * Write a length-prefixed UTF-8 string (u32 LE length + bytes, no null * terminator). Caller must ensure the string is NFC-normalized before * encoding if cross-platform digest stability is required. */ writeString(v: string): void; /** Presence tag (0x00 = null) + encoded payload when present. */ writeOption(v: T | null, encode: (w: Writer, v: T) => void): void; /** u32 LE element count + each element encoded inline. */ writeList(vs: readonly T[], encode: (w: Writer, v: T) => void): void; finish(): Uint8Array; } export declare class CodecError extends Error { constructor(message: string); } export declare class Reader { private readonly view; private pos; constructor(bytes: Uint8Array); /** Number of bytes left to consume from the underlying buffer. */ remaining(): number; private take; readU8(): number; readU16Le(): number; readU32Le(): number; readI32Le(): number; readF32Le(): number; readBool(): boolean; readString(): string; readOption(decode: (r: Reader) => T): T | null; readList(decode: (r: Reader) => T): T[]; } /** * Canonicalize a number as an f32, matching `canonicalize_f32()` in Rust. * * - NaN (any) → 0x7fc00000 (positive quiet NaN) * - subnormal → +0.0 * - -0.0 → +0.0 * - all other values pass through unchanged * * JavaScript has no f32 type. This function reads the float32 bit pattern * written by `DataView.setFloat32` (which narrows the f64 to the nearest f32), * then applies the canonicalization rules above. */ export declare function canonicalizeF32(v: number): number; //# sourceMappingURL=codec-runtime.d.ts.map