UNPKG

1.28 kBTypeScriptView Raw
1import { NextHandleFunction } from "connect";
2import * as webpack from "webpack";
3
4export = WebpackHotMiddleware;
5
6declare function WebpackHotMiddleware(
7 compiler: webpack.Compiler | webpack.MultiCompiler,
8 options?: WebpackHotMiddleware.MiddlewareOptions,
9): NextHandleFunction & WebpackHotMiddleware.EventStream;
10
11declare namespace WebpackHotMiddleware {
12 interface ClientOptions {
13 path?: string | undefined;
14 reload?: boolean | undefined;
15 name?: string | undefined;
16 timeout?: number | undefined;
17 overlay?: boolean | undefined;
18 noInfo?: boolean | undefined;
19 quiet?: boolean | undefined;
20 dynamicPublicPath?: boolean | undefined;
21 autoConnect?: boolean | undefined;
22 ansiColors?: {
23 [key: string]: any;
24 } | undefined;
25 overlayStyles?: {
26 [key: string]: any;
27 } | undefined;
28 overlayWarnings?: boolean | undefined;
29 }
30 interface MiddlewareOptions {
31 log?: false | Logger | undefined;
32 path?: string | undefined;
33 heartbeat?: number | undefined;
34 }
35
36 type Logger = (message?: any, ...optionalParams: any[]) => void;
37
38 interface EventStream {
39 publish(payload: any): void;
40 close(): void;
41 }
42}