diff --git a/types/math-random/index.d.ts b/types/math-random/index.d.ts new file mode 100644 index 0000000000..93e67c2bf9 --- /dev/null +++ b/types/math-random/index.d.ts @@ -0,0 +1,11 @@ +// Type definitions for math-random 1.0 +// Project: https://github.com/michaelrhodes/math-random#readme +// Definitions by: Richie Bendall +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare const mathRandom: { + (): number; + cryptographic: true | undefined; +}; + +export = mathRandom; diff --git a/types/math-random/math-random-tests.ts b/types/math-random/math-random-tests.ts new file mode 100644 index 0000000000..9ef613bdbc --- /dev/null +++ b/types/math-random/math-random-tests.ts @@ -0,0 +1,4 @@ +import mathRandom = require("math-random"); + +mathRandom(); // $ExpectType number +mathRandom.cryptographic; // $ExpectType true | undefined diff --git a/types/math-random/tsconfig.json b/types/math-random/tsconfig.json new file mode 100644 index 0000000000..cf5af81818 --- /dev/null +++ b/types/math-random/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "math-random-tests.ts" + ] +} diff --git a/types/math-random/tslint.json b/types/math-random/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/math-random/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }