[{"name":"Cbor","comment":" CBOR (Concise Binary Object Representation) data model and diagnostic notation.\n\nThis module defines `CborItem`, a lossless representation of any well-formed\nCBOR encoding per [RFC 8949](https://datatracker.ietf.org/doc/html/rfc8949).\n\n@docs CborItem, IntWidth, FloatWidth, SimpleWidth, Length, Sign, Tag, tagToInt, intToTag\n@docs Error, DecodeError\n@docs diagnose\n\n","unions":[{"name":"CborItem","comment":" A lossless representation of a CBOR data item.\n\nRound-tripping (decode → re-encode) preserves the exact original bytes.\nEncoding details (integer width, float precision, definite vs indefinite\nlength) are captured for faithful diagnostic output.\n\nThe primary user-facing API is the combinator layer in `Cbor.Encode` and\n`Cbor.Decode`. Use `CborItem` as an escape hatch for generic CBOR handling,\ndiagnostics, and protocol debugging.\n\n","args":[],"cases":[["CborInt52",["Cbor.IntWidth","Basics.Int"]],["CborInt64",["Cbor.Sign","Bytes.Bytes"]],["CborByteString",["Bytes.Bytes"]],["CborByteStringChunked",["List.List Bytes.Bytes"]],["CborString",["String.String"]],["CborStringChunked",["List.List String.String"]],["CborArray",["Cbor.Length","List.List Cbor.CborItem"]],["CborMap",["Cbor.Length","List.List { key : Cbor.CborItem, value : Cbor.CborItem }"]],["CborTag",["Cbor.Tag","Cbor.CborItem"]],["CborBool",["Basics.Bool"]],["CborFloat",["Cbor.FloatWidth","Basics.Float"]],["CborNull",[]],["CborUndefined",[]],["CborSimple",["Cbor.SimpleWidth","Basics.Int"]]]},{"name":"DecodeError","comment":" CBOR-specific decoding error.\n","args":[],"cases":[["WrongMajorType",["{ expected : Basics.Int, got : Basics.Int }"]],["WrongInitialByte",["{ got : Basics.Int }"]],["WrongTag",["{ expected : Basics.Int, got : Basics.Int }"]],["ReservedAdditionalInfo",["Basics.Int"]],["IntegerOverflow",[]],["MissingKey",["String.String"]],["KeyMismatch",["{ expected : String.String, got : String.String }"]],["TooFewElements",["Maybe.Maybe { expected : Basics.Int, got : Basics.Int }"]],["TooManyElements",["Maybe.Maybe { expected : Basics.Int, got : Basics.Int }"]],["FailedToFinalizeRecord",[]],["NonConsumingDecoder",["String.String"]],["UnknownMajorType",["Basics.Int"]]]},{"name":"Error","comment":" Structured error returned by `Cbor.Decode.decode`.\n\n  - `InContext` — a nested error with a context label and byte offset.\n  - `OutOfBounds` — the decoder ran past the end of the input.\n  - `DecodingError` — a CBOR-specific error at a byte offset.\n  - `BadOneOf` — all branches of a `oneOf` failed.\n\n","args":["context"],"cases":[["InContext",["{ label : context, start : Basics.Int }","Cbor.Error context"]],["OutOfBounds",["{ at : Basics.Int, bytes : Basics.Int }"]],["DecodingError",["{ at : Basics.Int }","Cbor.DecodeError"]],["BadOneOf",["{ at : Basics.Int }","List.List (Cbor.Error context)"]]]},{"name":"FloatWidth","comment":" How a float was encoded on the wire.\n\n  - `FW16` — IEEE 754 half-precision (2 bytes)\n  - `FW32` — IEEE 754 single-precision (4 bytes)\n  - `FW64` — IEEE 754 double-precision (8 bytes)\n\n","args":[],"cases":[["FW16",[]],["FW32",[]],["FW64",[]]]},{"name":"IntWidth","comment":" How an integer value was encoded on the wire.\n\n  - `IW0` — inline in the additional info (values 0–23, 0 extra bytes)\n  - `IW8` — 1-byte uint8 argument\n  - `IW16` — 2-byte uint16 argument\n  - `IW32` — 4-byte uint32 argument\n  - `IW64` — 8-byte uint64 argument\n\n","args":[],"cases":[["IW0",[]],["IW8",[]],["IW16",[]],["IW32",[]],["IW64",[]]]},{"name":"Length","comment":" Whether an array or map used definite or indefinite length encoding.\n","args":[],"cases":[["Definite",[]],["Indefinite",[]]]},{"name":"Sign","comment":" The sign of a CBOR integer, corresponding to the major type.\n\n  - `Positive` — CBOR major type 0 (unsigned integer)\n  - `Negative` — CBOR major type 1 (negative integer, value = −1 − argument)\n\n","args":[],"cases":[["Positive",[]],["Negative",[]]]},{"name":"SimpleWidth","comment":" How a simple value was encoded on the wire.\n\n  - `SW0` — inline in the additional info (values 0–19, 0 extra bytes)\n  - `SW8` — 1-byte argument (values 32–255)\n\n","args":[],"cases":[["SW0",[]],["SW8",[]]]},{"name":"Tag","comment":" CBOR semantic tags from the IANA registry.\n\nNamed variants for well-known tags. `Unknown Int` as the catch-all for\nunrecognized tag numbers.\n\n","args":[],"cases":[["StandardDateTime",[]],["EpochDateTime",[]],["PositiveBigNum",[]],["NegativeBigNum",[]],["DecimalFraction",[]],["BigFloat",[]],["Base64UrlConversion",[]],["Base64Conversion",[]],["Base16Conversion",[]],["Cbor",[]],["Uri",[]],["Base64Url",[]],["Base64",[]],["Regex",[]],["Mime",[]],["IsCbor",[]],["Unknown",["Basics.Int"]]]}],"aliases":[],"values":[{"name":"diagnose","comment":" Produce CBOR diagnostic notation (RFC 8949 Section 8) for a CborItem.\n\nEncoding indicators are appended as suffixes (e.g., `1_0`, `1.5_1`).\nIndefinite-length containers use the `[_ ...]` and `{_ ...}` notation.\n\n","type":"Cbor.CborItem -> String.String"},{"name":"intToTag","comment":" Convert an integer to its `Tag` representation.\n\nReturns the named variant for well-known tag numbers, `Unknown n` otherwise.\n\n","type":"Basics.Int -> Cbor.Tag"},{"name":"tagToInt","comment":" Convert a tag to its IANA-registered integer number.\n","type":"Cbor.Tag -> Basics.Int"}],"binops":[]},{"name":"Cbor.Decode","comment":" CBOR decoding combinators.\n\nBuild decoders for your domain types. These produce `CborDecoder` values.\nRun them with `decode`.\n\n    import Cbor.Decode as CD\n\n    type alias Person =\n        { name : String, age : Int }\n\n    decodePerson : CD.CborDecoder ctx Person\n    decodePerson =\n        CD.keyedRecord CD.int String.fromInt Person\n            |> CD.required 0 CD.string\n            |> CD.required 1 CD.int\n            |> CD.buildKeyedRecord CD.IgnoreExtra\n\n    -- To run: CD.decode decodePerson someBytes\n\n**Note:** These decoders operate on a complete `Bytes` value. They cannot\nincrementally decode a stream of chunks as they arrive. If you are receiving\nCBOR data in multiple chunks (e.g. from a network stream), you must first\nconcatenate all chunks into a single `Bytes` value before calling `decode`.\nIf incremental / streaming decoding becomes necessary, it can be added in a\nfuture release.\n\n\n## Type\n\n@docs CborDecoder, decode\n\n\n## Errors\n\n@docs errorToString\n\n\n## Combinators\n\n@docs succeed, fail\n@docs map, map2, map3, map4, map5, andThen, oneOf, keep, ignore, lazy, inContext\n\n\n## Primitives\n\n@docs int, bigInt, float, bool, null, undefined, maybe, simple, string, bytes\n\n\n## Collections\n\n@docs array, associativeList, dict, field, foldEntries, tag, tagged\n\n\n## Record Builder (CBOR arrays → Elm values)\n\n@docs RecordBuilder, record, element, optionalElement, ExtraElements, buildRecord\n\n\n## Keyed Record Builder (CBOR maps → Elm values)\n\n@docs KeyedRecordBuilder, keyedRecord, required, optional, buildKeyedRecord\n\n\n## Unordered Record Builder (CBOR maps → Elm values, any key order)\n\n@docs UnorderedRecordBuilder, unorderedRecord, onKey, buildUnorderedRecord\n\n\n## Structure Headers\n\n@docs arrayHeader, mapHeader, break, untilBreak\n\n\n## Escape Hatch\n\n@docs item, itemSkip, rawBytes\n\n","unions":[{"name":"CborDecoder","comment":" Opaque CBOR decoder.\n\nInternally uses two variants: `Item` receives a pre-read initial byte\n(the CBOR byte encoding major type + additional info), and `Pure` consumes\nno initial byte (used only by `succeed` and `fail`). This split lets\ncombinators route the initial byte to the first decoder that needs it,\nand lets collection decoders detect indefinite-length break bytes on\nthe fast path without `BD.oneOf`.\n\n","args":["ctx","a"],"cases":[]},{"name":"ExtraElements","comment":" What to do when the CBOR array has more elements than the builder expects.\n\n  - `IgnoreExtra` — silently skip trailing elements (forward-compatible).\n  - `FailOnExtra` — fail with `TooManyElements` (strict validation).\n\n","args":[],"cases":[["IgnoreExtra",[]],["FailOnExtra",[]]]},{"name":"KeyedRecordBuilder","comment":" Opaque builder for decoding CBOR maps into Elm values.\n","args":["ctx","k","a"],"cases":[]},{"name":"RecordBuilder","comment":" Opaque builder for decoding CBOR arrays into Elm values.\n\nUses `SimpleBuilder` when all fields are `element` (fast path via `keep`),\nor `CountedBuilder` when `optionalElement` is used (counts remaining items).\n\n","args":["ctx","a"],"cases":[]},{"name":"UnorderedRecordBuilder","comment":" Builder for decoding CBOR maps into records regardless of key order.\n\nUnlike `KeyedRecordBuilder` which requires keys in the declared order,\nthis builder uses a `Dict` to dispatch on each key. Unknown keys are\nhandled according to the `ExtraElements` policy.\n\nThe trade-off: the caller must define an accumulator type and a finalize\nfunction, since the constructor-threading pattern requires ordered application.\n\n","args":["ctx","comparable","acc"],"cases":[]}],"aliases":[],"values":[{"name":"andThen","comment":" Chain decoders. The continuation is chosen based on the first result.\n","type":"(a -> Cbor.Decode.CborDecoder ctx b) -> Cbor.Decode.CborDecoder ctx a -> Cbor.Decode.CborDecoder ctx b"},{"name":"array","comment":" Decode a CBOR array (major type 4) where all elements use the same decoder.\n\nHandles both definite and indefinite-length arrays. The element decoder\nmust be an `Item` (i.e. consume bytes); using `succeed` or `fail` directly\nas an element decoder will produce a `NonConsumingDecoder` error.\n\n","type":"Cbor.Decode.CborDecoder ctx a -> Cbor.Decode.CborDecoder ctx (List.List a)"},{"name":"arrayHeader","comment":" Decode a CBOR array header, returning the count or `Nothing` for\nindefinite-length.\n","type":"Cbor.Decode.CborDecoder ctx (Maybe.Maybe Basics.Int)"},{"name":"associativeList","comment":" Decode a CBOR map (major type 5) as a list of key-value pairs.\n\nHandles both definite and indefinite-length maps.\n\n","type":"Cbor.Decode.CborDecoder ctx k -> Cbor.Decode.CborDecoder ctx v -> Cbor.Decode.CborDecoder ctx (List.List ( k, v ))"},{"name":"bigInt","comment":" Decode any CBOR integer, including bignums (tags 2 and 3).\n\nReturns `( Sign, Bytes )` where `Bytes` is the minimal big-endian\nrepresentation of the unsigned argument.\n\n","type":"Cbor.Decode.CborDecoder ctx ( Cbor.Sign, Bytes.Bytes )"},{"name":"bool","comment":" Decode a CBOR boolean (0xF4 for false, 0xF5 for true).\n","type":"Cbor.Decode.CborDecoder ctx Basics.Bool"},{"name":"break","comment":" Consume a break byte (0xFF).\n\nUse this after decoding a known number of elements from an\nindefinite-length container.\n\n","type":"Cbor.Decode.CborDecoder ctx ()"},{"name":"buildKeyedRecord","comment":" Finalize a keyed record builder into a decoder.\n\nReads the map header, runs the builder pipeline, and verifies all\nentries were consumed.\n\n","type":"Cbor.Decode.ExtraElements -> Cbor.Decode.KeyedRecordBuilder ctx k a -> Cbor.Decode.CborDecoder ctx a"},{"name":"buildRecord","comment":" Finalize a record builder into a decoder.\n\nReads the array header, runs the builder pipeline, and handles any\nextra elements according to the `ExtraElements` strategy.\n\n","type":"Cbor.Decode.ExtraElements -> Cbor.Decode.RecordBuilder ctx a -> Cbor.Decode.CborDecoder ctx a"},{"name":"buildUnorderedRecord","comment":" Finalize an unordered record builder into a decoder.\n\nReads the map header, scans all entries dispatching to registered handlers,\nthen calls the finalize function. If finalize returns `Nothing`, decoding\nfails with `TooFewElements`.\n\n**Note:** uses O(N) stack depth where N is the number of map entries.\nSafe for typical CBOR maps (up to a few hundred entries).\n\n","type":"Cbor.Decode.ExtraElements -> (acc -> Maybe.Maybe a) -> Cbor.Decode.UnorderedRecordBuilder ctx comparable acc -> Cbor.Decode.CborDecoder ctx a"},{"name":"bytes","comment":" Decode a CBOR byte string (major type 2).\n\nConcatenates indefinite-length chunks transparently.\n\n","type":"Cbor.Decode.CborDecoder ctx Bytes.Bytes"},{"name":"decode","comment":" Run a `CborDecoder` on some `Bytes`.\n","type":"Cbor.Decode.CborDecoder ctx a -> Bytes.Bytes -> Result.Result (Cbor.Error ctx) a"},{"name":"dict","comment":" Decode a CBOR map (major type 5) into a `Dict`.\n\nThe key decoder must produce `comparable` values.\n\n","type":"Cbor.Decode.CborDecoder ctx comparable -> Cbor.Decode.CborDecoder ctx v -> Cbor.Decode.CborDecoder ctx (Dict.Dict comparable v)"},{"name":"element","comment":" Decode one array element, applying it to the constructor.\n","type":"Cbor.Decode.CborDecoder ctx v -> Cbor.Decode.RecordBuilder ctx (v -> a) -> Cbor.Decode.RecordBuilder ctx a"},{"name":"errorToString","comment":" Convert an `Error` to a human-readable string.\n\nProvide a function to display context labels. If your decoder does not use\n`inContext`, you can pass `always \"\"`.\n\n","type":"(context -> String.String) -> Cbor.Error context -> String.String"},{"name":"fail","comment":" A decoder that always fails with the given error.\n","type":"Cbor.DecodeError -> Cbor.Decode.CborDecoder ctx a"},{"name":"field","comment":" Decode the next map entry, expecting a specific key.\n\nReads the key, compares via `==`, then decodes the value on match.\nFails on mismatch.\n\n","type":"k -> (k -> String.String) -> Cbor.Decode.CborDecoder ctx k -> Cbor.Decode.CborDecoder ctx v -> Cbor.Decode.CborDecoder ctx v"},{"name":"float","comment":" Decode a CBOR float (major type 7, additional info 25/26/27).\n","type":"Cbor.Decode.CborDecoder ctx Basics.Float"},{"name":"foldEntries","comment":" Fold over map entries with a handler for each key.\n\nReads the map header, then loops through entries. For each entry: decode\nthe key, call the handler with the key and current accumulator. The handler\ndecodes the value and returns the updated accumulator.\n\n**Important**: the handler MUST decode exactly one value per call.\n\n    handler key acc =\n        case key of\n            0 ->\n                map (\\name -> { acc | name = name }) string\n\n            1 ->\n                map (\\age -> { acc | age = age }) int\n\n            _ ->\n                map (\\_ -> acc) itemSkip\n\n","type":"Cbor.Decode.CborDecoder ctx k -> (k -> acc -> Cbor.Decode.CborDecoder ctx acc) -> acc -> Cbor.Decode.CborDecoder ctx acc"},{"name":"ignore","comment":" Decode and discard a value, keeping the previous result.\n","type":"Cbor.Decode.CborDecoder ctx ignored -> Cbor.Decode.CborDecoder ctx keep -> Cbor.Decode.CborDecoder ctx keep"},{"name":"inContext","comment":" Add context to a decoder for better error messages.\n\nIf the decoder fails, the error will be wrapped with the given label and\nthe byte offset where decoding started.\n\n    decodePerson : CD.CborDecoder String Person\n    decodePerson =\n        CD.inContext \"Person\"\n            (CD.keyedRecord CD.int String.fromInt Person\n                |> CD.required 0 (CD.inContext \"name\" CD.string)\n                |> CD.required 1 (CD.inContext \"age\" CD.int)\n                |> CD.buildKeyedRecord CD.IgnoreExtra\n            )\n\n","type":"ctx -> Cbor.Decode.CborDecoder ctx a -> Cbor.Decode.CborDecoder ctx a"},{"name":"int","comment":" Decode a CBOR integer (major types 0 and 1).\n\nFails if the absolute value exceeds 2^52. For larger values, use `bigInt`.\n\n","type":"Cbor.Decode.CborDecoder ctx Basics.Int"},{"name":"item","comment":" Decode any well-formed CBOR data item into a `CborItem`.\n\nThis is the full CBOR parser. Handles all major types, nested structures,\ntags, indefinite-length containers, etc.\n\nIf you need the raw `Bytes` for an item, decoding with `item` then\nre-encoding with `Cbor.Encode.item` is fast enough in practice\n(on par or faster than a dedicated byte-slicing decoder).\n\n","type":"Cbor.Decode.CborDecoder ctx Cbor.CborItem"},{"name":"itemSkip","comment":" Skip any well-formed CBOR data item without allocating anything.\n\nThis is the fastest way to move past a CBOR item. Uses `BD.skipBytes`\nthroughout, staying entirely in the fast lane.\n\n","type":"Cbor.Decode.CborDecoder ctx ()"},{"name":"keep","comment":" Apply a decoder producing a function to a decoder producing an argument.\n\n    succeed Point\n        |> keep float\n        |> keep float\n\n","type":"Cbor.Decode.CborDecoder ctx a -> Cbor.Decode.CborDecoder ctx (a -> b) -> Cbor.Decode.CborDecoder ctx b"},{"name":"keyedRecord","comment":" Start building a keyed record decoder.\n\n    keyedRecord int String.fromInt Person\n        |> required 0 string\n        |> required 1 int\n        |> buildKeyedRecord IgnoreExtra\n\n","type":"Cbor.Decode.CborDecoder ctx k -> (k -> String.String) -> a -> Cbor.Decode.KeyedRecordBuilder ctx k a"},{"name":"lazy","comment":" Deferred construction for recursive decoders.\n","type":"(() -> Cbor.Decode.CborDecoder ctx a) -> Cbor.Decode.CborDecoder ctx a"},{"name":"map","comment":" Transform the result of a decoder.\n","type":"(a -> b) -> Cbor.Decode.CborDecoder ctx a -> Cbor.Decode.CborDecoder ctx b"},{"name":"map2","comment":" Combine two decoders sequentially.\n","type":"(a -> b -> c) -> Cbor.Decode.CborDecoder ctx a -> Cbor.Decode.CborDecoder ctx b -> Cbor.Decode.CborDecoder ctx c"},{"name":"map3","comment":" Combine three decoders sequentially.\n","type":"(a -> b -> c -> d) -> Cbor.Decode.CborDecoder ctx a -> Cbor.Decode.CborDecoder ctx b -> Cbor.Decode.CborDecoder ctx c -> Cbor.Decode.CborDecoder ctx d"},{"name":"map4","comment":" Combine four decoders sequentially.\n","type":"(a -> b -> c -> d -> e) -> Cbor.Decode.CborDecoder ctx a -> Cbor.Decode.CborDecoder ctx b -> Cbor.Decode.CborDecoder ctx c -> Cbor.Decode.CborDecoder ctx d -> Cbor.Decode.CborDecoder ctx e"},{"name":"map5","comment":" Combine five decoders sequentially.\n","type":"(a -> b -> c -> d -> e -> f) -> Cbor.Decode.CborDecoder ctx a -> Cbor.Decode.CborDecoder ctx b -> Cbor.Decode.CborDecoder ctx c -> Cbor.Decode.CborDecoder ctx d -> Cbor.Decode.CborDecoder ctx e -> Cbor.Decode.CborDecoder ctx f"},{"name":"mapHeader","comment":" Decode a CBOR map header, returning the entry count or `Nothing` for\nindefinite-length.\n","type":"Cbor.Decode.CborDecoder ctx (Maybe.Maybe Basics.Int)"},{"name":"maybe","comment":" Decode a nullable value: CBOR null (0xF6) or undefined (0xF7) become\n`Nothing`, anything else is decoded with the inner decoder and wrapped\nin `Just`.\n","type":"Cbor.Decode.CborDecoder ctx a -> Cbor.Decode.CborDecoder ctx (Maybe.Maybe a)"},{"name":"null","comment":" Decode a CBOR null (0xF6), returning the provided default value.\n","type":"a -> Cbor.Decode.CborDecoder ctx a"},{"name":"onKey","comment":" Register a field handler for a specific key.\n\nWhen the key is encountered during decoding, the value decoder runs\nand the setter updates the accumulator.\n\n","type":"comparable -> Cbor.Decode.CborDecoder ctx v -> (v -> acc -> acc) -> Cbor.Decode.UnorderedRecordBuilder ctx comparable acc -> Cbor.Decode.UnorderedRecordBuilder ctx comparable acc"},{"name":"oneOf","comment":" Try multiple decoders in order. Each decoder sees the same initial byte.\n","type":"List.List (Cbor.Decode.CborDecoder ctx a) -> Cbor.Decode.CborDecoder ctx a"},{"name":"optional","comment":" Decode an optional map field by key.\n\nIf the next key doesn't match, the key is stashed for the next step\nand the default value is used.\n\n","type":"k -> Cbor.Decode.CborDecoder ctx v -> v -> Cbor.Decode.KeyedRecordBuilder ctx k (v -> a) -> Cbor.Decode.KeyedRecordBuilder ctx k a"},{"name":"optionalElement","comment":" Decode an optional array element, using the default if no items remain.\n\nOptional elements must be at the end of the array.\n\n","type":"Cbor.Decode.CborDecoder ctx v -> v -> Cbor.Decode.RecordBuilder ctx (v -> a) -> Cbor.Decode.RecordBuilder ctx a"},{"name":"rawBytes","comment":" Decode any well-formed CBOR data item and return its raw bytes.\n\nInternally this decodes the item with [`item`](#item) and re-encodes it\nwith `Cbor.Encode.item`. There is no way to slice the source bytes directly,\nwhich would be faster in general due to allocation costs of small bytes slices.\n\n","type":"Cbor.Decode.CborDecoder ctx Bytes.Bytes"},{"name":"record","comment":" Start building a record decoder with the constructor function.\n\n    record Point\n        |> element float\n        |> element float\n        |> buildRecord IgnoreExtra\n\n","type":"a -> Cbor.Decode.RecordBuilder ctx a"},{"name":"required","comment":" Decode a required map field by key.\n\nThe key order in the builder must match the key order in the CBOR data.\n\n","type":"k -> Cbor.Decode.CborDecoder ctx v -> Cbor.Decode.KeyedRecordBuilder ctx k (v -> a) -> Cbor.Decode.KeyedRecordBuilder ctx k a"},{"name":"simple","comment":" Decode a CBOR simple value (major type 7).\n\nReturns the simple value number. Rejects booleans (20–21), null (22),\nundefined (23), and floats (25–27) which have their own decoders.\n\n","type":"Cbor.Decode.CborDecoder ctx Basics.Int"},{"name":"string","comment":" Decode a CBOR text string (major type 3).\n\nConcatenates indefinite-length chunks transparently.\n\n","type":"Cbor.Decode.CborDecoder ctx String.String"},{"name":"succeed","comment":" A decoder that always succeeds with the given value, consuming no bytes.\n","type":"a -> Cbor.Decode.CborDecoder ctx a"},{"name":"tag","comment":" Decode a CBOR tag (major type 6), returning the `Tag` value.\n\nDoes not decode the enclosed item. Useful with `andThen` to branch on\nthe tag number and then decode the body accordingly.\n\n","type":"Cbor.Decode.CborDecoder ctx Cbor.Tag"},{"name":"tagged","comment":" Decode a tagged CBOR value (major type 6).\n\nExpects a specific tag, then decodes the enclosed item.\n\n","type":"Cbor.Tag -> Cbor.Decode.CborDecoder ctx a -> Cbor.Decode.CborDecoder ctx a"},{"name":"undefined","comment":" Decode a CBOR undefined (0xF7), returning the provided default value.\n","type":"a -> Cbor.Decode.CborDecoder ctx a"},{"name":"unorderedRecord","comment":" Start building an unordered record decoder.\n\n    type alias PersonAcc =\n        { name : Maybe String, age : Maybe Int }\n\n    decodePerson : CborDecoder ctx Person\n    decodePerson =\n        unorderedRecord int { name = Nothing, age = Nothing }\n            |> onKey 0 string (\\v acc -> { acc | name = Just v })\n            |> onKey 1 int (\\v acc -> { acc | age = Just v })\n            |> buildUnorderedRecord IgnoreExtra\n                (\\acc -> Maybe.map2 Person acc.name acc.age)\n\n","type":"Cbor.Decode.CborDecoder ctx comparable -> acc -> Cbor.Decode.UnorderedRecordBuilder ctx comparable acc"},{"name":"untilBreak","comment":" Decode items until a break byte (0xFF) is encountered.\n\nUse this after reading an indefinite-length header with `arrayHeader` or\n`mapHeader`. The element decoder must be `Item` (i.e. consume bytes).\n\n","type":"Cbor.Decode.CborDecoder ctx a -> Cbor.Decode.CborDecoder ctx (List.List a)"}],"binops":[]},{"name":"Cbor.Encode","comment":" CBOR encoding combinators.\n\nBuild encoders for your domain types, then produce bytes.\nLength and sort decisions are made at construction time —\nno separate strategy parameter is needed.\n\n    import Cbor exposing (Length(..))\n    import Cbor.Encode as CE\n\n    type alias Person =\n        { name : String, age : Int }\n\n    encodePerson : Person -> CE.Encoder\n    encodePerson p =\n        CE.keyedRecord CE.Unsorted Definite CE.int\n            [ ( 0, Just (CE.string p.name) )\n            , ( 1, Just (CE.int p.age) )\n            ]\n\n    CE.encode (encodePerson alice)\n\n@docs Encoder, encode\n\n\n## Primitives\n\n@docs int, bigInt, float, bool, null, undefined, maybe, string, bytes, simple\n\n\n## Explicit Width Control\n\n@docs intWithWidth, floatWithWidth\n\n\n## Chunked Strings/Bytes\n\n@docs stringChunked, bytesChunked\n\n\n## Collections\n\n@docs Sort, list, array, map, associativeList, dict, tagged, keyedRecord, sequence\n\n\n## Escape Hatches\n\n@docs item, rawUnsafe\n\n\n## Predefined Sort Orders\n\n@docs deterministicSort, canonicalSort\n\n","unions":[{"name":"Encoder","comment":" An encoder that produces CBOR bytes.\n","args":[],"cases":[]},{"name":"Sort","comment":" Sort strategy for map keys.\n\n  - `Unsorted` preserves insertion order (fast path — no key serialization).\n  - `Sorted toComparable` serializes each key to `Bytes`, extracts a\n    comparable via `toComparable`, and sorts entries by that value.\n\n","args":["comparable"],"cases":[["Unsorted",[]],["Sorted",["Bytes.Bytes -> comparable"]]]}],"aliases":[],"values":[{"name":"array","comment":" Encode a CBOR array (major type 4).\n","type":"Cbor.Length -> List.List Cbor.Encode.Encoder -> Cbor.Encode.Encoder"},{"name":"associativeList","comment":" Encode an associative list as a CBOR map (major type 5).\n\nThis is a convenience wrapper around [`map`](#map) that takes encoder\nfunctions for keys and values instead of pre-built encoder pairs.\n\n    CE.associativeList CE.Unsorted\n        Definite\n        CE.int\n        CE.string\n        [ ( 1, \"Alice\" ), ( 2, \"Bob\" ) ]\n\n","type":"Cbor.Encode.Sort comparable -> Cbor.Length -> (k -> Cbor.Encode.Encoder) -> (v -> Cbor.Encode.Encoder) -> List.List ( k, v ) -> Cbor.Encode.Encoder"},{"name":"bigInt","comment":" Encode an integer that does not fit in a 32-bit CBOR argument.\n\nFor values that fit in `Encode.int`, prefer `int` instead. This function\nis for magnitudes that exceed 32 bits.\nYou should even prefer `Encode.int` on numbers up to 2^53-1.\n\n  - If the magnitude fits in 8 bytes, encodes as a 64-bit CBOR integer\n    (major type 0 or 1, additional info 27).\n  - If the magnitude exceeds 8 bytes, encodes as a bignum\n    (tag 2 for `Positive`, tag 3 for `Negative`) wrapping the byte string.\n\nThe bytes are the **unsigned magnitude** in big-endian byte order.\nFor `Negative`, the actual mathematical value is `−1 − magnitude`,\nmatching the CBOR spec for both major type 1 and tag 3.\n\nLeading zero bytes are stripped before encoding.\n\n","type":"Cbor.Sign -> Bytes.Bytes -> Cbor.Encode.Encoder"},{"name":"bool","comment":" Encode a boolean.\n","type":"Basics.Bool -> Cbor.Encode.Encoder"},{"name":"bytes","comment":" Encode a byte string (major type 2).\n","type":"Bytes.Bytes -> Cbor.Encode.Encoder"},{"name":"bytesChunked","comment":" Encode chunked bytes using indefinite-length encoding (major type 2).\n","type":"List.List Bytes.Bytes -> Cbor.Encode.Encoder"},{"name":"canonicalSort","comment":" RFC 7049 / RFC 8949 §4.2.3 Canonical CBOR.\n\nShorter keys first, then lexicographic within same length.\n(Also used by CTAP2/FIDO canonical encoding.)\n\n","type":"Cbor.Encode.Sort ( Basics.Int, String.String )"},{"name":"deterministicSort","comment":" RFC 8949 §4.2.1 Core Deterministic Encoding.\n\nLexicographic byte order on encoded keys.\n\n","type":"Cbor.Encode.Sort String.String"},{"name":"dict","comment":" Encode a `Dict` as a CBOR map (major type 5).\n","type":"Cbor.Encode.Sort comparable2 -> Cbor.Length -> (k -> Cbor.Encode.Encoder) -> (v -> Cbor.Encode.Encoder) -> Dict.Dict k v -> Cbor.Encode.Encoder"},{"name":"encode","comment":" Produce CBOR bytes from an encoder.\n","type":"Cbor.Encode.Encoder -> Bytes.Bytes"},{"name":"float","comment":" Encode a float using the shortest IEEE 754 form that preserves the value.\n","type":"Basics.Float -> Cbor.Encode.Encoder"},{"name":"floatWithWidth","comment":" Encode a float with a specific IEEE 754 width.\n","type":"Cbor.FloatWidth -> Basics.Float -> Cbor.Encode.Encoder"},{"name":"int","comment":" Encode an integer using the shortest form.\n\nOnly reliable for values in `[-(2^53 - 1), 2^53 - 1]` (JavaScript's safe\ninteger range). Outside that range, Elm's `Int` loses precision and the\nencoded bytes will be wrong. For arbitrarily large integers, use `bigInt`\nwith a raw bytes representation.\n\n","type":"Basics.Int -> Cbor.Encode.Encoder"},{"name":"intWithWidth","comment":" Encode an integer with a specific wire width.\n\nThe value is encoded in the given width regardless of whether a shorter\nencoding exists. Useful for lossless round-tripping.\n\n","type":"Cbor.IntWidth -> Basics.Int -> Cbor.Encode.Encoder"},{"name":"item","comment":" Encode a `CborItem` losslessly.\n","type":"Cbor.CborItem -> Cbor.Encode.Encoder"},{"name":"keyedRecord","comment":" Encode a keyed record as a CBOR map with a shared key encoder.\n\n`Nothing` entries are omitted from the output — this distinguishes\n\"field absent\" from \"field is null.\"\n\n","type":"Cbor.Encode.Sort comparable -> Cbor.Length -> (k -> Cbor.Encode.Encoder) -> List.List ( k, Maybe.Maybe Cbor.Encode.Encoder ) -> Cbor.Encode.Encoder"},{"name":"list","comment":" Encode a list of items using the same element encoder.\nThis is a helper function for [`array`](#array) when all elements are of the same type.\n","type":"Cbor.Length -> (a -> Cbor.Encode.Encoder) -> List.List a -> Cbor.Encode.Encoder"},{"name":"map","comment":" Encode a CBOR map (major type 5).\n","type":"Cbor.Encode.Sort comparable -> Cbor.Length -> List.List ( Cbor.Encode.Encoder, Cbor.Encode.Encoder ) -> Cbor.Encode.Encoder"},{"name":"maybe","comment":" Encode a `Maybe` value: `Nothing` becomes CBOR null, `Just x` is encoded\nwith the given encoder.\n","type":"(a -> Cbor.Encode.Encoder) -> Maybe.Maybe a -> Cbor.Encode.Encoder"},{"name":"null","comment":" Encode a CBOR null.\n","type":"Cbor.Encode.Encoder"},{"name":"rawUnsafe","comment":" Inject pre-encoded CBOR bytes without validation.\n\nIf the bytes are not valid CBOR, the output is malformed.\n\n","type":"Bytes.Bytes -> Cbor.Encode.Encoder"},{"name":"sequence","comment":" Concatenate multiple CBOR items without a wrapping array.\n\nProduces a CBOR Sequence (RFC 8742).\n\n","type":"List.List Cbor.Encode.Encoder -> Cbor.Encode.Encoder"},{"name":"simple","comment":" Encode a CBOR simple value (major type 7, values 0–255 excluding 20–23).\n","type":"Basics.Int -> Cbor.Encode.Encoder"},{"name":"string","comment":" Encode a UTF-8 text string (major type 3).\n","type":"String.String -> Cbor.Encode.Encoder"},{"name":"stringChunked","comment":" Encode a chunked text string using indefinite-length encoding (major type 3).\n","type":"List.List String.String -> Cbor.Encode.Encoder"},{"name":"tagged","comment":" Encode a CBOR semantic tag (major type 6).\n","type":"Cbor.Tag -> Cbor.Encode.Encoder -> Cbor.Encode.Encoder"},{"name":"undefined","comment":" Encode a CBOR undefined.\n","type":"Cbor.Encode.Encoder"}],"binops":[]}]