UNPKG

650 BTypeScriptView Raw
1// Type definitions for Brorand v1.0.5
2// Project: https://github.com/indutny/brorand
3// Definitions by: Ilya Mochalov <https://github.com/chrootsu>
4// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5
6/// <reference types="node" />
7
8
9type rand = { getByte: () => number };
10
11interface RandStatic {
12 new (rand: rand): RandInstance;
13}
14
15interface RandInstance {
16 rand: rand;
17 generate(len: number): Buffer | Uint8Array;
18}
19
20interface BrorandStatic {
21 (len: number): Buffer | Uint8Array;
22 Rand: RandStatic;
23}
24
25declare namespace Brorand { }
26
27declare let Brorand: BrorandStatic;
28
29export = Brorand;