mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
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:
parent
0c432c26d5
commit
d05a9de5c6
11
types/math-random/index.d.ts
vendored
Normal file
11
types/math-random/index.d.ts
vendored
Normal 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
types/math-random/math-random-tests.ts
Normal file
4
types/math-random/math-random-tests.ts
Normal file
@ -0,0 +1,4 @@
|
||||
import mathRandom = require("math-random");
|
||||
|
||||
mathRandom(); // $ExpectType number
|
||||
mathRandom.cryptographic; // $ExpectType true | undefined
|
||||
23
types/math-random/tsconfig.json
Normal file
23
types/math-random/tsconfig.json
Normal 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
types/math-random/tslint.json
Normal file
1
types/math-random/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user