Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Timing

Provides a way to create a set of divisions that have nice aliases to access them:

example
A basic set of divisions ```ts const timing = new Timing({ base: 200 }); timing.snail; // -> 39.5 timing.slowest; // -> 59.25 timing.slower; // -> 88.88 timing.slow; // -> 133.33 timing.normal; // -> 200 timing.fast; // -> 300 timing.faster; // -> 450 timing.fastest; // -> 675 timing.lightening; // -> 1012.5 ```
example
Customise scaling, increases the range of the divisions ```ts const timing = new Timing({ base: 100, scale: (2 as Scale) }); timing.snail; // -> 6.25 timing.slowest; // -> 12.5 timing.slower; // -> 25 timing.slow; // -> 50 timing.normal; // -> 100 timing.fast; // -> 200 timing.faster; // -> 400 timing.fastest; // -> 800 timing.lightening; // -> 1600 ```
example
Customise certain stops (or all of them `100` to `900`) ```ts const timing = new Timing({ base: { 100: 40, 200: 60, 300: 85, 400: 135, 500: 200, 900: 1000 }}); timing.snail; // -> 40 ( 39.5 timing.slowest; // -> 60 ( 59.25 timing.slower; // -> 85 ( 88.88) timing.slow; // -> 135 (133.33) timing.normal; // -> 200 timing.fast; // -> 300 timing.faster; // -> 450 timing.fastest; // -> 675 timing.lightening; // -> 1000 (1012.5) ```

Hierarchy

Implements

Index

Constructors

constructor

  • new Timing(__namedParameters?: object): Timing

Accessors

100

  • get 100(): Milliseconds

200

  • get 200(): Milliseconds

300

  • get 300(): Milliseconds

400

  • get 400(): Milliseconds

500

  • get 500(): Milliseconds

600

  • get 600(): Milliseconds

700

  • get 700(): Milliseconds

800

  • get 800(): Milliseconds

900

  • get 900(): Milliseconds

fast

  • get fast(): number

faster

  • get faster(): number

fastest

  • get fastest(): number

lightening

  • get lightening(): number

normal

  • get normal(): number

slow

  • get slow(): number

slower

  • get slower(): number

slowest

  • get slowest(): number

snail

  • get snail(): number

Methods

__@toPrimitive

  • __@toPrimitive(hint: "string" | "number" | "default"): number | string