File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,10 @@ Vite は特別な `import.meta.hot` オブジェクトを介して、マニュ
1010
1111``` ts twoslash
1212import type { ModuleNamespace } from ' vite/types/hot.d.ts'
13- import type { InferCustomEventPayload } from ' vite/types/customEvent.d.ts'
13+ import type {
14+ CustomEventName ,
15+ InferCustomEventPayload ,
16+ } from ' vite/types/customEvent.d.ts'
1417
1518// ---cut---
1619interface ImportMeta {
@@ -32,15 +35,18 @@ interface ViteHotContext {
3235 prune(cb : (data : any ) => void ): void
3336 invalidate(message ? : string ): void
3437
35- on<T extends string >(
38+ on<T extends CustomEventName >(
3639 event : T ,
3740 cb : (payload : InferCustomEventPayload <T >) => void ,
3841 ): void
39- off<T extends string >(
42+ off<T extends CustomEventName >(
4043 event : T ,
4144 cb : (payload : InferCustomEventPayload <T >) => void ,
4245 ): void
43- send<T extends string >(event : T , data ? : InferCustomEventPayload <T >): void
46+ send<T extends CustomEventName >(
47+ event : T ,
48+ data ? : InferCustomEventPayload <T >,
49+ ): void
4450}
4551```
4652
You can’t perform that action at this time.
0 commit comments