Add types for image-type (#29740)

This commit is contained in:
Florian Keller
2018-10-16 09:02:56 -07:00
committed by Sheetal Nandi
parent 1969b1a47c
commit e773ece94a
4 changed files with 40 additions and 0 deletions
+4
View File
@@ -0,0 +1,4 @@
import imageType = require('file-type');
imageType(new Buffer([0xFF, 0xD8, 0xFF]));
imageType(new Uint8Array([0xFF, 0xD8, 0xFF]));
+12
View File
@@ -0,0 +1,12 @@
// Type definitions for image-type 3.0
// Project: https://github.com/sindresorhus/image-type#readme
// Definitions by: Florian Keller <https://github.com/ffflorian>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
import FileType = require('file-type');
declare function ImageType(buf: Buffer | Uint8Array): FileType.FileTypeResult | null;
export = ImageType;
+23
View File
@@ -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"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }