Skip to content

Commit 7616528

Browse files
BendingBenderweswigham
authored andcommitted
arr-diff] Add types (DefinitelyTyped#31795)
1 parent ee8ee54 commit 7616528

File tree

4 files changed

+40
-0
lines changed

4 files changed

+40
-0
lines changed

types/arr-diff/arr-diff-tests.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import diff = require('arr-diff');
2+
3+
const a = ['a', 'b', 'c', 'd'];
4+
const b = [1, 2];
5+
6+
diff(['a']); // $ExpectType string[]
7+
diff(['a'], [1]); // $ExpectType string[]
8+
diff([1], ['a']); // $ExpectType number[]

types/arr-diff/index.d.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// Type definitions for arr-diff 4.0
2+
// Project: https://github.com/jonschlinkert/arr-diff
3+
// Definitions by: BendingBender <https://github.com/BendingBender>
4+
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5+
6+
export = arrDiff;
7+
8+
declare function arrDiff<T>(first: T[], ...args: any[][]): T[];

types/arr-diff/tsconfig.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"compilerOptions": {
3+
"module": "commonjs",
4+
"lib": [
5+
"es6"
6+
],
7+
"noImplicitAny": true,
8+
"noImplicitThis": true,
9+
"strictNullChecks": true,
10+
"strictFunctionTypes": true,
11+
"baseUrl": "../",
12+
"typeRoots": [
13+
"../"
14+
],
15+
"types": [],
16+
"noEmit": true,
17+
"forceConsistentCasingInFileNames": true
18+
},
19+
"files": [
20+
"index.d.ts",
21+
"arr-diff-tests.ts"
22+
]
23+
}

types/arr-diff/tslint.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{ "extends": "dtslint/dt.json" }

0 commit comments

Comments
 (0)