2021-03-01 15:06:11 +08:00

34 lines
826 B
TypeScript

export declare type HMRPayload = ConnectedPayload | UpdatePayload | FullReloadPayload | StyleRemovePayload | SWBustCachePayload | CustomPayload | MultiUpdatePayload;
interface ConnectedPayload {
type: 'connected';
}
export interface UpdatePayload {
type: 'js-update' | 'vue-reload' | 'vue-rerender' | 'style-update';
path: string;
changeSrcPath: string;
timestamp: number;
}
interface StyleRemovePayload {
type: 'style-remove';
path: string;
id: string;
}
interface FullReloadPayload {
type: 'full-reload';
path: string;
}
interface SWBustCachePayload {
type: 'sw-bust-cache';
path: string;
}
interface CustomPayload {
type: 'custom';
id: string;
customData: any;
}
export interface MultiUpdatePayload {
type: 'multi';
updates: UpdatePayload[];
}
export {};