You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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" />interfaceImportMetaEnv{readonlyVITE_CUSTOM_ENV_VARIABLE: string}interfaceImportMeta{readonlyenv: ImportMetaEnv}interfaceViteHotContext{on<Textends({}&string)|'mycustomevent1|mycustomevent2'>(// i want my custom string type here event: T,cb: (payload: InferCustomEventPayload<T>)=>void,): void}
work for ImportMetaEnv, ImportMeta , but not forViteHotContext !, i need strict custom events string or enums
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
hi, how do we add type for custom event in **ViteHotContext **?
import.meta.hot.on( 'type'
.i try in
src/vite-env.d.ts
work for
ImportMetaEnv
,ImportMeta
, but not forViteHotContext
!, i need strict custom events string or enumsBeta Was this translation helpful? Give feedback.
All reactions