Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Length

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

example
A basic set of divisions ```ts const length = new Length({ base: 10 }); length.tiny; length.smallest; length.smaller; length.small; length.normal; // -> 10 length.large; length.larger; length.largest; length.huge; ```
example
Customise scaling, reduces the range of the divisions ```ts const length = new Length({ base: 16, scale: Scale.PerfectFifth }); ```
example
Customise certain stops (or all of them `100` to `900`) ```ts const length = new Length({ base: { 500: 16, 600: 24, 700: 48 }}); ```

Hierarchy

Implements

Index

Constructors

constructor

  • new Length(__namedParameters: object): Length

Accessors

100

  • get 100(): number

200

  • get 200(): number

300

  • get 300(): number

400

  • get 400(): number

500

  • get 500(): number

600

  • get 600(): number

700

  • get 700(): number

800

  • get 800(): number

900

  • get 900(): number

huge

  • get huge(): number

large

  • get large(): number

larger

  • get larger(): number

largest

  • get largest(): number

normal

  • get normal(): number

small

  • get small(): number

smaller

  • get smaller(): number

smallest

  • get smallest(): number

tiny

  • get tiny(): number

Methods

__@toPrimitive

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