-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocs.json
1 lines (1 loc) · 3.71 KB
/
docs.json
1
[{"name":"JsonToElm","comment":" Take any encoded JSON (as a `Json.Encode.JsonValue`) and decode it into an Elm value.\n\n@docs JsonValue\n\n@docs decode\n\n","unions":[{"name":"JsonValue","comment":" A custom type that represents possible JSON values as an Elm type.\n","args":[],"cases":[["JsonInt",["Basics.Int"]],["JsonFloat",["Basics.Float"]],["JsonString",["String.String"]],["JsonBool",["Basics.Bool"]],["JsonList",["List.List JsonToElm.JsonValue"]],["JsonObject",["Dict.Dict String.String JsonToElm.JsonValue"]],["JsonNull",[]],["JsonUnknown",["Json.Encode.Value"]]]}],"aliases":[],"values":[{"name":"decode","comment":" A decoder for coverting a `Json.Encode.JsonValue` into a `JsonValue`.\n\nIf you run `decode` on the following JSON:\n\n {\n \"name\": \"John\",\n \"age\": 10,\n \"money\": 10.2,\n \"isTired\": \"true\",\n \"objects\": [ \"wallet\", \"phone\", \"keys\" ]\n }\n\nYou will get the following `JsonValue` result:\n\n JsonObject\n (Dict.fromList\n [ ( \"name\", JsonString \"John\" )\n , ( \"age\", JsonInt 10 )\n , ( \"money\", JsonFloat 10.2 )\n , ( \"isTired\", JsonBool True )\n , ( \"object\"\n , JsonList\n [ JsonString \"wallet\"\n , JsonString \"phone\"\n , JsonString \"keys\"\n ]\n )\n ]\n )\n\nYou can then manipulate the returned Elm type however you'd like in your program!\n\n","type":"Json.Decode.Decoder JsonToElm.JsonValue"}],"binops":[]},{"name":"JsonToElm.Gen","comment":" Utilities for taking a `JsonValue` and generating code for it using\n[elm-codegen](https://package.elm-lang.org/packages/mdgriffith/elm-codegen/latest/).\n\n@docs annotation\n\n@docs DecoderConfig, decoder\n\n@docs encoder, expression\n\n","unions":[],"aliases":[{"name":"DecoderConfig","comment":" A configuration object when generating elm-codegen decoders.\n\nThe `decoderExpressionType` is an optional configuration for customizing how the expression generated by\nthe `decoder` function will be annotated. Providing an annotation will overwrite whatever annotation would\nnormally be generated.\n\n","args":[],"type":"{ decoderExpressionType : Maybe.Maybe Elm.Annotation.Annotation }"}],"values":[{"name":"annotation","comment":" Returns a `Elm.Type.Annotation` for use in elm-codegen.\n\nFor example, running the following code:\n\n toAnnotation (StringVal \"test\")\n\nWill result in:\n\n Elm.Annotation.string\n\n","type":"JsonToElm.JsonValue -> Elm.Annotation.Annotation"},{"name":"decoder","comment":" Returns a `Json.Decode` expression for use in elm-codegen.\n\nFor example, running the following code:\n\n toDecoder (StringVal \"test\")\n\nWill result in:\n\n ( Gen.Json.Decode.string, Dict.empty )\n\n**Note**: This function may also return a declaration for a custom `map` function if the passed `JsonValue` is\na record with more than 8 keys. When returned, this should be added to the generated code!\n\n","type":"JsonToElm.Gen.DecoderConfig -> JsonToElm.JsonValue -> ( Elm.Expression, Dict.Dict String.String Elm.Declaration )"},{"name":"encoder","comment":" Takes a `JsonToElm.JsonValue` and turns it into a `Json.Encode` expression.\n\nFor example, running the following code:\n\n toEncoder (StringVal \"test\")\n\nWill result in:\n\n Gen.Json.Encode.call_.string\n\n","type":"JsonToElm.JsonValue -> Elm.Expression -> Elm.Expression"},{"name":"expression","comment":" Returns a `Elm.Expression` for use in elm-codegen.\n\nFor example, running the following code:\n\n toElmJsonValue (JsonString \"test\")\n\nWill result in:\n\n Elm.string \"test\"\n\n","type":"JsonToElm.JsonValue -> Elm.Expression"}],"binops":[]}]