[
    {
        "name": "InfiniteScroll",
        "comment": " Infinite scroll allows you to load more content for the user as he scrolls (up or down).\n\nThe infinite scroll must be bound to an `Html` element and will execute your own `Cmd` when the user\nscrolled to the bottom (or top) of the element.\n\nThe `Cmd` can be anything you want from local data fetching or complex requests on remote APIs.\nAll it has to do is to return a `Cmd msg` and call `stopLoading` once fetching is finished so that\nthe infinite scroll can continue asking for more content.\n\n# Definitions\n@docs LoadMoreCmd, Direction\n\n# Initialization\n@docs init, timeout, offset, direction\n\n# Update\n@docs update\n\n# Scroll\n@docs infiniteScroll, stopLoading, startLoading\n\n# Types\n@docs Model, Msg\n",
        "unions": [
            {
                "name": "Direction",
                "comment": " Scroll direction.\n- `Top` means new content will be asked when the user scrolls to the top of the element\n- `Bottom` means new content will be asked when the user scrolls to the bottom of the element\n",
                "args": [],
                "cases": [
                    [
                        "Top",
                        []
                    ],
                    [
                        "Bottom",
                        []
                    ]
                ]
            },
            {
                "name": "Msg",
                "comment": " Infinite scroll messages you have to give to the `update` function.\n",
                "args": [],
                "cases": []
            }
        ],
        "aliases": [
            {
                "name": "LoadMoreCmd",
                "comment": " Definition of the function you must provide to the API. This function will be called\nas soon as new content is required\n\n    loadMore : InfiniteScroll.Direction -> Cmd Msg\n    loadMore dir =\n        Task.perform OnLoadMore <| Task.succeed dir\n\n    InfiniteScroll.init loadMore\n",
                "args": [
                    "msg"
                ],
                "type": "Direction -> Cmd msg"
            },
            {
                "name": "Model",
                "comment": " Model of the infinite scroll module. You need to create a new one using `init` function.\n",
                "args": [
                    "msg"
                ],
                "type": "{ direction : Direction, offset : Int, loadMoreFunc : LoadMoreCmd msg, isLoading : Bool, timeout : Time, lastRequest : Time }"
            }
        ],
        "values": [
            {
                "name": "direction",
                "comment": " Sets a different direction (default to `Bottom`).\n\nA direction set to `Bottom` will check distance of the scroll bar from the bottom of the element, whereas a direction set to `Top`\nwill check distance of the scroll bar from the top of the element.\n\n    init loadMore\n        |> direction Top\n",
                "type": "Direction -> Model msg -> Model msg"
            },
            {
                "name": "infiniteScroll",
                "comment": " Function used to bind the infinite scroll on an element.\n\n**The element's height must be explicitly set, otherwise scroll event won't be triggered**\n\n    type Msg\n        = InfiniteScrollMsg InfiniteScroll.Msg\n\n    view : Model -> Html Msg\n    view _ =\n        let\n            styles =\n                [ ( \"height\", \"300px\" ) ]\n        in\n            div [ infiniteScroll InfiniteScrollMsg, Attributes.style styles ]\n                [ -- Here will be my long list -- ]\n",
                "type": "(Msg -> msg) -> Attribute msg"
            },
            {
                "name": "init",
                "comment": " Creates a new `Model`. This function needs a `LoadMoreCmd` that will be called when new data is required.\n\n    type Msg\n        = OnLoadMore InfiniteScroll.Direction\n\n    type alias Model =\n        { infiniteScroll : InfiniteScroll.Model Msg }\n\n    loadMore : InfiniteScroll.Direction -> Cmd Msg\n    loadMore dir =\n        Task.perform OnLoadMore <| Task.succeed dir\n\n    initModel : Model\n    initModel =\n        { infiniteScroll = InfiniteScroll.init loadMore }\n",
                "type": "LoadMoreCmd msg -> Model msg"
            },
            {
                "name": "offset",
                "comment": " Sets a different offset (default 50).\n\nOffset is the number of pixels from top or bottom (depending on `Direction` value) from which infinite scroll\nwill detect it needs more content.\n\nFor instance with offset set to 50 and direction to `Top`. Once scroll position is 50 pixels or less from the top of the element it will require new content.\nThe same applies with a direction set to `Bottom` except it will check for the distance with the bottom of the element.\n\n    init loadMore\n        |> offset 100\n",
                "type": "Int -> Model msg -> Model msg"
            },
            {
                "name": "startLoading",
                "comment": " Starts loading more data. You should never have to use this function has it is automatically called\nwhen new content is required and your `loadMore` command is executed.\n",
                "type": "Model msg -> Model msg"
            },
            {
                "name": "stopLoading",
                "comment": " Stops loading. You should call this function when you have finished fetching new data. This tells infinite scroll that it\ncan continue asking you more content.\n\nIf you forget to call this function or if your data fetching is too long, you will be asked to retrieve more content after timeout has expired.\n",
                "type": "Model msg -> Model msg"
            },
            {
                "name": "timeout",
                "comment": " Sets a different timeout value (default is 5 seconds)\n\nWhen timeout is exceeded `stopLoading` will be automatically called so that infinite scroll can continue asking more content\nevent when previous request did not finished.\n\n    init loadMore\n        |> timeout 10 * second\n",
                "type": "Time -> Model msg -> Model msg"
            },
            {
                "name": "update",
                "comment": " The update function must be called in your own update function. It will return an updated `Model` and commands to execute.\n\n    type Msg =\n        InfiniteScrollMsg InfiniteScroll.Msg\n\n    type alias Model =\n        { infiniteScroll : InfiniteScroll.Model Msg }\n\n    update : Msg -> Model -> ( Model, Cmd Msg )\n    update msg model =\n        case msg of\n            InfiniteScrollMsg msg_ ->\n                let\n                    ( infiniteScroll, cmd ) =\n                        InfiniteScroll.update InfiniteScrollMsg msg_ model.infiniteScroll\n                in\n                    ( { model | infiniteScroll = infiniteScroll }, cmd )\n",
                "type": "(Msg -> msg) -> Msg -> Model msg -> ( Model msg, Cmd msg )"
            }
        ],
        "binops": []
    }
]