mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-11-29 01:31:45 +00:00
Added typings for is-png.
This commit is contained in:
Vendored
+16
@@ -0,0 +1,16 @@
|
||||
// Type definitions for is-png 1.1
|
||||
// Project: https://github.com/sindresorhus/is-png#readme
|
||||
// Definitions by: James Wild <https://github.com/jameswilddev>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
/**
|
||||
* Check whether a buffer contains a PNG image.
|
||||
* @remarks This only performs a header check, and the buffer may not parse as a PNG file.
|
||||
* @param buffer The buffer to check.
|
||||
* @returns Whether the given buffer contains a PNG image.
|
||||
*/
|
||||
declare function isPng(buffer: Uint8Array | Buffer): boolean;
|
||||
|
||||
export = isPng;
|
||||
@@ -0,0 +1,7 @@
|
||||
import isPng = require("is-png");
|
||||
|
||||
const uint8Array = new Uint8Array(0);
|
||||
isPng(uint8Array); // $ExpectType boolean
|
||||
|
||||
const buffer = Buffer.from(uint8Array);
|
||||
isPng(buffer); // $ExpectType boolean
|
||||
@@ -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",
|
||||
"is-png-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user