Add type definitions for jpegtran-bin (#25156)

This commit is contained in:
Hirotaka Ikoma
2018-04-21 05:41:04 +12:00
committed by Ryan Cavanaugh
parent c3748d5c11
commit 8a377075d9
4 changed files with 39 additions and 0 deletions
+9
View File
@@ -0,0 +1,9 @@
// Type definitions for jpegtran-bin 3.2
// Project: https://github.com/imagemin/jpegtran-bin#readme
// Definitions by: Hirotaka Ikoma <https://github.com/hikoma>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
declare const jpegtran: string;
export = jpegtran;
+6
View File
@@ -0,0 +1,6 @@
import { execFile } from "child_process";
import * as jpegtran from "jpegtran-bin";
execFile(jpegtran, ["-outfile", "output.jpg", "input.jpg"], { encoding: "utf-8" }, (err: Error | null) => {
console.log("Image minified!");
});
+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",
"jpegtran-bin-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }