diff --git a/types/jpegtran-bin/index.d.ts b/types/jpegtran-bin/index.d.ts new file mode 100644 index 0000000000..b946d056b7 --- /dev/null +++ b/types/jpegtran-bin/index.d.ts @@ -0,0 +1,9 @@ +// Type definitions for jpegtran-bin 3.2 +// Project: https://github.com/imagemin/jpegtran-bin#readme +// Definitions by: Hirotaka Ikoma +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare const jpegtran: string; +export = jpegtran; diff --git a/types/jpegtran-bin/jpegtran-bin-tests.ts b/types/jpegtran-bin/jpegtran-bin-tests.ts new file mode 100644 index 0000000000..9f3e8318fd --- /dev/null +++ b/types/jpegtran-bin/jpegtran-bin-tests.ts @@ -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!"); +}); diff --git a/types/jpegtran-bin/tsconfig.json b/types/jpegtran-bin/tsconfig.json new file mode 100644 index 0000000000..5f260cfaed --- /dev/null +++ b/types/jpegtran-bin/tsconfig.json @@ -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" + ] +} diff --git a/types/jpegtran-bin/tslint.json b/types/jpegtran-bin/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/jpegtran-bin/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }