UNPKG

2.37 kBMarkdownView Raw
1# Installation
2> `npm install --save @types/seedrandom`
3
4# Summary
5This package contains type definitions for seedrandom (https://github.com/davidbau/seedrandom).
6
7# Details
8Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/seedrandom.
9## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/seedrandom/index.d.ts)
10````ts
11// Type definitions for seedrandom 3.0
12// Project: https://github.com/davidbau/seedrandom
13// Definitions by: Kern Handa <https://github.com/kernhanda>
14// Eugene Zaretskiy <https://github.com/EugeneZ>
15// Martin Badin <https://github.com/martin-badin>
16// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
17
18declare namespace seedrandom {
19 type State = object;
20
21 interface Callback {
22 (prng?: prng, shortseed?: string, global?: boolean, state?: State): prng;
23 }
24
25 interface Options {
26 entropy?: boolean | undefined;
27 global?: boolean | undefined;
28 pass?: Callback | undefined;
29 state?: boolean | State | undefined;
30 }
31}
32
33interface prng {
34 (): number;
35 double(): number;
36 int32(): number;
37 quick(): number;
38 state(): seedrandom.State;
39}
40
41interface seedrandom {
42 (seed?: string, options?: seedrandom.Options, callback?: seedrandom.Callback): prng;
43 alea(seed?: string, options?: seedrandom.Options): prng;
44 Alea: new (seed?: string) => prng;
45 tychei(seed?: string, options?: seedrandom.Options): prng;
46 Tychei: new (seed?: string) => prng;
47 xor128(seed?: string, options?: seedrandom.Options): prng;
48 Xor128: new (seed?: string) => prng;
49 xor4096(seed?: string, options?: seedrandom.Options): prng;
50 Xor4096: new (seed?: string) => prng;
51 xorshift7(seed?: string, options?: seedrandom.Options): prng;
52 XorShift7: new (seed?: string) => prng;
53 xorwow(seed?: string, options?: seedrandom.Options): prng;
54 XorWow: new (seed?: string) => prng;
55}
56
57declare const seedrandom: seedrandom;
58
59export = seedrandom;
60
61````
62
63### Additional Details
64 * Last updated: Tue, 06 Jul 2021 16:34:27 GMT
65 * Dependencies: none
66 * Global values: none
67
68# Credits
69These definitions were written by [Kern Handa](https://github.com/kernhanda), [Eugene Zaretskiy](https://github.com/EugeneZ), and [Martin Badin](https://github.com/martin-badin).
70
\No newline at end of file