UNPKG

react-torch

Version:

A lib to server-side render with react.

19 lines (18 loc) 727 B
/// <reference types="node" /> import type { IncomingMessage, ServerResponse } from 'http'; import type { Compiler } from 'webpack'; import type { HttpMiddleware } from 'farrow-http'; export declare type Log = false | ((...args: any[]) => void); export declare type Action = 'built' | 'sync'; export declare type Payload = object; export declare type WebpackHotMiddlewareOptions = { log?: Log; path?: string; heartbeat?: number; }; export declare function webpackHotMiddleware(compiler: Compiler, opts?: WebpackHotMiddlewareOptions): HttpMiddleware; export declare type EventStream = { close: () => void; handler: (req: IncomingMessage, res: ServerResponse) => void; publish: (payload: any) => void; };