Add type definitions for math-trunc.

This commit is contained in:
Daniel Cassidy 2019-04-02 19:09:07 +01:00
parent 547098699c
commit 0f0fe0ad8c
4 changed files with 39 additions and 0 deletions

8
types/math-trunc/index.d.ts vendored Normal file
View File

@ -0,0 +1,8 @@
// Type definitions for math-trunc 1.0
// Project: https://github.com/kevva/math-trunc#readme
// Definitions by: Daniel Cassidy <https://github.com/djcsdy>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare function trunc(val: number): number;
export = trunc;

View File

@ -0,0 +1,7 @@
import trunc = require("math-trunc");
// $ExpectType number
trunc(13.37);
// $ExpectType number
trunc(-0.123);

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",
"math-trunc-tests.ts"
]
}

View File

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