UNPKG

@farmfe/runtime-plugin-hmr

Version:

Runtime hmr plugin of Farm

22 lines (21 loc) 890 B
import { HmrClient } from './hmr-client.js'; export declare class HotModuleState { acceptCallbacks: Array<{ deps: string[]; fn: (mods: any[]) => void; }>; data: {}; id: string; hmrClient: HmrClient; constructor(id: string, hmrClient: HmrClient); accept(deps?: any, callback?: (mods: any[]) => void): void; dispose(callback: (data: any) => void): void; prune(callback: (data: any[]) => void): void; acceptExports(_: string | readonly string[], _callback: (data: any) => void): void; decline(): void; invalidate(message?: string): void; on<T extends string>(event: T, cb: (payload: any) => void): void; off<T extends string>(event: T, cb: (payload: any) => void): void; send<T extends string>(event: T, data?: any): void; } export declare function createHotContext(id: string, hmrClient: HmrClient): HotModuleState;