UNPKG

948 BTypeScriptView Raw
1/// <reference types="node" />
2
3import { Plugin } from "imagemin";
4import { Options as GifsicleOptions } from "imagemin-gifsicle";
5import { Options as MozjpegOptions } from "imagemin-mozjpeg";
6import { Options as OptipngOptions } from "imagemin-optipng";
7import { Options as SvgoOptions } from "imagemin-svgo";
8import { Transform } from "stream";
9
10declare function imagemin(pluginsOrOptions?: readonly Plugin[] | imagemin.Options): Transform;
11declare function imagemin(plugins?: readonly Plugin[], options?: imagemin.Options): Transform;
12
13declare namespace imagemin {
14 interface Options {
15 silent?: boolean | undefined;
16 verbose?: boolean | undefined;
17 }
18
19 type PluginFactory<T> = (options?: T) => Plugin;
20
21 const gifsicle: PluginFactory<GifsicleOptions>;
22 const mozjpeg: PluginFactory<MozjpegOptions>;
23 const optipng: PluginFactory<OptipngOptions>;
24 const svgo: PluginFactory<SvgoOptions>;
25}
26
27export = imagemin;