[@types/gulp-imagemin] Add type definitions (#27692)

* Add koa-router's Router to koa's Context

* [@types/gulp-imagemin] Add type definitions
This commit is contained in:
Romain Faust
2018-07-30 11:19:01 -07:00
committed by Sheetal Nandi
parent 9e7f1e9d6f
commit 16b85f0e2f
4 changed files with 71 additions and 0 deletions
@@ -0,0 +1,20 @@
import * as GulpImagemin from 'gulp-imagemin';
GulpImagemin();
GulpImagemin([
GulpImagemin.gifsicle({ interlaced: true }),
GulpImagemin.jpegtran({ progressive: true }),
GulpImagemin.optipng({ optimizationLevel: 5 }),
GulpImagemin.svgo({
plugins: [{ removeViewBox: true }, { cleanupIDs: false }]
})
]);
GulpImagemin({ verbose: true });
GulpImagemin([
GulpImagemin.svgo({
plugins: [{ removeViewBox: true }]
})
], { verbose: true });
+27
View File
@@ -0,0 +1,27 @@
// Type definitions for gulp-imagemin 4.1
// Project: https://github.com/sindresorhus/gulp-imagemin#readme
// Definitions by: Romain Faust <https://github.com/romain-faust>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
import { Transform } from 'stream';
declare function imagemin(pluginsOrOptions?: imagemin.Plugin[] | imagemin.Options): Transform;
declare function imagemin(plugins?: imagemin.Plugin[], options?: imagemin.Options): Transform;
declare namespace imagemin {
interface Options {
verbose?: boolean;
}
type Plugin = (input: any) => Promise<any>;
type PluginFactory = (options?: any) => Plugin;
const gifsicle: PluginFactory;
const jpegtran: PluginFactory;
const optipng: PluginFactory;
const svgo: PluginFactory;
}
export = imagemin;
+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",
"gulp-imagemin-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }