diff --git a/types/group-array/group-array-tests.ts b/types/group-array/group-array-tests.ts new file mode 100644 index 0000000000..a286e40f76 --- /dev/null +++ b/types/group-array/group-array-tests.ts @@ -0,0 +1,12 @@ +import groupArray = require("group-array"); + +const input = [ + { tag: 'one', content: 'A' }, + { tag: 'one', content: 'B' }, + { tag: 'two', content: 'C' }, + { tag: 'two', content: 'D' }, + { tag: 'three', content: 'E' }, + { tag: 'three', content: 'F' } +]; + +groupArray(input, 'tag'); // $ExpectType object diff --git a/types/group-array/index.d.ts b/types/group-array/index.d.ts new file mode 100644 index 0000000000..3efa2f710a --- /dev/null +++ b/types/group-array/index.d.ts @@ -0,0 +1,9 @@ +// Type definitions for group-array 1.0 +// Project: https://github.com/doowb/group-array +// Definitions by: Richie Bendall +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function groupArray(arr: object[], ...props: string[]): object; +declare function groupArray(arr: object[]): object[]; + +export = groupArray; diff --git a/types/group-array/tsconfig.json b/types/group-array/tsconfig.json new file mode 100644 index 0000000000..38aaf6384b --- /dev/null +++ b/types/group-array/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "group-array-tests.ts" + ] +} diff --git a/types/group-array/tslint.json b/types/group-array/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/group-array/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }