initial commit (#37016)

This commit is contained in:
Darius I. Karel 2019-07-22 13:10:19 -07:00 committed by Wesley Wigham
parent 9bfb0f9df9
commit fb3854f2c0
4 changed files with 60 additions and 0 deletions

25
types/random-normal/index.d.ts vendored Normal file
View File

@ -0,0 +1,25 @@
// Type definitions for random-normal 1.0
// Project: https://github.com/mock-end/random-normal
// Definitions by: Darius I. Karel <https://github.com/dikarel>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/**
* Normal distribution options
*/
interface Options {
/** The mean of the normal distribution. Defaults to 0 */
mean?: number;
/** The standard deviation of the normal distribution. Defaults to 1 */
dev?: number;
}
/**
* Return a [normally-distributed](https://en.wikipedia.org/wiki/Normal_distribution)
* random number. By default this, starts with a mean of 0 and a standard
* deviation of 1 which is the standard normal distribution.
* @param options Controls the shape of the normal distribution
*/
declare function randomNormal(options?: Options): number;
export = randomNormal;

View File

@ -0,0 +1,11 @@
import randomNormal = require('random-normal');
// No options specified
randomNormal(); // $ExpectType number
// All options specified
randomNormal({ mean: 5, dev: 7 }); // $ExpectType number
// Partial options specified
randomNormal({ dev: 7 }); // $ExpectType number
randomNormal({ mean: 5 }); // $ExpectType number

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",
"random-normal-tests.ts"
]
}

View File

@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }