From 4ec0684abafb38faef202609887a803460256e50 Mon Sep 17 00:00:00 2001 From: Florian Keller Date: Fri, 3 May 2019 05:04:14 +0200 Subject: [PATCH] Add types for chunk (#35164) --- types/chunk/chunk-tests.ts | 5 +++++ types/chunk/index.d.ts | 10 ++++++++++ types/chunk/tsconfig.json | 23 +++++++++++++++++++++++ types/chunk/tslint.json | 1 + 4 files changed, 39 insertions(+) create mode 100644 types/chunk/chunk-tests.ts create mode 100644 types/chunk/index.d.ts create mode 100644 types/chunk/tsconfig.json create mode 100644 types/chunk/tslint.json diff --git a/types/chunk/chunk-tests.ts b/types/chunk/chunk-tests.ts new file mode 100644 index 0000000000..05fe628be9 --- /dev/null +++ b/types/chunk/chunk-tests.ts @@ -0,0 +1,5 @@ +import chunk = require('chunk'); + +chunk([1, 2, 3]); +chunk([1, 2, 3], 1); +chunk([1, 2, 3], 3); diff --git a/types/chunk/index.d.ts b/types/chunk/index.d.ts new file mode 100644 index 0000000000..96deef885e --- /dev/null +++ b/types/chunk/index.d.ts @@ -0,0 +1,10 @@ +// Type definitions for chunk 0.0 +// Project: https://github.com/ryancole/chunk +// Definitions by: Florian Keller +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export as namespace chunk; + +declare function chunk(array: ArrayLike, size?: number): T[][]; + +export = chunk; diff --git a/types/chunk/tsconfig.json b/types/chunk/tsconfig.json new file mode 100644 index 0000000000..ecdb194f1c --- /dev/null +++ b/types/chunk/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", + "chunk-tests.ts" + ] +} diff --git a/types/chunk/tslint.json b/types/chunk/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/chunk/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }