UNPKG

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