@types/compression-webpack-plugin
Advanced tools
Comparing version 2.0.1 to 4.0.0
@@ -1,7 +0,7 @@ | ||
// Type definitions for compression-webpack-plugin 2.0 | ||
// Type definitions for compression-webpack-plugin 4.0 | ||
// Project: https://github.com/webpack-contrib/compression-webpack-plugin | ||
// Definitions by: Anton Kandybo <https://github.com/dublicator> | ||
// Rhys van der Waerden <https://github.com/rhys-vdw> | ||
// Piotr Błażejewicz <https://github.com/peterblazejewicz> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
// TypeScript Version: 2.4 | ||
@@ -13,3 +13,7 @@ import { Plugin } from 'webpack'; | ||
/** | ||
* Prepare compressed versions of assets to serve them with Content-Encoding. | ||
*/ | ||
declare class CompressionPlugin<O = any> extends Plugin { | ||
static isWebpack4(): boolean; | ||
constructor(options?: CompressionPlugin.Options<O>); | ||
@@ -24,12 +28,57 @@ } | ||
type ZlibAlgorithm = 'deflate' | 'deflateRaw' | 'gzip' | 'brotliCompress'; | ||
type Pattern = string | RegExp | ReadonlyArray<RegExp> | ReadonlyArray<string>; | ||
/** Filtering rule as regex or string */ | ||
type Rule = string | RegExp; | ||
/** Filtering rules. */ | ||
type Rules = Rule | ReadonlyArray<Rule>; | ||
interface FileInfo { | ||
/** original asset filename */ | ||
file: string; | ||
/** path of the original asset */ | ||
path: string; | ||
/** query */ | ||
query: string; | ||
} | ||
type FilenameFunction = (info: FileInfo) => string; | ||
interface BaseOptions { | ||
/** | ||
* Enable file caching | ||
* ⚠ Ignored in webpack 5! Please use webpack.js.org/configuration/other-options/#cache. | ||
* @default true | ||
*/ | ||
cache?: boolean | string; | ||
/** | ||
* @default false | ||
*/ | ||
deleteOriginalAssets?: boolean; | ||
exclude?: Pattern; | ||
filename?: string; | ||
include?: Pattern; | ||
/** | ||
* Exclude all assets matching any of these conditions | ||
*/ | ||
exclude?: Rules; | ||
/** | ||
* The target asset filename. | ||
* @default '[path].gz[query]' | ||
*/ | ||
filename?: string | FilenameFunction; | ||
/** | ||
* Include all assets matching any of these conditions | ||
*/ | ||
include?: Rules; | ||
/** | ||
* Only assets that compress better than this ratio are processed (minRatio = Compressed Size / Original Size) | ||
* @default 0.8 | ||
*/ | ||
minRatio?: number; | ||
test?: Pattern; | ||
/** | ||
* Include all assets that pass test assertion | ||
*/ | ||
test?: Rules; | ||
/** | ||
* Only assets bigger than this size are processed (in bytes) | ||
* @default 0 | ||
*/ | ||
threshold?: number; | ||
@@ -39,3 +88,11 @@ } | ||
interface ZlibOptions extends BaseOptions { | ||
/** | ||
* The compression algorithm/function | ||
* @default 'gzip' | ||
*/ | ||
algorithm?: ZlibAlgorithm; | ||
/** | ||
* Compression options for algorithm | ||
* @default { level: 9 } | ||
*/ | ||
compressionOptions?: ZlibCompressionOptions; | ||
@@ -42,0 +99,0 @@ } |
{ | ||
"name": "@types/compression-webpack-plugin", | ||
"version": "2.0.1", | ||
"version": "4.0.0", | ||
"description": "TypeScript definitions for compression-webpack-plugin", | ||
@@ -16,6 +16,11 @@ "license": "MIT", | ||
"githubUsername": "rhys-vdw" | ||
}, | ||
{ | ||
"name": "Piotr Błażejewicz", | ||
"url": "https://github.com/peterblazejewicz", | ||
"githubUsername": "peterblazejewicz" | ||
} | ||
], | ||
"main": "", | ||
"types": "index", | ||
"types": "index.d.ts", | ||
"repository": { | ||
@@ -30,4 +35,4 @@ "type": "git", | ||
}, | ||
"typesPublisherContentHash": "08cb2a45fcf07b9db34223830cb6f227cb1464cd730667ef403c522eb3ee191e", | ||
"typeScriptVersion": "2.4" | ||
"typesPublisherContentHash": "d5fab0966349def2e58d71cefeb385d3903f061dbd13d2fae4ea59cc082460d6", | ||
"typeScriptVersion": "3.0" | ||
} |
@@ -8,10 +8,10 @@ # Installation | ||
# Details | ||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/compression-webpack-plugin | ||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/compression-webpack-plugin. | ||
Additional Details | ||
* Last updated: Tue, 16 Jul 2019 21:26:09 GMT | ||
* Dependencies: @types/webpack | ||
### Additional Details | ||
* Last updated: Thu, 04 Jun 2020 00:58:03 GMT | ||
* Dependencies: [@types/webpack](https://npmjs.com/package/@types/webpack) | ||
* Global values: none | ||
# Credits | ||
These definitions were written by Anton Kandybo <https://github.com/dublicator>, and Rhys van der Waerden <https://github.com/rhys-vdw>. | ||
These definitions were written by [Anton Kandybo](https://github.com/dublicator), [Rhys van der Waerden](https://github.com/rhys-vdw), and [Piotr Błażejewicz](https://github.com/peterblazejewicz). |
Sorry, the diff of this file is not supported yet
6219
91