Installation
npm install --save @types/webpack-hot-client
Summary
This package contains type definitions for webpack-hot-client (https://github.com/webpack-contrib/webpack-hot-client).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/webpack-hot-client.
index.d.ts
/// <reference types="node" />
import * as net from "net";
import * as webpack from "webpack";
import { Server } from "ws";
export = WebpackHotClient;
declare function WebpackHotClient(
compiler: webpack.Compiler | webpack.MultiCompiler,
options: WebpackHotClient.Options,
): WebpackHotClient.Client;
declare namespace WebpackHotClient {
interface WebSocketServer extends Server {
/** Forwards a message to each open client on the WebSocketServer */
broadcast(data: any): void;
/** Processes stats and sends messages through broadcast() */
send(stats: webpack.Stats): void;
}
interface Client {
/** Function that closes the WebSocketServer opened by the module. */
close(callback?: () => void): void;
/** WebSocketServer instance with some hot-client specific method overrides */
server: WebSocketServer;
/** Readonly version of the options after applying defaults */
options: Readonly<Options>;
}
interface WebpackHotHost {
/** Client hostname that is used in the browser by WebSockets */
client: string;
/** Server hostname */
server: string;
}
interface Options {
/** Automatically configure every entry */
allEntries?: boolean | undefined;
/** Auto configure the given webpack config with the hot configuration */
autoConfigure?: boolean | undefined;
/** Host that the WebSocket listens on */
host?: WebpackHotHost | string | undefined;
/** Enable hot module reloading */
hmr?: boolean | undefined;
/** Enable HTTPS */
https?: boolean | undefined;
/** Level of information for webpack-hot-client to output */
logLevel?: "trace" | "debug" | "info" | "warn" | "error" | "silent" | undefined;
/** Prepend timestamp to each log line */
logTime?: boolean | undefined;
/** Port that the WebSocket listens on */
port?: number | undefined;
/** Reload the page if a patch cannot be applied by webpack */
reload?: boolean | undefined;
/** Server instance for webpack-hot-client to connect to */
server?: net.Server | undefined;
/** Webpack stats configuration */
stats?: webpack.Options.Stats | undefined;
/** Webpack compile target */
validTargets?: string[] | undefined;
}
}
Additional Details
- Last updated: Tue, 07 Nov 2023 15:11:36 GMT
- Dependencies: @types/node, @types/webpack, @types/ws
Credits
These definitions were written by ZSkycat, and Brian Armstrong.