File tree 1 file changed +18
-12
lines changed
1 file changed +18
-12
lines changed Original file line number Diff line number Diff line change @@ -10,21 +10,27 @@ Vite exposes its manual HMR API via the special `import.meta.hot` object:
10
10
11
11
``` ts
12
12
interface ImportMeta {
13
- readonly hot? : {
14
- readonly data: any
13
+ readonly hot? : ViteHotContext
14
+ }
15
+
16
+ interface ViteHotContext {
17
+ readonly data: any
15
18
16
- accept(): void
17
- accept(cb : (mod : any ) => void ): void
18
- accept(dep : string , cb : (mod : any ) => void ): void
19
- accept(deps : string [], cb : (mods : any []) => void ): void
19
+ accept(): void
20
+ accept(cb : (mod : any ) => void ): void
21
+ accept(dep : string , cb : (mod : any ) => void ): void
22
+ accept(deps : readonly string [], cb : (mods : any []) => void ): void
20
23
21
- prune(cb : () => void ): void
22
- dispose(cb : (data : any ) => void ): void
23
- decline(): void
24
- invalidate(): void
24
+ dispose(cb : (data : any ) => void ): void
25
+ decline(): void
26
+ invalidate(): void
25
27
26
- on(event : string , cb : (... args : any []) => void ): void
27
- }
28
+ // `InferCustomEventPayload` provides types for built-in Vite events
29
+ on<T extends string >(
30
+ event : T ,
31
+ cb : (payload : InferCustomEventPayload <T >) => void
32
+ ): void
33
+ send<T extends string >(event : T , data ? : InferCustomEventPayload <T >): void
28
34
}
29
35
```
30
36
You can’t perform that action at this time.
0 commit comments