[{"name":"CodeGen.FeatureFlags","comment":"\n\n\n# Flags\n\n@docs Flag, bool, maybeString, string\n\n\n# Builder methods\n\n@docs Config, fromFlags, withJsonConverters, withUrlConverters, withQueryKeyFormatter, generate\n\n","unions":[{"name":"Config","comment":" A ready-to-generate configuration. Pass it along between builders.\n","args":[],"cases":[]},{"name":"Flag","comment":" A type setting for a single flag. See the functions below for constructing this type.\n","args":[],"cases":[]}],"aliases":[],"values":[{"name":"bool","comment":" Create a feature flag for booleans, with a default value of `False`. The string parameter here\nwill be your flag name in the generated code, so always provide camelCase.\n\n    fromFlags\n        [ ( \"analyticsV2\", bool)\n        , ( \"showPricingExplainer\", bool)\n        ]\n        |> generate \"FeatureFlags\"\n\n    -- produces a feature flag record definition of\n    -- { analyticsV2 : Bool\n    -- , showPricingExplainer : Bool\n    -- }\n\n","type":"CodeGen.FeatureFlags.Flag"},{"name":"fromFlags","comment":" Start a builder for your feature flag module.\n\n    fromFlags\n        [ ( \"snazzUpTheLoginButton\", bool )\n        , ( \"alternatePricingExplainer\", maybeString )\n        ]\n\n","type":"List.List ( String.String, CodeGen.FeatureFlags.Flag ) -> CodeGen.FeatureFlags.Config"},{"name":"generate","comment":" Generate a file based on the config you've built. elm-codegen will name the module whatever you\nprovide here.\n\n    fromFlags\n        [ ( \"featureA\", bool )\n        , ( \"featureB\", maybeString )\n        ]\n        |> withJsonConverters\n        |> withUrlConverters\n        |> withQueryKeyFormatter (\\fieldName -> \"f-\" ++ fieldName)\n        |> generate \"Flags\"\n\n","type":"String.String -> CodeGen.FeatureFlags.Config -> Elm.File"},{"name":"maybeString","comment":" Create a feature flag for optional strings, with a default value of `Nothing`. The string\nparameter here will be your flag name in the generated code, so always provide camelCase.\n\n    fromFlags [ ( \"alternateApiUrl\", maybeString ) ]\n        |> generate \"FeatureFlags\"\n    -- produces a feature flag record definition of\n    -- { alternateApiUrl : Maybe String }\n\n","type":"CodeGen.FeatureFlags.Flag"},{"name":"string","comment":" Create a feature flag for strings, with your own default value. The first string parameter here\nwill be your flag name in the generated code, so always provide camelCase.\n\n    fromFlags [ ( \"welcomeMessage\", string \"Welcome to my site!\" ) ]\n        |> generate \"FeatureFlags\"\n    -- produces a feature flag record definition of\n    -- { welcomeMessage : String }\n\n","type":"String.String -> CodeGen.FeatureFlags.Flag"},{"name":"withJsonConverters","comment":" Bundle in a JSON decoder and an encoder. Introduces dependencies on elm/json and\nNoRedInk/elm-json-decode-pipeline. All fields will be optional in decoding, and default values will\nbe omitted on serialization.\n\n    fromFlags\n        [ ( \"loadSlowly\", bool )\n        , ( \"repeatedlyAskForNotificationPermissions\", bool )\n        ]\n        |> withJsonConverters\n        |> generate \"Flags\"\n\n    -- Flags will now expose:\n    --   - `decoder : Json.Decode.Decoder FeatureFlags`\n    --   - `encode : FeatureFlags -> Json.Encode.Value`\n    Json.Decode.decodeString\n        Flags.decoder\n        \"{\\\"repeatedlyAskForNotificationPermissions\\\":true}\"\n        == Ok\n            { loadSlowly = False\n            , repeatedlyAskForNotificationPermissions = True\n            }\n\n    Json.Encode.encode 0\n        (Flags.encode\n            { loadSlowly = True\n            , repeatedlyAskForNotificationPermissions = False\n            }\n        )\n        == \"{\\\"loadSlowly\\\":true}\"\n\n","type":"CodeGen.FeatureFlags.Config -> CodeGen.FeatureFlags.Config"},{"name":"withQueryKeyFormatter","comment":" Apply your own logic for creating URL query keys. Takes the fieldname as an input. Ignored if\nyou don't call `withUrlConverters`.\n\n    fromFlags [ ( \"refreshAtRandom\", bool ) ]\n        |> withUrlConverters\n        |> withQueryKeyFormatter (\\fieldName -> \"f-\" ++ fieldName)\n        |> generate \"Flags\"\n\n    Maybe.map Flags.fromUrl\n        (Url.fromString \"https://trustworthy.com?f-refreshAtRandom=true\")\n        == Just { refreshAtRandom = True }\n\n    Url.Builder.crossOrigin\n        \"https://trustworthy.com\"\n        []\n        (Url.Flags.toParams { refreshAtRandom = True })\n        == \"https://trustworthy.com/?f-refreshAtRandom=true\"\n\n","type":"(String.String -> String.String) -> CodeGen.FeatureFlags.Config -> CodeGen.FeatureFlags.Config"},{"name":"withUrlConverters","comment":" Bundle in a URL querystring parser and a builder. Introduces a dependency on elm/url.\nQuerystring keys match the fieldname by default. All fields will be optional in decoding, and\ndefault values will be omitted on serialization.\n\n    fromFlags [ ( \"betterNameForUser\", maybeString ) ]\n        |> withUrlConverters\n        |> generate \"Flags\"\n\n    -- Flags will now expose:\n    --   - `fromUrl : Url.Url -> FeatureFlags`\n    --   - `toParams : FeatureFlags -> List Url.Builder.QueryParameter`\n    Maybe.map Flags.fromUrl\n        Url.fromString\n        \"https://trustworthy.com?betterNameForUser=James\"\n        == Just { betterNameForUser = Just \"James\" }\n\n    Url.Builder.crossOrigin\n        \"https://trustworthy.com\"\n        []\n        (Url.Flags.toParams { betterNameForUser = Nothing })\n        == \"https://trustworthy.com/\"\n\n","type":"CodeGen.FeatureFlags.Config -> CodeGen.FeatureFlags.Config"}],"binops":[]}]