/** * A collection of easing functions. * * Parts of this collection are taken from D3.js library (https://d3js.org/) */ import type { Time } from "./Animation"; /** * An easing function: takes animation progress from `0` to `1` and returns * the eased progress. */ export declare type Easing = (time: Time) => Time; /** * What an easing function is, by name: the base easing, which way it applies, * and whether it goes there and back. Only functions made from the ones here * have one - a hand-written easing cannot be named. * * @since 5.20.8 */ export interface IEasingInfo { easing: string; ease?: "out" | "inOut"; yoyo?: boolean; } /** * Returns what an easing function is, by name, or `undefined` for one that was * not made from the functions here. * * @param easing Easing function * @return Its name and options * @since 5.20.8 */ export declare function easingInfo(easing: Easing | undefined): IEasingInfo | undefined; /** * The functions below are from D3.js library (https://d3js.org/) * * ---------------------------------------------------------------------------- * Copyright 2017 Mike Bostock * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3. Neither the name of the copyright holder nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * ---------------------------------------------------------------------------- * @hidden */ /** * No easing: the animation runs at a constant speed. */ export declare function linear(t: Time): Time; /** * Starts slowly and speeds up (progress squared). */ export declare function quad(t: Time): Time; /** * Starts slowly and speeds up, more sharply than `quad` (progress cubed). */ export declare function cubic(t: Time): Time; /** * Raises progress to the power `e`: `2` is the same as `quad`, `3` as * `cubic`. * * @param t Progress, from `0` to `1` * @param e Exponent * @return Eased progress */ export declare function pow(t: Time, e: number): Time; /** * Barely moves at first, then speeds up sharply (exponential). */ export declare function exp(t: Time): Time; /** * Starts gently and speeds up, following a sine curve. */ export declare function sine(t: Time): Time; /** * Starts slowly and speeds up steeply near the end, following a quarter * circle. */ export declare function circle(t: Time): Time; /** * ============================================================================ * TRANSFORMERS * ============================================================================ * @hidden */ /** * Makes an easing go there and back: it reaches the end halfway through and * returns to the start. * * @param ease Easing function * @return Easing function */ export declare function yoyo(ease: Easing): Easing; /** * Turns an easing around, so it starts fast and ends slowly. The easings * here ease in (start slowly) unless wrapped in `out()` or `inOut()`. * * @param ease Easing function * @return Easing function */ export declare function out(ease: Easing): Easing; /** * Applies an easing at both ends: it eases in for the first half and out for * the second. * * @param ease Easing function * @return Easing function */ export declare function inOut(ease: Easing): Easing; /** * Bounces at the start before heading to the end. `out(bounce)` bounces at * the end instead, like a dropped ball. */ export declare function bounce(t: Time): Time; /** * Swings back and forth with growing swings before reaching the end, like a * spring. `out(elastic)` springs past the end and settles instead. */ export declare function elastic(t: Time): Time; /** * Returns the easing function called `name` (`"linear"`, `"quad"`, `"cubic"`, * `"exp"`, `"sine"`, `"circle"`, `"bounce"` or `"elastic"`), eased in, out or * both ways. An unknown name gives `linear`. * * @param name Easing name * @param mode `"in"` (default), `"out"` or `"inOut"` * @return Easing function * @since 5.20.8 */ export declare function byName(name?: string, mode?: "in" | "out" | "inOut"): Easing; //# sourceMappingURL=Ease.d.ts.map