From 192162857c7322d95504d10c9d2067e22f7e5bd0 Mon Sep 17 00:00:00 2001 From: Daniel Cassidy Date: Wed, 3 Apr 2019 13:24:54 +0100 Subject: [PATCH] Add type definitions for math-sign. --- types/math-sign/index.d.ts | 8 ++++++++ types/math-sign/math-sign-tests.ts | 7 +++++++ types/math-sign/tsconfig.json | 23 +++++++++++++++++++++++ types/math-sign/tslint.json | 1 + 4 files changed, 39 insertions(+) create mode 100644 types/math-sign/index.d.ts create mode 100644 types/math-sign/math-sign-tests.ts create mode 100644 types/math-sign/tsconfig.json create mode 100644 types/math-sign/tslint.json diff --git a/types/math-sign/index.d.ts b/types/math-sign/index.d.ts new file mode 100644 index 0000000000..702af7cd81 --- /dev/null +++ b/types/math-sign/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for math-sign 1.0 +// Project: https://github.com/sindresorhus/math-sign#readme +// Definitions by: Daniel Cassidy +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function sign(x: number): number; + +export = sign; diff --git a/types/math-sign/math-sign-tests.ts b/types/math-sign/math-sign-tests.ts new file mode 100644 index 0000000000..36e1779827 --- /dev/null +++ b/types/math-sign/math-sign-tests.ts @@ -0,0 +1,7 @@ +import sign = require("math-sign"); + +// $ExpectType number +sign(5); + +// $ExpectType number +sign(-2); diff --git a/types/math-sign/tsconfig.json b/types/math-sign/tsconfig.json new file mode 100644 index 0000000000..5ae9ac0698 --- /dev/null +++ b/types/math-sign/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-sign-tests.ts" + ] +} diff --git a/types/math-sign/tslint.json b/types/math-sign/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/math-sign/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }