hi, how do we add type for custom event in **ViteHotContext **? import.meta.hot.on( 'type' .
i try in src/vite-env.d.ts
/// <reference types="vite/client" />
interface ImportMetaEnv {
readonly VITE_CUSTOM_ENV_VARIABLE: string
}
interface ImportMeta {
readonly env: ImportMetaEnv
}
interface ViteHotContext {
on<T extends ({}&string)|'mycustomevent1|mycustomevent2'>( // i want my custom string type here
event: T,
cb: ( payload: InferCustomEventPayload<T> ) => void,
): void
}
work for ImportMetaEnv, ImportMeta , but not for ViteHotContext !, i need strict custom events string or enums
