From 35e07a23ba6738ee160cd6ee9ac20e3834c9fd5f Mon Sep 17 00:00:00 2001 From: Claas Ahlrichs Date: Sun, 7 Apr 2019 11:30:11 +0200 Subject: [PATCH 1/2] npx dts-gen -m isarray --dt --- types/isarray/index.d.ts | 9 +++++++++ types/isarray/isarray-tests.ts | 0 types/isarray/tsconfig.json | 22 ++++++++++++++++++++++ types/isarray/tslint.json | 1 + 4 files changed, 32 insertions(+) create mode 100644 types/isarray/index.d.ts create mode 100644 types/isarray/isarray-tests.ts create mode 100644 types/isarray/tsconfig.json create mode 100644 types/isarray/tslint.json diff --git a/types/isarray/index.d.ts b/types/isarray/index.d.ts new file mode 100644 index 0000000000..b2111930d1 --- /dev/null +++ b/types/isarray/index.d.ts @@ -0,0 +1,9 @@ +// Type definitions for isarray 2.0 +// Project: https://github.com/juliangruber/isarray +// Definitions by: My Self +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = isarray; + +declare function isarray(p0: any): any; + diff --git a/types/isarray/isarray-tests.ts b/types/isarray/isarray-tests.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/types/isarray/tsconfig.json b/types/isarray/tsconfig.json new file mode 100644 index 0000000000..c072bf1eb3 --- /dev/null +++ b/types/isarray/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "isarray-tests.ts" + ] +} diff --git a/types/isarray/tslint.json b/types/isarray/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/isarray/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 6bf5c23861754247117caac565ba71d1e5d85723 Mon Sep 17 00:00:00 2001 From: Claas Ahlrichs Date: Sun, 7 Apr 2019 11:35:46 +0200 Subject: [PATCH 2/2] drafted types for isarray --- types/isarray/index.d.ts | 6 +++--- types/isarray/isarray-tests.ts | 4 ++++ types/isarray/tsconfig.json | 4 +++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/types/isarray/index.d.ts b/types/isarray/index.d.ts index b2111930d1..8466d6cbd6 100644 --- a/types/isarray/index.d.ts +++ b/types/isarray/index.d.ts @@ -1,9 +1,9 @@ // Type definitions for isarray 2.0 // Project: https://github.com/juliangruber/isarray -// Definitions by: My Self +// Definitions by: Claas Ahlrichs // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.7 export = isarray; -declare function isarray(p0: any): any; - +declare function isarray(p0: any): boolean; diff --git a/types/isarray/isarray-tests.ts b/types/isarray/isarray-tests.ts index e69de29bb2..d29f7761d2 100644 --- a/types/isarray/isarray-tests.ts +++ b/types/isarray/isarray-tests.ts @@ -0,0 +1,4 @@ +import isArray from "isarray"; + +isArray([]); // => true +isArray({}); // => false diff --git a/types/isarray/tsconfig.json b/types/isarray/tsconfig.json index c072bf1eb3..66483911c6 100644 --- a/types/isarray/tsconfig.json +++ b/types/isarray/tsconfig.json @@ -7,13 +7,15 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts",