mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
Add type def for clamp (#43011)
Co-authored-by: Adam Zerella <adamzerella@users.noreply.github.com>
This commit is contained in:
parent
f92c1d4227
commit
9582dc2bb7
6
types/clamp/clamp-tests.ts
Normal file
6
types/clamp/clamp-tests.ts
Normal file
@ -0,0 +1,6 @@
|
||||
import clamp = require("clamp");
|
||||
|
||||
clamp(0, -100, 100);
|
||||
clamp(0, 100, -100);
|
||||
clamp(100, 0, 50);
|
||||
clamp(50, 100, 150);
|
||||
8
types/clamp/index.d.ts
vendored
Normal file
8
types/clamp/index.d.ts
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
// Type definitions for clamp 1.0
|
||||
// Project: https://github.com/hughsk/clamp
|
||||
// Definitions by: Adam Zerella <https://github.com/adamzerella>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare function clamp(value: number, min: number, max: number): number;
|
||||
|
||||
export = clamp;
|
||||
25
types/clamp/tsconfig.json
Normal file
25
types/clamp/tsconfig.json
Normal file
@ -0,0 +1,25 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [
|
||||
|
||||
],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"clamp-tests.ts"
|
||||
]
|
||||
}
|
||||
3
types/clamp/tslint.json
Normal file
3
types/clamp/tslint.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user