3

I want to use the javascript library

seedrandom.js

in a TypeScript project yet can't figure out how to write a type definition for this lib which extends the standard javascript Math library with an additional method:

Math.seedrandom();
dorjeduck
  • 7,624
  • 11
  • 52
  • 66

1 Answers1

6

Just add to the Math interface

interface Math {
    seedrandom(seed?: string);
}

Math.seedrandom();
basarat
  • 261,912
  • 58
  • 460
  • 511