forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
seedrandom.d.ts
43 lines (36 loc) · 1.56 KB
/
seedrandom.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Type definitions for seedrandom 2.4.2
// Project: https://github.com/davidbau/seedrandom
// Definitions by: Kern Handa <https://github.com/kernhanda>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare type seedrandomStateType = boolean | (() => prng);
interface prng {
new(seed?: string, options?: seedRandomOptions, callback?: any): prng;
(): number;
quick(): number;
int32(): number;
double(): number;
state(): () => prng;
}
interface seedrandom_prng {
(seed?: string, options?: seedRandomOptions, callback?: any): prng;
alea: (seed?: string, options?: seedRandomOptions, callback?: seedrandomCallback) => prng;
xor128: (seed?: string, options?: seedRandomOptions, callback?: seedrandomCallback) => prng;
tychei: (seed?: string, options?: seedRandomOptions, callback?: seedrandomCallback) => prng;
xorwow: (seed?: string, options?: seedRandomOptions, callback?: seedrandomCallback) => prng;
xor4096: (seed?: string, options?: seedRandomOptions, callback?: seedrandomCallback) => prng;
xorshift7: (seed?: string, options?: seedRandomOptions, callback?: seedrandomCallback) => prng;
quick: (seed?: string, options?: seedRandomOptions, callback?: seedrandomCallback) => prng;
}
interface seedrandomCallback {
(prng?: prng, shortseed?: string, global?: boolean, state?: seedrandomStateType): prng;
}
interface seedRandomOptions {
entropy?: boolean;
'global'?: boolean;
state?: seedrandomStateType;
pass?: seedrandomCallback;
}
declare var seedrandom: seedrandom_prng;
declare module "seedrandom" {
export = seedrandom;
}