@tastekim/chat-cli
Version:
💬Connect with developers worldwide through an interactive terminal chat experience while you code!💻
21 lines (20 loc) • 702 B
TypeScript
import { EventEmitter } from 'events';
import { LocationInfo } from '../utils/location-detector';
export declare class WebSocketClient extends EventEmitter {
private ws;
private serverUrl;
private userLocation;
private reconnectAttempts;
private maxReconnectAttempts;
private reconnectDelay;
private isConnected;
private isReconnecting;
private reconnectTimeout;
constructor(serverUrl?: string);
connectWithParams(nickname: string, room: string, location?: LocationInfo): Promise<void>;
connect(): Promise<void>;
private attemptReconnect;
sendWebSocketMessage(message: object): boolean;
disconnect(): void;
isConnectionOpen(): boolean;
}