diff --git a/webpack/index.d.ts b/webpack/index.d.ts index 820e76866b..577b96de2f 100644 --- a/webpack/index.d.ts +++ b/webpack/index.d.ts @@ -3,9 +3,6 @@ // Definitions by: Qubo , Matt Lewis , Benjamin Lim // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// -/// - import * as UglifyJS from 'uglify-js'; import * as tapable from 'tapable'; @@ -278,14 +275,14 @@ declare namespace webpack { * * @deprecated Replaced by `mainFields` in webpack 2. */ - packageMains?: (string | string[])[]; + packageMains?: Array; /** * Check this field in the package.json for an object. Key-value-pairs are threaded as aliasing according to this spec * * @deprecated Replaced by `aliasFields` in webpack 2. */ - packageAlias?: (string | string[])[]; + packageAlias?: Array; /** * Enable aggressive but unsafe caching for the resolving of a part of your files. @@ -323,9 +320,7 @@ declare namespace webpack { [key: string]: boolean | string; } - interface ExternalsFunctionElement { - (context: any, request: any, callback: (error: any, result: any) => void): any; - } + type ExternalsFunctionElement = (context: any, request: any, callback: (error: any, result: any) => void) => any; interface WatchOptions { /** Delay the rebuilt after the first change. Value is a time in ms. */ @@ -469,7 +464,7 @@ declare namespace webpack { type Rule = LoaderRule | UseRule | RulesRule | OneOfRule; interface Plugin extends tapable.Plugin { - apply (thisArg: Webpack, ...args: any[]): void + apply(thisArg: Webpack, ...args: any[]): void; } interface Webpack { @@ -620,7 +615,7 @@ declare namespace webpack { } interface ContextReplacementPluginStatic { - new (resourceRegExp: any, newContentResource?: any, newContentRecursive?: any, newContentRegExp?: any): Plugin + new (resourceRegExp: any, newContentResource?: any, newContentRecursive?: any, newContentRegExp?: any): Plugin; } interface IgnorePluginStatic { @@ -666,31 +661,31 @@ declare namespace webpack { interface SourceMapDevToolPluginOptions { // output filename pattern (false/null to append) - filename?: string | false | null, + filename?: string | false | null; // source map comment pattern (false to not append) - append?: false | string, + append?: false | string; // template for the module filename inside the source map - moduleFilenameTemplate?: string, + moduleFilenameTemplate?: string; // fallback used when the moduleFilenameTemplate produces a collision - fallbackModuleFilenameTemplate?: string, + fallbackModuleFilenameTemplate?: string; // test/include/exclude files - test?: Condition | Condition[], - include?: Condition | Condition[], - exclude?: Condition | Condition[] + test?: Condition | Condition[]; + include?: Condition | Condition[]; + exclude?: Condition | Condition[]; // whether to include the footer comment with source information - noSources?: boolean, + noSources?: boolean; // the source map sourceRoot ("The URL root from which all sources are relative.") - sourceRoot?: string | null, + sourceRoot?: string | null; // whether to generate per-module source map - module?: boolean, + module?: boolean; // whether to include column information in the source map - columns?: boolean, + columns?: boolean; // whether to preserve line numbers between source and source map lineToLine?: boolean | { - test?: Condition | Condition[], - include?: Condition | Condition[], - exclude?: Condition | Condition[] - } + test?: Condition | Condition[]; + include?: Condition | Condition[]; + exclude?: Condition | Condition[]; + }; } interface EvalSourceMapDevToolPluginStatic { @@ -699,16 +694,16 @@ declare namespace webpack { } interface EvalSourceMapDevToolPluginOptions { - append?: false | string, - moduleFilenameTemplate?: string, - sourceRoot?: string, - module?: boolean, - columns?: boolean, + append?: false | string; + moduleFilenameTemplate?: string; + sourceRoot?: string; + module?: boolean; + columns?: boolean; lineToLine?: boolean | { - test?: Condition | Condition[], - include?: Condition | Condition[], - exclude?: Condition | Condition[] - } + test?: Condition | Condition[]; + include?: Condition | Condition[]; + exclude?: Condition | Condition[]; + }; } interface HotModuleReplacementPluginStatic { @@ -740,7 +735,7 @@ declare namespace webpack { new (): Plugin; } interface LimitChunkCountPluginStatic { - new (options: any): Plugin + new (options: any): Plugin; } interface MinChunkSizePluginStatic { new (options: any): Plugin; @@ -845,7 +840,7 @@ declare namespace webpack { colors?: boolean; } - type CompilerCallback = (err: Error, stats: Stats) => void + type CompilerCallback = (err: Error, stats: Stats) => void; } interface PerformanceOptions {