/** * Capsule declaration wrapping the CanonicalCbor decoder as a `pureTransform`. * The decoder is the strict inverse of `canonicalCborCapsule`'s encoder over * the encoder's NORMALIZED domain — registering it here lets the factory * compiler audit the round-trip reader alongside the encoder. * * @module */ import { Schema } from 'effect'; /** * Normalize a value into the encoder's image: the encoder coerces top-level * `undefined` to `null`, drops object properties whose value is `undefined`, * and recurses through arrays/objects. Round-trip equality therefore holds * over `normalize(x)`, never raw `x` (which may carry `undefined`). */ declare function normalize(value: unknown): unknown; /** Structural deep-equality over the decoder's output domain. */ declare function deepEquals(a: unknown, b: unknown): boolean; /** * Branded input schema for the decoder: NOT "any `Uint8Array`" but the narrow * domain "canonical CBOR bytes". Structurally it is still a `Uint8Array` * (parsing / encoding are unchanged), but it carries an explicit harness * arbitrary that samples a value with `fc.anything()` and runs it through the * canonical encoder — so every generated sample is, by construction, valid * canonical CBOR the decoder accepts. * * This is the source-of-truth fix for the decoder's domain: the previous * `Schema.instanceOf(Uint8Array)` UNDER-SPECIFIED it (random bytes are * `Uint8Array`-conformant but not decodable), which forced the harness onto a * precondition-mismatch skip. `CanonicalCborBytes` states the real domain, and * `decode` is then exercised over exactly the inputs it is the inverse of — * the round-trip invariant (`encode(decode(bytes)) === bytes`) holds because * the canonical encoder is idempotent under `decode`. */ export declare const CanonicalCborBytes: Schema.Schema; /** * Declared capsule for the CanonicalCbor decoder. Registered in the * module-level catalog at import time; walked by the factory compiler. */ export declare const canonicalCborDecodeCapsule: import("../assembly.js").CapsuleDef<"pureTransform", Uint8Array, unknown, unknown>; /** * Internal helpers exported for the round-trip property test (the invariant * over the encoder's normalized domain): `decode(encode(x))` deep-equals * `normalize(x)`. */ export declare const _canonicalCborDecodeInternals: { readonly normalize: typeof normalize; readonly deepEquals: typeof deepEquals; }; export {}; //# sourceMappingURL=canonical-cbor-decode.d.ts.map