UNPKG

1.2 kBTypeScriptView Raw
1// Type definitions for gulp-imagemin 8.0
2// Project: https://github.com/sindresorhus/gulp-imagemin#readme
3// Definitions by: Romain Faust <https://github.com/romain-faust>
4// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5
6/// <reference types="node" />
7
8import { Plugin } from 'imagemin';
9import { Options as GifsicleOptions } from 'imagemin-gifsicle';
10import { Options as MozjpegOptions } from 'imagemin-mozjpeg';
11import { Options as OptipngOptions } from 'imagemin-optipng';
12import { Options as SvgoOptions } from 'imagemin-svgo';
13import { Transform } from 'stream';
14
15declare function imagemin(pluginsOrOptions?: ReadonlyArray<Plugin> | imagemin.Options): Transform;
16declare function imagemin(plugins?: ReadonlyArray<Plugin>, options?: imagemin.Options): Transform;
17
18declare namespace imagemin {
19 interface Options {
20 silent?: boolean | undefined;
21 verbose?: boolean | undefined;
22 }
23
24 type PluginFactory<T> = (options?: T) => Plugin;
25
26 const gifsicle: PluginFactory<GifsicleOptions>;
27 const mozjpeg: PluginFactory<MozjpegOptions>;
28 const optipng: PluginFactory<OptipngOptions>;
29 const svgo: PluginFactory<SvgoOptions>;
30}
31
32export = imagemin;