feat: Add typings for math-random (#42082)

* feat: Add typings for math-random

Signed-off-by: Richie Bendall <richiebendall@gmail.com>

* fix: `cryptographic` should be true | undefined

Signed-off-by: Richie Bendall <richiebendall@gmail.com>
This commit is contained in:
Richie Bendall
2020-02-05 10:51:24 -08:00
committed by GitHub
parent 0c432c26d5
commit d05a9de5c6
4 changed files with 39 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
// Type definitions for math-random 1.0
// Project: https://github.com/michaelrhodes/math-random#readme
// Definitions by: Richie Bendall <https://github.com/Richienb>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare const mathRandom: {
(): number;
cryptographic: true | undefined;
};
export = mathRandom;
+4
View File
@@ -0,0 +1,4 @@
import mathRandom = require("math-random");
mathRandom(); // $ExpectType number
mathRandom.cryptographic; // $ExpectType true | undefined
+23
View File
@@ -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"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }