[
    {
        "name": "Animation",
        "comment": "A library for animating between two Float values. For example, animate a panel's width from 100px to 300px over 2\nseconds, or make a button spin and grow on hover. Everything is a pure function, no signals in sight, so you can use it\neasily within your architecture. You can also inspect animations to determine if they are still running and for how\nlong, and even smoothly retarget a different destination midflight.\n\nThe library encapsulates a 3-stage animation pipeline:\n* **Timekeeping:** You are expected to maintain a running clock, which could be as simple as `Signal.foldp (+) 0 (Time.fps 30)`\n    or part of your state and action types. You use this clock to create an animation and again to obtain the current\n    value. You can also specify a delay and the duration for your animation.\n\n* **Easing:** An easing function is what makes an animation come alive with acceleration and sometimes even elasticity.\n    When setting the easing function for your animation, I recommend [Dan's\n    library](http://package.elm-lang.org/packages/Dandandan/Easing/latest/Easing#easing-functions). (Dan also has your\n    back if you need to interpolate pairs or colors with the output of this library.)\n\n* **Interpolation:** It wouldn't be very useful is all animations went from 0 to 1 (the default), would it? You can\n    specify values to animate `from` and `to`. Furthermore, you can set the average speed (distance between these two\n    values per milisecond) instead of a duration.\n\nOnce you have your value at the current time, you can render it to any frontend you choose: Collage, Element, Html,\n[turtles](http://package.elm-lang.org/packages/mgold/elm-turtle-graphics/latest)...\n\n# Basic Usage\n\n`animation` creates an animation starting at the given time (usually the current time). `animate` takes the current time\nand an animation and produces the current value.\n\n````elm\nimport Animation exposing (..)\nimport Time exposing (second)\n\nmyAnim = animation 0 |> from 100 |> to 300 |> duration (4*second) |> delay (1*second)\nList.map (\\t -> animate (t*second) myAnim) [0..6]\n-- [100, 100, 129.29, 200, 270.71, 300, 300]\n````\nNotice that the value remains constant during the delay and after the animation is done, and that sinusoidal easing\nin and out is applied by default. Animations go through three phases (not related to the three stages of rendering):\nthey are scheduled, they run, and then they are done.\n\n# Create\n@docs animation, static\n\n# Run\n@docs animate\n\n# Modify\n## Settings\nYou may set an animation's duration or speed but not both, since one determines the other.\n@docs duration, speed, delay, ease, from, to\n\n## Interruptions\n@docs undo, retarget\n\n# Inspect\n## Equality\n@docs equals\n\n## Lifecycle\n@docs isScheduled, isRunning, isDone\n\n## Physics\n@docs timeElapsed, timeRemaining, velocity\n\n## Settings\n@docs getStart, getDuration, getSpeed, getDelay, getEase, getFrom, getTo\n\n# The Animation Type\n@docs Animation",
        "unions": [
            {
                "name": "Animation",
                "comment": "An Animation is an opaque type that represents a time-varying number (floating point value).",
                "args": [],
                "cases": []
            }
        ],
        "aliases": [],
        "values": [
            {
                "name": "animate",
                "comment": "Produce the value of an animation at a given time.",
                "type": "Time -> Animation -> Float"
            },
            {
                "name": "animation",
                "comment": "Create an animation that begins now. By default, animations have no delay, last 750ms, and interpolate between 0 and\n1 with a sinusoidal easing function. All of these can be changed.",
                "type": "Time -> Animation"
            },
            {
                "name": "delay",
                "comment": "Set the delay of an animation to the time specified. An animation will not start until after the delay. The default\ndelay is 0. Note that the `Time` argument is _not_ the current running time but the delay to be set.",
                "type": "Time -> Animation -> Animation"
            },
            {
                "name": "duration",
                "comment": "Set the duration of an animation to the time specified. This setting overrides, and is overriden by, `speed` (last\napplication wins). Note that the `Time` argument is _not_ the current running time but the duration to be set.",
                "type": "Time -> Animation -> Animation"
            },
            {
                "name": "ease",
                "comment": "Set the easing function of an animation. It is expected that `f 0 == 0` and `f 1 == 1`. The default is a sinusoidal\nin-out.",
                "type": "(Float -> Float) -> Animation -> Animation"
            },
            {
                "name": "equals",
                "comment": "Equality on animations. Compared to `(==)` (which should not be used), this\nfunction handles the conversion of speed and duration, and start and delay. It\nalso samples the easing functions, which may produce false positives (but\nusually not in practice).\n\n    -- These are True\n    animation 0 `equals` animation 0\n    (animation 0 |> delay 10) `equals` animation 10\n    (animation 0 |> duration 1000) `equals` (animation 0 |> speed 0.001)\n\n    -- These are False\n    static 0 `equals` animation 0\n    (animation 0 |> from -1) `equals` animation 0\n    (animation 0 |> ease identity) `equals` animation 0",
                "type": "Animation -> Animation -> Bool"
            },
            {
                "name": "from",
                "comment": "Set the initial value of an animation. The default is 0.",
                "type": "Float -> Animation -> Animation"
            },
            {
                "name": "getDelay",
                "comment": "Get the delay of the animation.",
                "type": "Animation -> Time"
            },
            {
                "name": "getDuration",
                "comment": "Get the duration of the animation, not counting delay.",
                "type": "Animation -> Time"
            },
            {
                "name": "getEase",
                "comment": "Get the easing function of the animation.",
                "type": "Animation -> Float -> Float"
            },
            {
                "name": "getFrom",
                "comment": "Get the initial value of the animation.",
                "type": "Animation -> Float"
            },
            {
                "name": "getSpeed",
                "comment": "Get the average speed of the animation.",
                "type": "Animation -> Float"
            },
            {
                "name": "getStart",
                "comment": "Get the start time of the animation, the argument to `animate`. For interrupted animations, this is when the\ninterruption occured.",
                "type": "Animation -> Time"
            },
            {
                "name": "getTo",
                "comment": "Get the final value of the animation.",
                "type": "Animation -> Float"
            },
            {
                "name": "isDone",
                "comment": "Determine if an animation is done, meaning that it has arrived at its final value.",
                "type": "Time -> Animation -> Bool"
            },
            {
                "name": "isRunning",
                "comment": "Determine if an animation is running, meaning that it is currently changing value.",
                "type": "Time -> Animation -> Bool"
            },
            {
                "name": "isScheduled",
                "comment": "Determine if an animation is scheduled, meaning that it has not yet changed value.",
                "type": "Time -> Animation -> Bool"
            },
            {
                "name": "retarget",
                "comment": "Change the `to` value of a running animation, without an abrupt change in velocity. The easing function will be\nretained (but you can change it with `ease`). A new speed and duration will be chosen based on what makes the animation\nsmooth. If you retarget multiple animations at once (e.g. x and y), you will need to sync their durations (perhaps to\nthe `timeRemaining` in the old animations).\n\nIf the retargeted animation is still scheduled, the `to` value is replaced. If it is already done, `from` becomes the\nold `to`, `to` and `start` are set to the values provided, and the delay is set to zero.",
                "type": "Time -> Float -> Animation -> Animation"
            },
            {
                "name": "speed",
                "comment": "Set the _average_ speed of an animation. Speed is the rate at which the animation progresses between the `from` and\n`to` values per milisecond. Most easing functions will deviate from the average speed. You do not need to worry about\nthe sign. It is safe to alter the `from` and `to` values after setting speed, but a set speed will be overwritten by\n`duration`.",
                "type": "Float -> Animation -> Animation"
            },
            {
                "name": "static",
                "comment": "Create a static animation that is always the given value.",
                "type": "Float -> Animation"
            },
            {
                "name": "timeElapsed",
                "comment": "Get the time elapsed since the animation started playing (after the end of delay). Will be zero for animations that\nare still scheduled, and is not bounded for animations that are already done.",
                "type": "Time -> Animation -> Time"
            },
            {
                "name": "timeRemaining",
                "comment": "Get the time that the animation has yet to play (or be delayed) before becoming done. Will be zero for animations\nthat are already done.",
                "type": "Time -> Animation -> Time"
            },
            {
                "name": "to",
                "comment": "Set the final value of an animation. The default is 1.\n\nFor animations that are already running, use `retarget`.",
                "type": "Float -> Animation -> Animation"
            },
            {
                "name": "undo",
                "comment": "Run an animation in reverse from its current state, beginning immediately (even if the animation was delayed or has\nbeen done for a while).\n\nUsually you don't want to undo an animation that has been retargeted; just retarget it again. Similarly, undoing an\nundone animation is frequently not what you want.",
                "type": "Time -> Animation -> Animation"
            },
            {
                "name": "velocity",
                "comment": "Get the _current_ velocity of the animation, aproximated by looking 10ms forwards and backwards (the central\ndifference). The velocity may be negative.",
                "type": "Time -> Animation -> Float"
            }
        ],
        "binops": []
    }
]