diff --git a/types/math-trunc/index.d.ts b/types/math-trunc/index.d.ts new file mode 100644 index 0000000000..a2004ba29b --- /dev/null +++ b/types/math-trunc/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for math-trunc 1.0 +// Project: https://github.com/kevva/math-trunc#readme +// Definitions by: Daniel Cassidy +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function trunc(val: number): number; + +export = trunc; diff --git a/types/math-trunc/math-trunc-tests.ts b/types/math-trunc/math-trunc-tests.ts new file mode 100644 index 0000000000..d8427455af --- /dev/null +++ b/types/math-trunc/math-trunc-tests.ts @@ -0,0 +1,7 @@ +import trunc = require("math-trunc"); + +// $ExpectType number +trunc(13.37); + +// $ExpectType number +trunc(-0.123); diff --git a/types/math-trunc/tsconfig.json b/types/math-trunc/tsconfig.json new file mode 100644 index 0000000000..d8033bf6ed --- /dev/null +++ b/types/math-trunc/tsconfig.json @@ -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", + "math-trunc-tests.ts" + ] +} diff --git a/types/math-trunc/tslint.json b/types/math-trunc/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/math-trunc/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }