1 |
|
2 | export type HMRPayload = HotPayload
|
3 | export type HotPayload =
|
4 | | ConnectedPayload
|
5 | | PingPayload
|
6 | | UpdatePayload
|
7 | | FullReloadPayload
|
8 | | CustomPayload
|
9 | | ErrorPayload
|
10 | | PrunePayload
|
11 |
|
12 | export interface ConnectedPayload {
|
13 | type: 'connected'
|
14 | }
|
15 |
|
16 | export interface PingPayload {
|
17 | type: 'ping'
|
18 | }
|
19 |
|
20 | export interface UpdatePayload {
|
21 | type: 'update'
|
22 | updates: Update[]
|
23 | }
|
24 |
|
25 | export interface Update {
|
26 | type: 'js-update' | 'css-update'
|
27 | path: string
|
28 | acceptedPath: string
|
29 | timestamp: number
|
30 |
|
31 | explicitImportRequired?: boolean
|
32 |
|
33 | isWithinCircularImport?: boolean
|
34 |
|
35 | invalidates?: string[]
|
36 | }
|
37 |
|
38 | export interface PrunePayload {
|
39 | type: 'prune'
|
40 | paths: string[]
|
41 | }
|
42 |
|
43 | export interface FullReloadPayload {
|
44 | type: 'full-reload'
|
45 | path?: string
|
46 |
|
47 | triggeredBy?: string
|
48 | }
|
49 |
|
50 | export interface CustomPayload {
|
51 | type: 'custom'
|
52 | event: string
|
53 | data?: any
|
54 | }
|
55 |
|
56 | export interface ErrorPayload {
|
57 | type: 'error'
|
58 | err: {
|
59 | [name: string]: any
|
60 | message: string
|
61 | stack: string
|
62 | id?: string
|
63 | frame?: string
|
64 | plugin?: string
|
65 | pluginCode?: string
|
66 | loc?: {
|
67 | file?: string
|
68 | line: number
|
69 | column: number
|
70 | }
|
71 | }
|
72 | }
|