intern-Assignment/Node-Assignments/practice-2/node_modules/unique-random/index.d.ts

17 lines
408 B
TypeScript
Raw Normal View History

2025-01-31 09:50:39 +00:00
/**
Generate random numbers that are consecutively unique.
@returns A function, that when called, will return a random number that is never the same as the previous.
@example
```
import uniqueRandom from 'unique-random';
const random = uniqueRandom(1, 10);
console.log(random(), random(), random());
//=> 5 2 6
```
*/
export default function uniqueRandom(minimum: number, maximum: number): () => number;