mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
* Remove incorrect callbacks, change state type
Seedrandom's state function does not return a function. It returns an object intended to be opaque, which I don't know how to describe in TS. It's serializable (unlike a function), so I made it just be an empty object. It's properties are unpredictable, but always of a similar shape: { [x]: number, [y]: number, [z]: number[] }. x,y, and z vary from implementation, and users are not intended to know what they are. The important thing is that it can be passed back to the state option when making a new instance of seedrandom, and that it be serializable (which the previous implementation was not).
In addition, seedrandom's alternate algorithms do not take a third "callback" argument, so I removed it.
* Adding attribution
|
||
|---|---|---|
| .. | ||
| index.d.ts | ||
| seedrandom-tests.ts | ||
| tsconfig.json | ||
| tslint.json | ||