diff --git a/types/clamp/clamp-tests.ts b/types/clamp/clamp-tests.ts new file mode 100644 index 0000000000..255e06ab1e --- /dev/null +++ b/types/clamp/clamp-tests.ts @@ -0,0 +1,6 @@ +import clamp = require("clamp"); + +clamp(0, -100, 100); +clamp(0, 100, -100); +clamp(100, 0, 50); +clamp(50, 100, 150); diff --git a/types/clamp/index.d.ts b/types/clamp/index.d.ts new file mode 100644 index 0000000000..cd61921836 --- /dev/null +++ b/types/clamp/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for clamp 1.0 +// Project: https://github.com/hughsk/clamp +// Definitions by: Adam Zerella +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function clamp(value: number, min: number, max: number): number; + +export = clamp; diff --git a/types/clamp/tsconfig.json b/types/clamp/tsconfig.json new file mode 100644 index 0000000000..ba1256bdfd --- /dev/null +++ b/types/clamp/tsconfig.json @@ -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" + ] +} diff --git a/types/clamp/tslint.json b/types/clamp/tslint.json new file mode 100644 index 0000000000..e60c15844f --- /dev/null +++ b/types/clamp/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} \ No newline at end of file