Add types for random-int

This commit is contained in:
Dimitri Benin
2018-12-03 00:35:54 +01:00
parent efbcbdebaf
commit efaad74d08
4 changed files with 39 additions and 0 deletions
+9
View File
@@ -0,0 +1,9 @@
// Type definitions for random-int 1.0
// Project: https://github.com/sindresorhus/random-int
// Definitions by: BendingBender <https://github.com/BendingBender>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export = randomInt;
declare function randomInt(max: number): number;
declare function randomInt(min: number, max: number): number; // tslint:disable-line unified-signatures
+6
View File
@@ -0,0 +1,6 @@
import randomInt = require('random-int');
// $ExpectType number
randomInt(5);
// $ExpectType number
randomInt(10, 100);
+23
View File
@@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"random-int-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }