fix: change Compiler to ICompiler

- Updates the WebpackDevMiddleware function to accept MultiCompilers
- Updates deprecated names

Closes #17608
This commit is contained in:
Benjamin Lim
2017-07-09 14:18:48 +08:00
parent fc73cdd92b
commit 95390bf278

View File

@@ -4,12 +4,12 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
import { NextHandleFunction } from 'connect';
import { compiler } from 'webpack';
import * as webpack from 'webpack';
export = WebpackDevMiddleware;
declare function WebpackDevMiddleware(
compiler: compiler.Compiler,
compiler: webpack.ICompiler,
options?: WebpackDevMiddleware.Options
): WebpackDevMiddleware.WebpackDevMiddleware & NextHandleFunction;
@@ -18,13 +18,13 @@ declare namespace WebpackDevMiddleware {
noInfo?: boolean;
quiet?: boolean;
lazy?: boolean;
watchOptions?: compiler.WatchOptions;
watchOptions?: webpack.WatchOptions;
publicPath: string;
index?: string;
headers?: {
[name: string]: string;
};
stats?: compiler.StatsToStringOptions;
stats?: webpack.Stats.ToStringOptions;
reporter?: Reporter | null;
serverSideRender?: boolean;
@@ -36,7 +36,7 @@ declare namespace WebpackDevMiddleware {
interface ReporterOptions {
state: boolean;
stats: compiler.Stats;
stats: webpack.Stats;
options: Options;
}
@@ -46,7 +46,7 @@ declare namespace WebpackDevMiddleware {
interface WebpackDevMiddleware {
close(callback?: () => void): void;
invalidate(callback?: (stats: compiler.Stats) => void): void;
waitUntilValid(callback?: (stats: compiler.Stats) => void): void;
invalidate(callback?: (stats: webpack.Stats) => void): void;
waitUntilValid(callback?: (stats: webpack.Stats) => void): void;
}
}