mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
initial commit (#37016)
This commit is contained in:
parent
9bfb0f9df9
commit
fb3854f2c0
25
types/random-normal/index.d.ts
vendored
Normal file
25
types/random-normal/index.d.ts
vendored
Normal 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;
|
||||
11
types/random-normal/random-normal-tests.ts
Normal file
11
types/random-normal/random-normal-tests.ts
Normal 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
|
||||
23
types/random-normal/tsconfig.json
Normal file
23
types/random-normal/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",
|
||||
"random-normal-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/random-normal/tslint.json
Normal file
1
types/random-normal/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user