Galerie und tage
This commit is contained in:
32
node_modules/is-png/index.d.ts
generated
vendored
32
node_modules/is-png/index.d.ts
generated
vendored
@@ -1,32 +0,0 @@
|
||||
/// <reference types="node"/>
|
||||
|
||||
/**
|
||||
Check if a Buffer/Uint8Array is a [PNG](https://en.wikipedia.org/wiki/Portable_Network_Graphics) image.
|
||||
|
||||
@param buffer - The buffer to check. It only needs the first 8 bytes.
|
||||
@returns Whether `buffer` contains a PNG image.
|
||||
|
||||
@example
|
||||
```
|
||||
// Node.js:
|
||||
import readChunk = require('read-chunk');
|
||||
import isPng = require('is-png');
|
||||
|
||||
const buffer = readChunk.sync('unicorn.png', 0, 8);
|
||||
|
||||
isPng(buffer);
|
||||
//=> true
|
||||
|
||||
// Browser:
|
||||
(async () => {
|
||||
const response = await fetch('unicorn.png');
|
||||
const buffer = await response.arrayBuffer();
|
||||
|
||||
isPng(new Uint8Array(buffer));
|
||||
//=> true
|
||||
})();
|
||||
```
|
||||
*/
|
||||
declare function isPng(buffer: Uint8Array | Buffer): boolean;
|
||||
|
||||
export = isPng;
|
||||
Reference in New Issue
Block a user