UNPKG

1.13 kBTypeScriptView Raw
1/// <reference types="node" />
2import { webpack } from 'next/dist/compiled/webpack/webpack';
3import http from 'http';
4export declare class WebpackHotMiddleware {
5 eventStream: EventStream;
6 latestStats: webpack.Stats | null;
7 clientLatestStats: webpack.Stats | null;
8 closed: boolean;
9 serverError: boolean;
10 constructor(compilers: webpack.Compiler[]);
11 onServerInvalid: () => void;
12 onClientInvalid: () => void;
13 onServerDone: (statsResult: webpack.Stats) => void;
14 onClientDone: (statsResult: webpack.Stats) => void;
15 middleware: (req: http.IncomingMessage, res: http.ServerResponse, next: () => void) => void;
16 publishStats: (action: string, statsResult: webpack.Stats) => void;
17 publish: (payload: any) => void;
18 close: () => void;
19}
20declare class EventStream {
21 clients: Set<http.ServerResponse>;
22 interval: NodeJS.Timeout;
23 constructor();
24 heartbeatTick: () => void;
25 everyClient(fn: (client: http.ServerResponse) => void): void;
26 close(): void;
27 handler(req: http.IncomingMessage, res: http.ServerResponse): void;
28 publish(payload: any): void;
29}
30export {};