Add type definitions for pngquant-bin (#25159)

This commit is contained in:
Hirotaka Ikoma 2018-04-21 02:40:03 +09:00 committed by Ryan Cavanaugh
parent ce61935ac8
commit 19493d0fb1
4 changed files with 39 additions and 0 deletions

9
types/pngquant-bin/index.d.ts vendored Normal file
View File

@ -0,0 +1,9 @@
// Type definitions for pngquant-bin 4.0
// Project: https://github.com/imagemin/pngquant-bin#readme
// Definitions by: Hirotaka Ikoma <https://github.com/hikoma>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
declare const pngquant: string;
export = pngquant;

View File

@ -0,0 +1,6 @@
import { execFile } from "child_process";
import * as pngquant from "pngquant-bin";
execFile(pngquant, ["-o", "output.png", "input.png"], { encoding: "utf-8" }, (err: Error | null) => {
console.log("Image minified!");
});

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",
"pngquant-bin-tests.ts"
]
}

View File

@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }