import { InstanceIOValue } from "../types"; import { Vec } from "./vector"; export declare enum AutoEasingLoopStyle { /** Time will go from 0 -> 1 then stop at 1 */ NONE = 1, /** Time will go from 0 -> infinity */ CONTINUOUS = 4, /** Time will continuously go 0 -> 1 then 0 -> 1 then 0 -> 1 etc etc */ REPEAT = 2, /** Time will continously go 0 -> 1 then 1 -> 0 then 0 -> 1 then 1 -> 0 etc etc */ REFLECT = 3 } /** * This defines a GPU enabled easing method that will be executed on the GPU to maneuver * */ export interface IAutoEasingMethod { /** An easing method that should produce IDENTICAL values to the values of the gpu easing method using the exact same parameters */ cpu(start: T, end: T, t: number, out?: T): T; /** This adds a delay to the starting time of an easing change */ delay: number; /** This is how long the easing method should last */ duration: number; /** * An easing method written in shader language that should produce IDENTICAL * values to the values of the cpu easing method using the exact same parameters. */ gpu: string; /** * This defines the looping style of the easing. */ loop: AutoEasingLoopStyle; /** * This shall be the name of the easing method as it appears in the spu shader. * BE WARNED: This name is used to dedup the methods created on the shader. So, * if you use the same name as another ease method used on a single layer, you run * the risk of one overriding the other with an undefined chance of who wins. */ methodName: string; /** * A unique identifier for the auto easing method. */ uid: number; /** * This lets you modify some auto easing validation rules. */ validation?: { ignoreEndValueCheck?: boolean; ignoreOverTimeCheck?: boolean; }; } /** * Class of base AutoEasingMethods as well as helper constructs for making the methods. */ export declare class AutoEasingMethod implements IAutoEasingMethod { /** * Autoeasing methods for linear easing */ static immediate(duration: number, delay?: number, loop?: AutoEasingLoopStyle): IAutoEasingMethod; /** * Autoeasing methods for linear easing */ static linear(duration: number, delay?: number, loop?: AutoEasingLoopStyle): IAutoEasingMethod; /** * Auto easing for Accelerating to end */ static easeInQuad(duration: number, delay?: number, loop?: AutoEasingLoopStyle): IAutoEasingMethod; /** * Auto easing for decelerating to end */ static easeOutQuad(duration: number, delay?: number, loop?: AutoEasingLoopStyle): IAutoEasingMethod; /** * Auto easing for Accelerate to mid, then decelerate to end */ static easeInOutQuad(duration: number, delay?: number, loop?: AutoEasingLoopStyle): IAutoEasingMethod; /** * Auto easing for Slower acceleration */ static easeInCubic(duration: number, delay?: number, loop?: AutoEasingLoopStyle): IAutoEasingMethod; /** * Auto easing for Slower deceleration */ static easeOutCubic(duration: number, delay?: number, loop?: AutoEasingLoopStyle): IAutoEasingMethod; /** * Auto easing for Slower acceleration to mid, and slower deceleration to end */ static easeInOutCubic(duration: number, delay?: number, loop?: AutoEasingLoopStyle): IAutoEasingMethod; /** * Auto easing for even Slower acceleration to end */ static easeInQuart(duration: number, delay?: number, loop?: AutoEasingLoopStyle): IAutoEasingMethod; /** * Auto easing for even Slower deceleration to end */ static easeOutQuart(duration: number, delay?: number, loop?: AutoEasingLoopStyle): IAutoEasingMethod; /** * Auto easing for even Slower acceleration to mid, and even slower deceleration to end */ static easeInOutQuart(duration: number, delay?: number, loop?: AutoEasingLoopStyle): IAutoEasingMethod; /** * Auto easing for super slow accelerating to the end */ static easeInQuint(duration: number, delay?: number, loop?: AutoEasingLoopStyle): IAutoEasingMethod; /** * Auto easing for super slow decelerating to the end */ static easeOutQuint(duration: number, delay?: number, loop?: AutoEasingLoopStyle): IAutoEasingMethod; /** * Auto easing for super slow accelerating to mid and super slow decelerating to the end */ static easeInOutQuint(duration: number, delay?: number, loop?: AutoEasingLoopStyle): IAutoEasingMethod; /** * Auto easing for elastic effect */ static easeOutElastic(duration: number, delay?: number, loop?: AutoEasingLoopStyle): IAutoEasingMethod; /** * Auto easing for retracting first then shooting to the end */ static easeBackIn(duration: number, delay?: number, loop?: AutoEasingLoopStyle): IAutoEasingMethod; /** * Auto easing for overshooting at the end */ static easeBackOut(duration: number, delay?: number, loop?: AutoEasingLoopStyle): IAutoEasingMethod; /** * Auto easing for overshooting at the end */ static easeBackInOut(duration: number, delay?: number, loop?: AutoEasingLoopStyle): IAutoEasingMethod; /** * This is an easing method that performs a sinusoidal wave where the amplitude is * (start - end) * 2 and the wave starts at the start value. * * This is intended to work best with the CONTINUOUS loop style. */ static continuousSinusoidal(duration: number, delay?: number, loop?: AutoEasingLoopStyle): IAutoEasingMethod; static slerpQuatLinear(duration: number, delay?: number, loop?: AutoEasingLoopStyle): IAutoEasingMethod; static slerpQuatInQuad(duration: number, delay?: number, loop?: AutoEasingLoopStyle): IAutoEasingMethod; static slerpQuatOutQuad(duration: number, delay?: number, loop?: AutoEasingLoopStyle): IAutoEasingMethod; static slerpQuatInOutQuad(duration: number, delay?: number, loop?: AutoEasingLoopStyle): IAutoEasingMethod; static slerpQuatInCubic(duration: number, delay?: number, loop?: AutoEasingLoopStyle): IAutoEasingMethod; static slerpQuatOutCubic(duration: number, delay?: number, loop?: AutoEasingLoopStyle): IAutoEasingMethod; static slerpQuatInOutCubic(duration: number, delay?: number, loop?: AutoEasingLoopStyle): IAutoEasingMethod; static slerpQuatInQuart(duration: number, delay?: number, loop?: AutoEasingLoopStyle): IAutoEasingMethod; static slerpQuatOutQuart(duration: number, delay?: number, loop?: AutoEasingLoopStyle): IAutoEasingMethod; static slerpQuatInOutQuart(duration: number, delay?: number, loop?: AutoEasingLoopStyle): IAutoEasingMethod; static slerpQuatInQuint(duration: number, delay?: number, loop?: AutoEasingLoopStyle): IAutoEasingMethod; static slerpQuatOutQuint(duration: number, delay?: number, loop?: AutoEasingLoopStyle): IAutoEasingMethod; static slerpQuatInOutQuint(duration: number, delay?: number, loop?: AutoEasingLoopStyle): IAutoEasingMethod; static slerpQuatOutElastic(duration: number, delay?: number, loop?: AutoEasingLoopStyle): IAutoEasingMethod; static slerpQuatBackIn(duration: number, delay?: number, loop?: AutoEasingLoopStyle): IAutoEasingMethod; static slerpQuatBackOut(duration: number, delay?: number, loop?: AutoEasingLoopStyle): IAutoEasingMethod; static slerpQuatBackInOut(duration: number, delay?: number, loop?: AutoEasingLoopStyle): IAutoEasingMethod; /** A uid for the easing method */ uid: number; /** The easing method for the cpu */ cpu: IAutoEasingMethod["cpu"]; /** Time before a delay */ delay: number; /** The time in ms is takes to complete the animation */ duration: number; /** The easing method on the GPU */ gpu: IAutoEasingMethod["gpu"]; /** The looping style of the animation */ loop: AutoEasingLoopStyle; /** Method name of the ease function on the gpu */ methodName: string; constructor(cpu: IAutoEasingMethod["cpu"], gpu: IAutoEasingMethod["gpu"], duration?: number, method?: string); }