1 |
|
2 |
|
3 |
|
4 |
|
5 | export class WebsocketClient extends Observable<string> {
|
6 | |
7 |
|
8 |
|
9 |
|
10 |
|
11 | constructor(url: string, { binaryType }?: {
|
12 | binaryType?: "arraybuffer" | "blob" | null | undefined;
|
13 | });
|
14 | url: string;
|
15 | /**
|
16 | * @type {WebSocket?}
|
17 | */
|
18 | ws: WebSocket | null;
|
19 | binaryType: "arraybuffer" | "blob" | null;
|
20 | connected: boolean;
|
21 | connecting: boolean;
|
22 | unsuccessfulReconnects: number;
|
23 | lastMessageReceived: number;
|
24 | |
25 |
|
26 |
|
27 |
|
28 | shouldConnect: boolean;
|
29 | _checkInterval: NodeJS.Timer;
|
30 | |
31 |
|
32 |
|
33 | send(message: any): void;
|
34 | disconnect(): void;
|
35 | connect(): void;
|
36 | }
|
37 | import { Observable } from './observable.js';
|
38 |
|
\ | No newline at end of file |