From cd481a908a2808302504ac9fb70e81602d2a5529 Mon Sep 17 00:00:00 2001 From: Denis Malinochkin Date: Sat, 11 Nov 2017 19:25:17 +0300 Subject: [PATCH] feat(types): Add typings for "arr-union" package --- types/arr-union/arr-union-tests.ts | 7 +++++++ types/arr-union/index.d.ts | 8 ++++++++ types/arr-union/tsconfig.json | 23 +++++++++++++++++++++++ types/arr-union/tslint.json | 1 + 4 files changed, 39 insertions(+) create mode 100644 types/arr-union/arr-union-tests.ts create mode 100644 types/arr-union/index.d.ts create mode 100644 types/arr-union/tsconfig.json create mode 100644 types/arr-union/tslint.json diff --git a/types/arr-union/arr-union-tests.ts b/types/arr-union/arr-union-tests.ts new file mode 100644 index 0000000000..7e46a3787e --- /dev/null +++ b/types/arr-union/arr-union-tests.ts @@ -0,0 +1,7 @@ +import union = require('arr-union'); + +// $ExpectType string[] +union(['a'], ['b', 'c'], ['d', 'e', 'f']); + +// $ExpectType number[] +union([1, 1], [2, 3]); diff --git a/types/arr-union/index.d.ts b/types/arr-union/index.d.ts new file mode 100644 index 0000000000..5893a55361 --- /dev/null +++ b/types/arr-union/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for arr-union 3.1 +// Project: https://github.com/jonschlinkert/arr-union +// Definitions by: mrmlnc +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function union(...arrays: Array>): T[]; + +export = union; diff --git a/types/arr-union/tsconfig.json b/types/arr-union/tsconfig.json new file mode 100644 index 0000000000..64a3b1efed --- /dev/null +++ b/types/arr-union/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "arr-union-tests.ts" + ] +} diff --git a/types/arr-union/tslint.json b/types/arr-union/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/arr-union/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }