Add missing types

This commit is contained in:
Diogo Franco (Kovensky)
2016-11-21 15:26:04 +09:00
parent 72e4a88a3d
commit 1f921fb60c

18
webpack/index.d.ts vendored
View File

@@ -347,7 +347,9 @@ declare namespace webpack {
}
type Rule = LoaderRule | UseRule | RulesRule | OneOfRule;
interface Plugin extends tapable.Plugin {}
interface Plugin extends tapable.Plugin {
apply (thisArg: Webpack, ...args: any[]): void
}
interface Webpack {
(config: Configuration, callback?: compiler.CompilerCallback): compiler.Compiler;
@@ -403,6 +405,11 @@ declare namespace webpack {
* Adds SourceMaps for assets.
*/
SourceMapDevToolPlugin: SourceMapDevToolPluginStatic;
/**
* Adds SourceMaps for assets, but wrapped inside eval statements.
* Much faster incremental build speed, but harder to debug.
*/
EvalSourceMapDevToolPlugin: SourceMapDevToolPluginStatic;
/**
* Enables Hot Module Replacement. (This requires records data if not in dev-server mode, recordsPath)
* Generates Hot Update Chunks of each chunk in the records.
@@ -422,6 +429,11 @@ declare namespace webpack {
* Does not watch specified files matching provided paths or RegExps.
*/
WatchIgnorePlugin: WatchIgnorePluginStatic;
/**
* Uses the module name as the module id inside the bundle, instead of a number.
* Helps with debugging, but increases bundle size.
*/
NamedModulesPlugin: NamedModulesPluginStatic;
}
interface Optimize {
@@ -535,6 +547,10 @@ declare namespace webpack {
new (paths: RegExp[]): Plugin;
}
interface NamedModulesPluginStatic {
new (): Plugin;
}
namespace optimize {
interface DedupePluginStatic {
new (): Plugin;