@farmfe/core
Version:
Farm is a extremely fast web build tool written in Rust. Farm can start a project in milliseconds and perform HMR within 10ms, making it much faster than similar tools like webpack and vite.
36 lines (31 loc) • 1.03 kB
TypeScript
import type {
ErrorPayload,
FullReloadPayload,
PrunePayload,
UpdatePayload
} from './hmr-payload';
export interface CustomEventMap {
'vite:beforeUpdate': UpdatePayload;
'vite:afterUpdate': UpdatePayload;
'vite:beforePrune': PrunePayload;
'vite:beforeFullReload': FullReloadPayload;
'vite:error': ErrorPayload;
'vite:invalidate': InvalidatePayload;
'vite:ws:connect': WebSocketConnectionPayload;
'vite:ws:disconnect': WebSocketConnectionPayload;
}
export interface WebSocketConnectionPayload {
/**
* @experimental
* We expose this instance experimentally to see potential usage.
* This might be removed in the future if we didn't find reasonable use cases.
* If you find this useful, please open an issue with details so we can discuss and make it stable API.
*/
webSocket: WebSocket;
}
export interface InvalidatePayload {
path: string;
message: string | undefined;
}
export type InferCustomEventPayload<T extends string> =
T extends keyof CustomEventMap ? CustomEventMap[T] : any;