[{"name":"LocalStorage","comment":" The 'LocalStorage' module does most of the work in using the JavaScript `localStorage` facility to persistently store key/value pairs.\n\n\n# Types\n\n@docs LocalStorage\n\n\n# Constructors\n\n@docs make, makeRealPorts\n\n\n# Functions\n\n@docs getItem, setItem, clear, listKeys\n\n\n# State accessors\n\n@docs getPorts, setPorts, getPrefix\n\n","unions":[{"name":"LocalStorage","comment":" Opaque type. Returned by `make` and `getPorts`. Passed to the other functions.\n","args":["msg"],"cases":[]}],"aliases":[],"values":[{"name":"clear","comment":" Return a `Cmd` to clear all JS `localStorage` keys that begin with the `prefix` passed to `make`.\n","type":"LocalStorage.LocalStorage msg -> Platform.Cmd.Cmd msg"},{"name":"getItem","comment":" Return a `Cmd` to fetch the value for the `Key` from `LocalStorage`.\n","type":"LocalStorage.LocalStorage msg -> LocalStorage.SharedTypes.Key -> Platform.Cmd.Cmd msg"},{"name":"getPorts","comment":" Return the `Ports` instance you passed to `make` or `setPorts`.\n","type":"LocalStorage.LocalStorage msg -> LocalStorage.SharedTypes.Ports msg"},{"name":"getPrefix","comment":" Get the prefix passed to `make`\n","type":"LocalStorage.LocalStorage msg -> String.String"},{"name":"listKeys","comment":" Return a `Cmd` to list all JS `localStorage` keys that begin with the `prefix` passed to `make` followed by the String you pass here.\n","type":"LocalStorage.LocalStorage msg -> String.String -> Platform.Cmd.Cmd msg"},{"name":"make","comment":" Make a `LocalStorage` instance.\n\nIf `prefix` is not empty (\"\"), will prefix all keys in JS `localStorage` with\n`prefix ++ \".\"`.\n\n","type":"LocalStorage.SharedTypes.Ports msg -> String.String -> LocalStorage.LocalStorage msg"},{"name":"makeRealPorts","comment":" Create a `Ports` value, using what are usually your real Elm `port`s.\n","type":"LocalStorage.SharedTypes.GetItemPort msg -> LocalStorage.SharedTypes.SetItemPort msg -> LocalStorage.SharedTypes.ClearPort msg -> LocalStorage.SharedTypes.ListKeysPort msg -> LocalStorage.SharedTypes.Ports msg"},{"name":"setItem","comment":" Return a `Cmd` to set the value for the `Key` to `Value` in `LocalStorage`.\n","type":"LocalStorage.LocalStorage msg -> LocalStorage.SharedTypes.Key -> LocalStorage.SharedTypes.Value -> Platform.Cmd.Cmd msg"},{"name":"setPorts","comment":" Set the internal `Ports` value. Fetch it back with `getPorts`.\n","type":"LocalStorage.SharedTypes.Ports msg -> LocalStorage.LocalStorage msg -> LocalStorage.LocalStorage msg"}],"binops":[]},{"name":"LocalStorage.DictPorts","comment":" Simulate ports for using the `LocalStorage` module from `elm reactor`.\n\n\n# Functions\n\n@docs make\n\n","unions":[],"aliases":[],"values":[{"name":"make","comment":" Create a `Ports` object from a message wrapper, usually just one of your Msg options.\n","type":"LocalStorage.SharedTypes.MsgWrapper msg -> String.String -> LocalStorage.SharedTypes.Ports msg"}],"binops":[]},{"name":"LocalStorage.SharedTypes","comment":" Types for the `LocalStorage` module.\n\n\n# Types\n\n@docs Key, Value, Operation, Ports, DictState, MsgWrapper\n\n\n# Port Signatures\n\n@docs GetItemPort, SetItemPort, ClearPort, ListKeysPort, ReceiveItemPort\n\n\n# Functions\n\n@docs receiveWrapper, decodeStringList, addPrefix, stripPrefix\n\n\n# Constants\n\n@docs emptyDictState\n\n","unions":[{"name":"Operation","comment":" The operation that caused your wrapper `Msg` to be sent.\n\nFor real ports, you'll only ever see GetItemOperation.\n\nFor simluated ports, you'll see the others as well, because you have to save the updated state.\n\n","args":[],"cases":[["GetItemOperation",[]],["SetItemOperation",[]],["ClearOperation",[]],["ListKeysOperation",[]],["ErrorOperation",[]]]},{"name":"Ports","comment":" Wrap up your ports.\n\nYou'll usually create one of these with `LocalStorage.realRealPorts` or `DictPorts.make`.\n\nYour update Msg will receive one, if you're using simulated ports.\n\n","args":["msg"],"cases":[["Ports",["{ getItem : LocalStorage.SharedTypes.Ports msg -> LocalStorage.SharedTypes.GetItemPort msg, setItem : LocalStorage.SharedTypes.Ports msg -> LocalStorage.SharedTypes.SetItemPort msg, clear : LocalStorage.SharedTypes.Ports msg -> LocalStorage.SharedTypes.ClearPort msg, listKeys : LocalStorage.SharedTypes.Ports msg -> LocalStorage.SharedTypes.ListKeysPort msg, state : LocalStorage.SharedTypes.DictState }"]]]}],"aliases":[{"name":"ClearPort","comment":" The required signature of your `localStorage.clear` port.\n","args":["msg"],"type":"String.String -> Platform.Cmd.Cmd msg"},{"name":"DictState","comment":" A `Dict` that stores key/value pairs for the simulated ports.\n","args":[],"type":"Dict.Dict LocalStorage.SharedTypes.Key LocalStorage.SharedTypes.Value"},{"name":"GetItemPort","comment":" The required signature of your `localStorage.getItem` port.\n","args":["msg"],"type":"LocalStorage.SharedTypes.Key -> Platform.Cmd.Cmd msg"},{"name":"Key","comment":" A convenience type for keys in the store. Same as `String`.\n","args":[],"type":"String.String"},{"name":"ListKeysPort","comment":" The required signature of your `localStorage.list` port.\n","args":["msg"],"type":"String.String -> Platform.Cmd.Cmd msg"},{"name":"MsgWrapper","comment":" Your Msg, which wraps the key/value pair from a `getItem` return.\n\nFor real ports, you'll only care about the `GetItem` operation. You'll get `Nothing` for the `Ports`.\n\nFor simluated ports, you need to store the `Ports` in your `Model`.\n\n","args":["msg"],"type":"LocalStorage.SharedTypes.Operation -> Maybe.Maybe (LocalStorage.SharedTypes.Ports msg) -> LocalStorage.SharedTypes.Key -> LocalStorage.SharedTypes.Value -> msg"},{"name":"ReceiveItemPort","comment":" The required signature of your subscription to receive `getItem` values.\n","args":["msg"],"type":"(LocalStorage.SharedTypes.Value -> msg) -> Platform.Sub.Sub msg"},{"name":"SetItemPort","comment":" The required signature of your `localStorage.setItem` port.\n","args":["msg"],"type":"( LocalStorage.SharedTypes.Key, LocalStorage.SharedTypes.Value ) -> Platform.Cmd.Cmd msg"},{"name":"Value","comment":" A convenience type for values in the store. Same as `Json.Encode.Value`.\n","args":[],"type":"Json.Encode.Value"}],"values":[{"name":"addPrefix","comment":" Prepend the `String` and a period to the `Key`, or nothing if the `String` is empty.\n","type":"String.String -> LocalStorage.SharedTypes.Key -> LocalStorage.SharedTypes.Key"},{"name":"decodeStringList","comment":" Decode a Value representing a list of strings.\n\nUseful for the result of `LocalStorage.listKeys`.\n\n","type":"LocalStorage.SharedTypes.Value -> Result.Result String.String (List.List String.String)"},{"name":"emptyDictState","comment":" `Dict.empty`\n","type":"LocalStorage.SharedTypes.DictState"},{"name":"receiveWrapper","comment":" Use this to turn the Value coming from a receive port into a Msg.\n","type":"LocalStorage.SharedTypes.MsgWrapper msg -> String.String -> LocalStorage.SharedTypes.Value -> msg"},{"name":"stripPrefix","comment":" Drop the length of the first arg from the left of the second.\n","type":"String.String -> LocalStorage.SharedTypes.Key -> String.String"}],"binops":[]}]