Options
All
  • Public
  • Public/Protected
  • All
Menu

tweedle.js

Index

Type aliases

EasingFunction

EasingFunction: (amount: number) => number

Type declaration

    • (amount: number): number
    • The type for a function that takes a number between 0 and 1 and returns another number between 0 and 1

      Parameters

      • amount: number

      Returns number

InterpolationFunction

InterpolationFunction: (v: number[], k: number) => number

Type declaration

    • (v: number[], k: number): number
    • The type for a function that picks a value by interpolating the elements of the array given.

      Parameters

      • v: number[]
      • k: number

      Returns number

RecursivePartial

RecursivePartial<T>: { [ P in keyof T]?: T[P] extends infer U[] ? RecursivePartial<U>[] : RecursivePartial<T[P]> }

A recursive version of Typescript's Partial<> decorator.

Type parameters

  • T

Variables

Easing

Easing: { Back: { In: any; InOut: any; Out: any }; Bounce: { In: any; InOut: any; Out: any }; Circular: { In: any; InOut: any; Out: any }; Cubic: { In: any; InOut: any; Out: any }; Elastic: { In: any; InOut: any; Out: any }; Exponential: { In: any; InOut: any; Out: any }; Linear: { None: any }; Quadratic: { In: any; InOut: any; Out: any }; Quartic: { In: any; InOut: any; Out: any }; Quintic: { In: any; InOut: any; Out: any }; Sinusoidal: { In: any; InOut: any; Out: any }; Step: { None: any } } = ...

The Ease class provides a collection of easing functions.

These functions take in a parameter between 0 and 1 as the ratio and give out a new ratio.

These are Robert Penner's optimized formulas.

Need help picking one? Check this out!

Type declaration

  • Back: { In: any; InOut: any; Out: any }
    • In:function
      • In(amount: number): number
    • InOut:function
      • InOut(amount: number): number
    • Out:function
      • Out(amount: number): number
  • Bounce: { In: any; InOut: any; Out: any }
    • In:function
      • In(amount: number): number
    • InOut:function
      • InOut(amount: number): number
    • Out:function
      • Out(amount: number): number
  • Circular: { In: any; InOut: any; Out: any }
    • In:function
      • In(amount: number): number
    • InOut:function
      • InOut(amount: number): number
    • Out:function
      • Out(amount: number): number
  • Cubic: { In: any; InOut: any; Out: any }
    • In:function
      • In(amount: number): number
      • Parameters

        • amount: number

        Returns number

    • InOut:function
      • InOut(amount: number): number
      • Parameters

        • amount: number

        Returns number

    • Out:function
      • Out(amount: number): number
      • Parameters

        • amount: number

        Returns number

  • Elastic: { In: any; InOut: any; Out: any }
    • In:function
      • In(amount: number): number
    • InOut:function
      • InOut(amount: number): number
    • Out:function
      • Out(amount: number): number
  • Exponential: { In: any; InOut: any; Out: any }
    • In:function
      • In(amount: number): number
      • Parameters

        • amount: number

        Returns number

    • InOut:function
      • InOut(amount: number): number
    • Out:function
      • Out(amount: number): number
  • Linear: { None: any }
    • None:function
      • None(amount: number): number
      • Parameters

        • amount: number

        Returns number

  • Quadratic: { In: any; InOut: any; Out: any }
    • In:function
      • In(amount: number): number
      • Parameters

        • amount: number

        Returns number

    • InOut:function
      • InOut(amount: number): number
      • Parameters

        • amount: number

        Returns number

    • Out:function
      • Out(amount: number): number
      • Parameters

        • amount: number

        Returns number

  • Quartic: { In: any; InOut: any; Out: any }
    • In:function
      • In(amount: number): number
      • Parameters

        • amount: number

        Returns number

    • InOut:function
      • InOut(amount: number): number
      • Parameters

        • amount: number

        Returns number

    • Out:function
      • Out(amount: number): number
      • Parameters

        • amount: number

        Returns number

  • Quintic: { In: any; InOut: any; Out: any }
    • In:function
      • In(amount: number): number
      • Parameters

        • amount: number

        Returns number

    • InOut:function
      • InOut(amount: number): number
      • Parameters

        • amount: number

        Returns number

    • Out:function
      • Out(amount: number): number
      • Parameters

        • amount: number

        Returns number

  • Sinusoidal: { In: any; InOut: any; Out: any }
    • In:function
      • In(amount: number): number
      • Parameters

        • amount: number

        Returns number

    • InOut:function
      • InOut(amount: number): number
      • Parameters

        • amount: number

        Returns number

    • Out:function
      • Out(amount: number): number
      • Parameters

        • amount: number

        Returns number

  • Step: { None: any }
    • None:function
      • None(amount: number): number
      • Parameters

        • amount: number

        Returns number

Interpolation

