mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
28 lines
571 B
TypeScript
28 lines
571 B
TypeScript
import Randoma = require('randoma');
|
|
|
|
const random = new Randoma({ seed: 10 });
|
|
new Randoma({ seed: '🦄' });
|
|
new Randoma({ seed: Randoma.seed() });
|
|
|
|
// $ExpectType number
|
|
random.integer();
|
|
// $ExpectType number
|
|
random.integerInRange(0, 1);
|
|
// $ExpectType number
|
|
random.float();
|
|
// $ExpectType number
|
|
random.floatInRange(0, 1);
|
|
// $ExpectType boolean
|
|
random.boolean();
|
|
// $ExpectType string
|
|
random.arrayItem(['🦄']);
|
|
// $ExpectType Date
|
|
random.date();
|
|
// $ExpectType Date
|
|
random.dateInRange(new Date(), new Date());
|
|
|
|
random
|
|
.color(0.5)
|
|
.hex()
|
|
.toString();
|