Merge pull request #34407 from djcsdy/math-trunc

[math-trunc] Add type definitions
This commit is contained in:
Benjamin Lichtman
2019-04-02 17:17:06 -07:00
committed by GitHub
4 changed files with 39 additions and 0 deletions
+8
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;
+7
View File
@@ -0,0 +1,7 @@
import trunc = require("math-trunc");
// $ExpectType number
trunc(13.37);
// $ExpectType number
trunc(-0.123);
+23
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"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }