modality-kit 0.8.4 → 0.8.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,55 @@
1
+ import type { JSONRPCValidationResult } from "./schemas/jsonrpc";
2
+ interface WebSocketConfig {
3
+ maxReconnectAttempts: number;
4
+ initialReconnectDelay: number;
5
+ maxReconnectDelay: number;
6
+ callTimeout: number;
7
+ heartbeatInterval: number;
8
+ enableKeepAlive: boolean;
9
+ handleMessage: (validMessage: JSONRPCValidationResult, ws: WebSocketClient) => void;
10
+ }
11
+ interface WebSocketInfo {
12
+ url: string;
13
+ connected: boolean;
14
+ clientId: string;
15
+ connectionId: number | null;
16
+ pendingCalls?: number;
17
+ }
18
+ export declare class WebSocketClient {
19
+ private ws;
20
+ private url;
21
+ private config;
22
+ private connectionId;
23
+ private cleanupInterval;
24
+ private isManualDisconnect;
25
+ private reconnectAttempts;
26
+ private reconnectDelay;
27
+ private heartbeatInterval;
28
+ constructor(url: string, config?: Record<keyof WebSocketConfig, any>);
29
+ private isValidWebSocketUrl;
30
+ private stopCleanupInterval;
31
+ private stopHeartbeat;
32
+ private startHeartbeat;
33
+ private attemptReconnect;
34
+ private onOpen;
35
+ private onClose;
36
+ private getClientId;
37
+ send(data: any): boolean;
38
+ isConnected(): boolean;
39
+ getInfo(): WebSocketInfo;
40
+ /**
41
+ * Force reconnection even if currently connected
42
+ */
43
+ forceReconnect(): void;
44
+ /**
45
+ * Get heartbeat interval in milliseconds (for testing)
46
+ */
47
+ getHeartbeatInterval(): number;
48
+ /**
49
+ * Get keep-alive enabled status (for testing)
50
+ */
51
+ getEnableKeepAlive(): boolean;
52
+ disconnect(): void;
53
+ connect(): void;
54
+ }
55
+ export {};
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.8.4",
2
+ "version": "0.8.5",
3
3
  "name": "modality-kit",
4
4
  "repository": {
5
5
  "type": "git",