diff --git a/brorand/brorand.d.ts b/brorand/brorand.d.ts new file mode 100644 index 000000000..aa0e6ff5d --- /dev/null +++ b/brorand/brorand.d.ts @@ -0,0 +1,30 @@ +// Type definitions for Brorand v1.0.5 +// Project: https://github.com/indutny/brorand +// Definitions by: Ilya Mochalov +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module "brorand" { + type rand = {getByte: () => number}; + + interface RandStatic { + new (rand: rand): RandInstance; + } + + interface RandInstance { + rand: rand; + generate(len: number): Buffer|Uint8Array; + } + + interface BrorandStatic { + (len: number): Buffer|Uint8Array; + Rand: RandStatic; + } + + namespace Brorand {} + + let Brorand: BrorandStatic; + + export = Brorand; +}