[{"name":"PortFunnel.LocalStorage","comment":" The `PortFunnelLocalStorage` uses the JavaScript `localStorage` facility to persistently store key/value pairs.\n\nIt is a `billstclair/elm-port-funnel` `PortFunnel` funnel.\n\n\n# Types\n\n@docs Message, Response, State, Key, Prefix, Value\n\n\n# Components of a `PortFunnel.FunnelSpec`\n\n@docs moduleName, moduleDesc, commander\n\n\n# Initial `State`\n\n@docs initialState\n\n\n# Sending a `Message` out the `Cmd` Port\n\n@docs send\n\n\n# Creating Messages\n\nThe `Message` type is opaque, so there are functions to create the four messages\nyou may pass to `send`.\n\n@docs get, put, listKeys, clear\n\n\n# Conversion to Strings\n\n@docs toString, toJsonString\n\n\n# Simulator\n\n@docs makeSimulatedCmdPort\n\n\n# Non-standard Functions\n\n@docs isLoaded, getPrefix, encode, decode\n\n","unions":[{"name":"Response","comment":" A `Response` is used to return values for `Get` and `ListKeys`.\n","args":[],"cases":[["NoResponse",[]],["GetResponse",["{ key : PortFunnel.LocalStorage.Key, value : Maybe.Maybe PortFunnel.LocalStorage.Value }"]],["ListKeysResponse",["{ prefix : String.String, keys : List.List PortFunnel.LocalStorage.Key }"]]]},{"name":"State","comment":" Our internal state.\n","args":[],"cases":[]}],"aliases":[{"name":"Key","comment":" A convenience type for keys in the store. Same as `String`.\n","args":[],"type":"PortFunnel.InternalTypes.Key"},{"name":"Message","comment":" An opaque type that represents a message to send to or receive from the JS code.\n\nThere are a number of internal messages, but the ones you can use are created by `get`, `put`, `listkeys`, and `clear`.\n\n","args":[],"type":"PortFunnel.InternalTypes.Message"},{"name":"Prefix","comment":" A convenience type for prefixes. Same as `String`.\n","args":[],"type":"PortFunnel.InternalTypes.Prefix"},{"name":"Value","comment":" A convenience type for values in the store. Same as `Json.Encode.Value`.\n","args":[],"type":"PortFunnel.InternalTypes.Value"}],"values":[{"name":"clear","comment":" Return a message to remove all keys beginning with a prefix.\n\nA prefix of `\"\"` means to remove all keys.\n\n","type":"PortFunnel.LocalStorage.Prefix -> PortFunnel.LocalStorage.Message"},{"name":"commander","comment":" Responsible for sending a `CmdResponse` back through the port.\n\nThis funnel doesn't initiate any sends, so this function always returns `Cmd.none`.\n\n","type":"(PortFunnel.GenericMessage -> Platform.Cmd.Cmd msg) -> PortFunnel.LocalStorage.Response -> Platform.Cmd.Cmd msg"},{"name":"decode","comment":" Turn a `GenericMessage` into a `Message`.\n","type":"PortFunnel.GenericMessage -> Result.Result String.String PortFunnel.LocalStorage.Message"},{"name":"encode","comment":" Turn a `Message` into a `GenericMessage`.\n","type":"PortFunnel.LocalStorage.Message -> PortFunnel.GenericMessage"},{"name":"get","comment":" Return a `Message` to get a value from local storage.\n","type":"PortFunnel.LocalStorage.Key -> PortFunnel.LocalStorage.Message"},{"name":"getPrefix","comment":" Get the prefix from the state.\n","type":"PortFunnel.LocalStorage.State -> PortFunnel.LocalStorage.Prefix"},{"name":"initialState","comment":" The initial state.\n\nThe `Prefix` arg (plus a period, if non-blank) is prepended to all\nkeys sent to the backend, and removed from keys returned. It basically\ngive you a namespace in local storage, and usually matches your\napplication name. It allows multiple different Elm applications to be\nserved by the same domain without stepping on each other's state.\n\nThe state also stores a `Dict`, which acts as the backing store for simulation,\nand a flag saying whether the JavaScript code has sent its \"I'm loaded\" message\n(see `isLoaded`).\n\n","type":"PortFunnel.LocalStorage.Prefix -> PortFunnel.LocalStorage.State"},{"name":"isLoaded","comment":" Returns true if a `Startup` message has been processed.\n\nThis is sent by the port code after it has initialized. Your code can use this to decide whether to use your real outgoing port or the one created by `makeSimulatedCmdPort`.\n\n","type":"PortFunnel.LocalStorage.State -> Basics.Bool"},{"name":"listKeys","comment":" Return a `Message` to list all keys beginning with a prefix.\n","type":"PortFunnel.LocalStorage.Prefix -> PortFunnel.LocalStorage.Message"},{"name":"makeSimulatedCmdPort","comment":" Make a simulated `Cmd` port.\n","type":"(PortFunnel.LocalStorage.Value -> msg) -> PortFunnel.LocalStorage.Value -> Platform.Cmd.Cmd msg"},{"name":"moduleDesc","comment":" Our module descriptor.\n","type":"PortFunnel.ModuleDesc PortFunnel.LocalStorage.Message PortFunnel.LocalStorage.State PortFunnel.LocalStorage.Response"},{"name":"moduleName","comment":" The name of this funnel: \"LocalStorage\".\n","type":"String.String"},{"name":"put","comment":" Return a `Message` to put a value into local storage.\n\n`Nothing` for the value means to remove the key.\n\n","type":"PortFunnel.LocalStorage.Key -> Maybe.Maybe PortFunnel.LocalStorage.Value -> PortFunnel.LocalStorage.Message"},{"name":"send","comment":" Send a `Message` through a `Cmd` port.\n\nNote that this `send` function requires that you pass state,\nbut it is read-only, so you don't need to update your `Model` state\non return.\n\n","type":"(PortFunnel.LocalStorage.Value -> Platform.Cmd.Cmd msg) -> PortFunnel.LocalStorage.Message -> PortFunnel.LocalStorage.State -> Platform.Cmd.Cmd msg"},{"name":"toJsonString","comment":" Convert a `Message` to the same JSON string that gets sent\n\nover the wire to the JS code.\n\n","type":"PortFunnel.LocalStorage.Message -> String.String"},{"name":"toString","comment":" Convert a `Message` to a nice-looking human-readable string.\n","type":"PortFunnel.LocalStorage.Message -> String.String"}],"binops":[]}]