Added typings for array-unique

This commit is contained in:
CSLTech 2018-03-15 10:13:56 -04:00
parent 52bde4982f
commit a69c902e93
4 changed files with 45 additions and 0 deletions

View File

@ -0,0 +1,9 @@
import arrayUnique = require("array-unique");
arrayUnique([1, 1, 2, 3, 3]);
arrayUnique(["foo", "foo", "bar", "foo"]);
arrayUnique.immutable([1, 1, 2, 3, 3]);
arrayUnique.immutable(["foo", "foo", "bar", "foo"]);

12
types/array-unique/index.d.ts vendored Normal file
View File

@ -0,0 +1,12 @@
// Type definitions for array-unique 0.3
// Project: https://github.com/jonschlinkert/array-unique
// Definitions by: Michaël St-Georges <https://github.com/CSLTech>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare function arrayUnique<T>(arr: T[]): T[];
declare namespace arrayUnique {
function immutable<T>(arr: ReadonlyArray<T>): T[];
}
export = arrayUnique;

View 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",
"array-unique-tests.ts"
]
}

View File

@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }