1 |
|
2 | import WebSocket from 'ws';
|
3 | import type http from 'http';
|
4 | import type http2 from 'http2';
|
5 | interface Dependency {
|
6 | dependents: Set<string>;
|
7 | dependencies: Set<string>;
|
8 | isHmrEnabled: boolean;
|
9 | isHmrAccepted: boolean;
|
10 | needsReplacement: boolean;
|
11 | }
|
12 | export declare class EsmHmrEngine {
|
13 | clients: Set<WebSocket>;
|
14 | dependencyTree: Map<string, Dependency>;
|
15 | constructor(options?: {
|
16 | server?: http.Server | http2.Http2Server;
|
17 | });
|
18 | registerListener(client: WebSocket): void;
|
19 | createEntry(sourceUrl: string): Dependency;
|
20 | getEntry(sourceUrl: string, createIfNotFound?: boolean): Dependency | null;
|
21 | setEntry(sourceUrl: string, imports: string[], isHmrEnabled?: boolean): void;
|
22 | removeRelationship(sourceUrl: string, importUrl: string): void;
|
23 | addRelationship(sourceUrl: string, importUrl: string): void;
|
24 | markEntryForReplacement(entry: Dependency, state: boolean): void;
|
25 | broadcastMessage(data: object): void;
|
26 | connectClient(client: WebSocket): void;
|
27 | disconnectClient(client: WebSocket): void;
|
28 | disconnectAllClients(): void;
|
29 | }
|
30 | export {};
|