diff --git a/types/image-type/image-type-tests.ts b/types/image-type/image-type-tests.ts new file mode 100644 index 0000000000..ea9951d6f2 --- /dev/null +++ b/types/image-type/image-type-tests.ts @@ -0,0 +1,4 @@ +import imageType = require('file-type'); + +imageType(new Buffer([0xFF, 0xD8, 0xFF])); +imageType(new Uint8Array([0xFF, 0xD8, 0xFF])); diff --git a/types/image-type/index.d.ts b/types/image-type/index.d.ts new file mode 100644 index 0000000000..2c5abcfd87 --- /dev/null +++ b/types/image-type/index.d.ts @@ -0,0 +1,12 @@ +// Type definitions for image-type 3.0 +// Project: https://github.com/sindresorhus/image-type#readme +// Definitions by: Florian Keller +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +import FileType = require('file-type'); + +declare function ImageType(buf: Buffer | Uint8Array): FileType.FileTypeResult | null; + +export = ImageType; diff --git a/types/image-type/tsconfig.json b/types/image-type/tsconfig.json new file mode 100644 index 0000000000..2c7c57ebba --- /dev/null +++ b/types/image-type/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "image-type-tests.ts" + ] +} diff --git a/types/image-type/tslint.json b/types/image-type/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/image-type/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }