From ccce0edf6d9dd01a3479daf4b98da3dc7d0bd442 Mon Sep 17 00:00:00 2001 From: Dimitri Benin Date: Mon, 3 Dec 2018 00:26:33 +0100 Subject: [PATCH] Add types for unique-random-array --- types/unique-random-array/index.d.ts | 8 +++++++ types/unique-random-array/tsconfig.json | 23 +++++++++++++++++++ types/unique-random-array/tslint.json | 1 + .../unique-random-array-tests.ts | 6 +++++ 4 files changed, 38 insertions(+) create mode 100644 types/unique-random-array/index.d.ts create mode 100644 types/unique-random-array/tsconfig.json create mode 100644 types/unique-random-array/tslint.json create mode 100644 types/unique-random-array/unique-random-array-tests.ts diff --git a/types/unique-random-array/index.d.ts b/types/unique-random-array/index.d.ts new file mode 100644 index 0000000000..7e4ddacb0f --- /dev/null +++ b/types/unique-random-array/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for unique-random-array 1.0 +// Project: https://github.com/sindresorhus/unique-random-array#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = uniqueRandomArray; + +declare function uniqueRandomArray(input: T[]): () => T; diff --git a/types/unique-random-array/tsconfig.json b/types/unique-random-array/tsconfig.json new file mode 100644 index 0000000000..40257f7e47 --- /dev/null +++ b/types/unique-random-array/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", + "unique-random-array-tests.ts" + ] +} diff --git a/types/unique-random-array/tslint.json b/types/unique-random-array/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/unique-random-array/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/unique-random-array/unique-random-array-tests.ts b/types/unique-random-array/unique-random-array-tests.ts new file mode 100644 index 0000000000..de4563532c --- /dev/null +++ b/types/unique-random-array/unique-random-array-tests.ts @@ -0,0 +1,6 @@ +import uniqueRandomArray = require('unique-random-array'); + +// $ExpectType () => number +uniqueRandomArray([1, 2, 3, 4]); +// $ExpectType () => string | number +uniqueRandomArray(["1", 2, 3, 4]);