mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 22:30:01 +00:00
Add types for unique-random-array
This commit is contained in:
8
types/unique-random-array/index.d.ts
vendored
Normal file
8
types/unique-random-array/index.d.ts
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
// Type definitions for unique-random-array 1.0
|
||||
// Project: https://github.com/sindresorhus/unique-random-array#readme
|
||||
// Definitions by: BendingBender <https://github.com/BendingBender>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export = uniqueRandomArray;
|
||||
|
||||
declare function uniqueRandomArray<T>(input: T[]): () => T;
|
||||
23
types/unique-random-array/tsconfig.json
Normal file
23
types/unique-random-array/tsconfig.json
Normal file
@@ -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"
|
||||
]
|
||||
}
|
||||
1
types/unique-random-array/tslint.json
Normal file
1
types/unique-random-array/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
6
types/unique-random-array/unique-random-array-tests.ts
Normal file
6
types/unique-random-array/unique-random-array-tests.ts
Normal file
@@ -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]);
|
||||
Reference in New Issue
Block a user