/** * canonical-sort-v1 — Deterministic JSON serialisation for commitments. * * Produces a canonical byte string from arbitrary JSON so that the same logical * data always yields the same commitment, regardless of key ordering or number * formatting in the source response. * * Rules (subset of RFC 8785 / JCS): * 1. Object keys sorted by Unicode code point (UTF-16 code unit comparison). * 2. Deep objects: recursively sorted (NOT flattened). * 3. Arrays: order preserved (NOT sorted); elements recursively canonicalised. * 4. Numbers: shortest round-trip representation (`String(n)`); `-0` → `"0"`. * 5. Strings: standard JSON escaping. * 6. No whitespace. */ export type CanonicalOutput = Readonly<{ canonical: string; bytes: Uint8Array; }>; type JsonType = null | boolean | number | string | readonly JsonType[] | Readonly<{ [k: string]: JsonType; }>; /** * Canonicalise an arbitrary JSON value into a deterministic string. */ export declare const canonicalize: (value: JsonType) => string; /** * Canonicalise JSON and return both the string and its UTF-8 bytes. */ export declare const canonicalSort: (value: JsonType) => CanonicalOutput; export {}; //# sourceMappingURL=canonical.d.ts.map