/** * JCS-like canonical JSON encoder for the mesh membership protocol. * * **Spec**: plan/24-mesh-membership.md — "chaves ordenadas alfabeticamente + * separadores `,` e `:` sem espaços. Mesma regra em Dart, Rust, TypeScript." * * **Bit-compatibility contract** (must hold across the 3 implementations): * - Object keys sorted lexicographically by UTF-16 code unit order * (matches Dart's String compareTo, Rust's BTreeMap, and * JS's Array.prototype.sort() default). * - No whitespace between any tokens. * - Arrays preserve insertion order (caller's responsibility to sort if * determinism across producers matters — verifier doesn't enforce). * - Numbers serialized via JSON.stringify default (no trailing zeros). * Mesh schema only carries integers (`version`, `issued_at`), so the * fragile float-formatting space is avoided by design. * - Strings UTF-8 encoded, JSON-escape rules per RFC 8259 (control chars * and `\\`, `"` escaped; raw UTF-8 for printable code points). Matches * `dart:convert.jsonEncode` and `serde_json::to_string` defaults. * - `null` preserved; `undefined`/functions/symbols dropped (mirrors * JSON.stringify). * * Verification path: receiver canonicalizes nothing — it verifies the * raw blob bytes as-received against the signature. This module is used * only on the *sender* side, and on the *test* side to construct fixtures * for `verify.test.ts`. */ export declare function canonicalize(value: unknown): string; /** Canonical JSON string as UTF-8 bytes. The exact bytes that get signed. */ export declare function canonicalBytes(value: unknown): Uint8Array;