Interpolation: { Angle: { Degrees: any; Radians: any }; Color: { HCL: any; HSV: any; RGB: any }; Geom: { Bezier: any; CatmullRom: any; CubicBezier: any; Linear: any; QuadraticBezier: any }; Utils: { Factorial: (n: number) => number; Bernstein: any; CatmullRom: any; HCLJoin: any; HCLLinear: any; HCLSplit: any; HSVJoin: any; HSVLinear: any; HSVsplit: any; Linear: any; RGBLinear: any; RGBsplit: any; WrapLinear: any } } = ...

Object containing common interpolation functions. These functions can be passed in the Tween.interpolation argument and will only affect fields where you gave an array as target value

Type declaration

  • Angle: { Degrees: any; Radians: any }
    • Degrees:function
      • Degrees(v: number[], k: number): number
      • Normalizes angles between 0 and 360 and then rotates the object in the shortest direction.

        Parameters

        • v: number[]
        • k: number

        Returns number

    • Radians:function
      • Radians(v: number[], k: number): number
      • Normalizes angles between 0 and 2pi and then rotates the object in the shortest direction.

        Parameters

        • v: number[]
        • k: number

        Returns number

  • Color: { HCL: any; HSV: any; RGB: any }
    • HCL:function
      • HCL(v: number[], k: number): number
      • Interpolates the color by their Hue, Chroma, and Lightness.

        Parameters

        • v: number[]
        • k: number

        Returns number

    • HSV:function
      • HSV(v: number[], k: number): number
      • Interpolates the color by their Hue, Saturation, and Value.

        Parameters

        • v: number[]
        • k: number

        Returns number

    • RGB:function
      • RGB(v: number[], k: number): number
      • Interpolates the color by their channels Red, Green, and Blue.

        Parameters

        • v: number[]
        • k: number

        Returns number

  • Geom: { Bezier: any; CatmullRom: any; CubicBezier: any; Linear: any; QuadraticBezier: any }
    • Bezier:function
      • Bezier(v: number[], k: number): number
    • CatmullRom:function
      • CatmullRom(v: number[], k: number): number
    • CubicBezier:function
      • CubicBezier(v: number[], k: number): number
      • Assumes your points are a succession of cubic bezier curves where the endpoint of one is the start point of the next one. for example: [Point in the curve, Control point, Control point, Point in the curve, Control point, Control point, Point in the curve]

        Parameters

        • v: number[]
        • k: number

        Returns number

    • Linear:function
      • Linear(v: number[], k: number): number
      • Linear interpolation is like drawing straight lines between the points.

        Parameters

        • v: number[]
        • k: number

        Returns number

    • QuadraticBezier:function
      • QuadraticBezier(v: number[], k: number): number
      • Assumes your points are a succession of quadratic bezier curves where the endpoint of one is the start point of the next one. for example: [Point in the curve, Control point, Point in the curve, Control point, Point in the curve]

        Parameters

        • v: number[]
        • k: number

        Returns number

  • Utils: { Factorial: (n: number) => number; Bernstein: any; CatmullRom: any; HCLJoin: any; HCLLinear: any; HCLSplit: any; HSVJoin: any; HSVLinear: any; HSVsplit: any; Linear: any; RGBLinear: any; RGBsplit: any; WrapLinear: any }
    • Factorial: (n: number) => number
        • (n: number): number
        • Parameters

          • n: number

          Returns number

    • Bernstein:function
      • Bernstein(n: number, i: number): number
    • CatmullRom:function
      • CatmullRom(p0: number, p1: number, p2: number, p3: number, t: number): number
      • Parameters

        • p0: number
        • p1: number
        • p2: number
        • p3: number
        • t: number

        Returns number

    • HCLJoin:function
      • HCLJoin(HCL: AHCL): number
    • HCLLinear:function
      • HCLLinear(color1: number, color2: number, t: number): number
    • HCLSplit:function
      • HCLSplit(color: number): AHCL
    • HSVJoin:function
      • HSVJoin(color: AHSV): number
    • HSVLinear:function
      • HSVLinear(color1: number, color2: number, t: number): number
    • HSVsplit:function
      • HSVsplit(color: number): AHSV
    • Linear:function
      • Linear(p0: number, p1: number, t: number): number
    • RGBLinear:function
      • RGBLinear(color1: number, color2: number, t: number): number
    • RGBsplit:function
      • RGBsplit(color: number): ARGB
    • WrapLinear:function
      • WrapLinear(value1: number, value2: number, t: number, maxValue: number): number
      • Parameters

        • value1: number
        • value2: number
        • t: number
        • maxValue: number

        Returns number

VERSION

VERSION: "2.0.0" = "2.0.0"

Constant with the hardcoded version of the app

Functions

NOW

  • NOW(): number
  • Polyfilled function to get the current time in miliseconds. It tries to use process.hrtime(), performance.now(), Date.now() or new Date().getTime() in that order.

    Returns number

Generated using TypeDoc