From bc1da19924421c5a70f17fc5471205abd7934dd5 Mon Sep 17 00:00:00 2001 From: DenisFrezzato Date: Sun, 31 Mar 2019 19:32:57 +0200 Subject: [PATCH] Add type to is-image module. --- types/is-image/index.d.ts | 8 ++++++++ types/is-image/is-image-tests.ts | 3 +++ types/is-image/tsconfig.json | 16 ++++++++++++++++ types/is-image/tslint.json | 1 + 4 files changed, 28 insertions(+) create mode 100644 types/is-image/index.d.ts create mode 100644 types/is-image/is-image-tests.ts create mode 100644 types/is-image/tsconfig.json create mode 100644 types/is-image/tslint.json diff --git a/types/is-image/index.d.ts b/types/is-image/index.d.ts new file mode 100644 index 0000000000..f390206830 --- /dev/null +++ b/types/is-image/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for is-image 2.0 +// Project: https://github.com/sindresorhus/is-image#readme +// Definitions by: Denis Frezzato +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = isImage; + +declare function isImage(filepath: string): boolean; diff --git a/types/is-image/is-image-tests.ts b/types/is-image/is-image-tests.ts new file mode 100644 index 0000000000..2cbdb0bf0c --- /dev/null +++ b/types/is-image/is-image-tests.ts @@ -0,0 +1,3 @@ +import isImage = require('is-image'); + +const res: boolean = isImage('/path/to/img.png'); diff --git a/types/is-image/tsconfig.json b/types/is-image/tsconfig.json new file mode 100644 index 0000000000..2d1799652d --- /dev/null +++ b/types/is-image/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": ["index.d.ts", "is-image-tests.ts"] +} diff --git a/types/is-image/tslint.json b/types/is-image/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/is-image/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }