[
    {
        "name": "Debounce",
        "comment": "\n\nThis provides a component that can \"debounce\" a changing value: monitor a\ntime-varying sequence of values and output the latest value every time there is\nno further change for some minimum interval.\n\nThis implementation attempts to minimize the number of `update` calls by using\n`Process.sleep` to manage the settling time (rather than recalculating elapsed\ninterval on every fine-grained tick). An added tuple element in the `update`\nfunction's return value provides the notification to the parent of the settled\nvalue. It's also possible to poll the settled value.\n\n# Types\n@docs Model, Msg(Change)\n\n# Update\n@docs init, update\n\n# Read\n@docs settled\n\n",
        "unions": [
            {
                "name": "Msg",
                "comment": " Use the `Change` message to pass a new value to debouncer.\n",
                "args": [
                    "datatype"
                ],
                "cases": [
                    [
                        "Change",
                        [
                            "datatype"
                        ]
                    ]
                ]
            }
        ],
        "aliases": [
            {
                "name": "Model",
                "comment": " Debouncer model. Each instance handles a single time-varying sequence of the\nsame type (the `datatype`).\n",
                "args": [
                    "datatype"
                ],
                "type": "{ data : datatype, settled : datatype, sleepCount : Int, settleTime : Time }"
            }
        ],
        "values": [
            {
                "name": "init",
                "comment": " Initialize the debouncer with the time to wait for changing values to settle\nand the initial settled value.\n",
                "type": "Time -> datatype -> Model datatype"
            },
            {
                "name": "settled",
                "comment": " Access the settled value.\n",
                "type": "Model datatype -> datatype"
            },
            {
                "name": "update",
                "comment": " Update the debouncer as a typical TEA component. The return value adds a\nfinal tuple element that is `Nothing` while the value is still changing and\n`Just x` when the value has settled to `x`.\n",
                "type": "Msg datatype -> Model datatype -> ( Model datatype, Cmd (Msg datatype), Maybe datatype )"
            }
        ],
        "binops": []
    }
]