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]);