Skip to content

Commit

Permalink
Added all the available typings for Imagemin plugins.
Browse files Browse the repository at this point in the history
  • Loading branch information
SzybkiSasza committed Feb 4, 2019
1 parent eee7578 commit 851edf4
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 5 deletions.
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@
},
"homepage": "https://github.com/Klathmon/imagemin-webpack-plugin#readme",
"dependencies": {
"@types/imagemin-gifsicle": "^5.2.0",
"@types/imagemin-jpegtran": "^5.0.0",
"@types/imagemin-optipng": "^5.2.0",
"@types/imagemin-svgo": "^7.0.0",
"@types/webpack": "^4.4.24",
"async-throttle": "^1.1.0",
"babel-runtime": "^6.18.0",
Expand Down
15 changes: 10 additions & 5 deletions src/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
import { Options as GifsicleOptions } from 'imagemin-gifsicle';
import { Options as JpegTranOptions } from 'imagemin-jpegtran';
import { Options as OptiPngOptions } from 'imagemin-optipng';
import { Options as SvgoOptions } from 'imagemin-svgo';

import { Plugin } from 'webpack';

export default ImageminWebpackPugin;
Expand All @@ -9,7 +14,7 @@ declare class ImageminWebpackPugin extends Plugin {
declare namespace ImageminWebpackPugin {
type TestOption = RegExp | string | (() => boolean);

// Keeping it as generic object as including all the other types would be too heavy
// Generic options for plugins missing typings
interface ExternalOptions {
[key: string]: any;
}
Expand All @@ -18,10 +23,10 @@ declare namespace ImageminWebpackPugin {
disable?: boolean;
test?: TestOption | TestOption[];
maxConcurrency?: number;
optipng?: ExternalOptions | null;
gifsicle?: ExternalOptions | null;
jpegtran?: ExternalOptions | null;
svgo?: ExternalOptions | null;
optipng?: OptiPngOptions | null;
gifsicle?: GifsicleOptions | null;
jpegtran?: JpegTranOptions | null;
svgo?: SvgoOptions | null;
pngquant?: ExternalOptions | null;
plugins?: Array<Promise<Buffer>> | [];
}
Expand Down
41 changes: 41 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,52 @@
resolved "https://registry.yarnpkg.com/@types/anymatch/-/anymatch-1.3.0.tgz#d1d55958d1fccc5527d4aba29fc9c4b942f563ff"
integrity sha512-7WcbyctkE8GTzogDb0ulRAEw7v8oIS54ft9mQTU7PfM0hp5e+8kpa+HeQ7IQrFbKtJXBKcZ4bh+Em9dTw5L6AQ==

"@types/imagemin-gifsicle@^5.2.0":
version "5.2.0"
resolved "https://registry.yarnpkg.com/@types/imagemin-gifsicle/-/imagemin-gifsicle-5.2.0.tgz#349160f17412e26de8d5794e70aad504781ea7d8"
integrity sha512-WohEsNMyGYTc+u6WA7KUvX8g+uLgTJOhqteexGdGZ/TPyS65GuCzMJ1RTaSzqG/cIfLFxbxg/HbGBg8YJrNZaw==
dependencies:
"@types/imagemin" "*"

"@types/imagemin-jpegtran@^5.0.0":
version "5.0.0"
resolved "https://registry.yarnpkg.com/@types/imagemin-jpegtran/-/imagemin-jpegtran-5.0.0.tgz#44d98874bdcc3f290ce1e158355f33fc90ac2758"
integrity sha512-uwJknBgND9Jx+/d5bJf+mvAjfes0NIDyCeOKFJ9LbEYnp8/PVt0YDGh8K96JemeF84VbhHFxnN62Wz68rVNfFQ==
dependencies:
"@types/imagemin" "*"

"@types/imagemin-optipng@^5.2.0":
version "5.2.0"
resolved "https://registry.yarnpkg.com/@types/imagemin-optipng/-/imagemin-optipng-5.2.0.tgz#83046e0695739661fa738ad253bdbf51bc4f9e9d"
integrity sha512-Qn4gTV1fpPG2WIsUIl10yi2prudOuDIx+D+O0H3aKZRcTCwpMjszBVeRWUqkhG5wADhWO4giLut1sFNr3H2XIQ==
dependencies:
"@types/imagemin" "*"

"@types/imagemin-svgo@^7.0.0":
version "7.0.0"
resolved "https://registry.yarnpkg.com/@types/imagemin-svgo/-/imagemin-svgo-7.0.0.tgz#c9ffe209ed7695c9ae4bebef083f47de2cd98c1e"
integrity sha512-Uq2T4hHE9PvBLB1lZM1+bZUzPc14XCKKWzQqJ47qe4/iuVHavYX4ig/gbBj8W3ZvRAJcQV3nagfoqFUzzdFD4g==
dependencies:
"@types/imagemin" "*"
"@types/svgo" "*"

"@types/imagemin@*":
version "6.0.0"
resolved "https://registry.yarnpkg.com/@types/imagemin/-/imagemin-6.0.0.tgz#c7b72bb08657396884acfac735c204379b0fe0a4"
integrity sha512-07dAIxWudAi8dHBS7W5JJ1rj4XR+FBLooq1yXXZo2XTv9kbMHKeDjq1pd9ou4Ui6yBZzfezlNxfJM1++fbc5/A==
dependencies:
"@types/node" "*"

"@types/node@*":
version "10.12.21"
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.21.tgz#7e8a0c34cf29f4e17a36e9bd0ea72d45ba03908e"
integrity sha512-CBgLNk4o3XMnqMc0rhb6lc77IwShMEglz05deDcn2lQxyXEZivfwgYJu7SMha9V5XcrP6qZuevTHV/QrN2vjKQ==

"@types/svgo@*":
version "1.0.1"
resolved "https://registry.yarnpkg.com/@types/svgo/-/svgo-1.0.1.tgz#6095fc0119febcf5920ed9cdacdcc0a0d026e4a5"
integrity sha512-tV+xgQS8v4McSQqk+tGDCwTT1Bo/QLqgRPS1M9UgNZHK2cTf6CdwzxcMG7YAQwd/ZPUNgfgvN7tfe4OUv077Lw==

"@types/tapable@*":
version "1.0.4"
resolved "https://registry.yarnpkg.com/@types/tapable/-/tapable-1.0.4.tgz#b4ffc7dc97b498c969b360a41eee247f82616370"
Expand Down

0 comments on commit 851edf4

Please sign in to comment.