Merge pull request #28384 from romain-faust/imagemin-optipng

[@types/imagemin-optipng] Add type definitions
This commit is contained in:
Daniel Rosenwasser
2018-08-25 13:43:49 -07:00
committed by GitHub
4 changed files with 52 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
import imagemin = require('imagemin');
import imageminOptipng = require('imagemin-optipng');
imagemin(['*.png'], {
plugins: [
imageminOptipng(),
imageminOptipng({ optimizationLevel: 2 })
]
});

19
types/imagemin-optipng/index.d.ts vendored Normal file
View File

@@ -0,0 +1,19 @@
// Type definitions for imagemin-optipng 5.2
// Project: https://github.com/imagemin/imagemin-optipng#readme
// Definitions by: Romain Faust <https://github.com/romain-faust>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
import { Plugin } from 'imagemin';
declare function imageminOptipng(options?: imageminOptipng.Options): Plugin;
declare namespace imageminOptipng {
interface Options {
bitDepthReduction?: boolean;
colorTypeReduction?: boolean;
optimizationLevel?: number;
paletteReduction?: boolean;
}
}
export = imageminOptipng;

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",
"imagemin-optipng-tests.ts"
]
}

View File

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