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` オブジェクトを介して、マニュ
10
10
11
11
``` ts twoslash
12
12
import 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'
14
17
15
18
// ---cut---
16
19
interface ImportMeta {
@@ -32,15 +35,18 @@ interface ViteHotContext {
32
35
prune(cb : (data : any ) => void ): void
33
36
invalidate(message ? : string ): void
34
37
35
- on<T extends string >(
38
+ on<T extends CustomEventName >(
36
39
event : T ,
37
40
cb : (payload : InferCustomEventPayload <T >) => void ,
38
41
): void
39
- off<T extends string >(
42
+ off<T extends CustomEventName >(
40
43
event : T ,
41
44
cb : (payload : InferCustomEventPayload <T >) => void ,
42
45
): 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
44
50
}
45
51
```
46
52
You can’t perform that action at this time.
0 commit comments