8.0.6 • Published 5 months ago

@types/gulp-imagemin v8.0.6

Weekly downloads
8,716
License
MIT
Repository
github
Last release
5 months ago

Installation

npm install --save @types/gulp-imagemin

Summary

This package contains type definitions for gulp-imagemin (https://github.com/sindresorhus/gulp-imagemin#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/gulp-imagemin.

index.d.ts

// Type definitions for gulp-imagemin 8.0
// 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 { Plugin } from 'imagemin';
import { Options as GifsicleOptions } from 'imagemin-gifsicle';
import { Options as MozjpegOptions } from 'imagemin-mozjpeg';
import { Options as OptipngOptions } from 'imagemin-optipng';
import { Options as SvgoOptions } from 'imagemin-svgo';
import { Transform } from 'stream';

declare function imagemin(pluginsOrOptions?: ReadonlyArray<Plugin> | imagemin.Options): Transform;
declare function imagemin(plugins?: ReadonlyArray<Plugin>, options?: imagemin.Options): Transform;

declare namespace imagemin {
    interface Options {
        silent?: boolean | undefined;
        verbose?: boolean | undefined;
    }

    type PluginFactory<T> = (options?: T) => Plugin;

    const gifsicle: PluginFactory<GifsicleOptions>;
    const mozjpeg: PluginFactory<MozjpegOptions>;
    const optipng: PluginFactory<OptipngOptions>;
    const svgo: PluginFactory<SvgoOptions>;
}

export = imagemin;

Additional Details

Credits

These definitions were written by Romain Faust.