export declare enum WebSocketStatus { CONNECTING = "CONNECTING", OPEN = "OPEN", CLOSED = "CLOSED", RECONNECTING = "RECONNECTING" } export interface WebSocketHook { lastMessage: string | null; status: WebSocketStatus; sendMessage: (message: string) => void; } export interface WebSocketOptions { maxReconnectAttempts?: number; reconnectDelay?: (attempt: number) => number; onOpen?: () => void; onMessage?: (message: string) => void; onError?: (error: Event) => void; onClose?: (event: CloseEvent) => void; } /** * hook to manage WebSocket connections with auto-reconnect and state management. * @param url - WebSocket URL to connect to. * @param options - Configuration options for WebSocket behavior. * @returns WebSocketHook containing state and utility functions. */ export declare const useWebSocket: (url: string, { maxReconnectAttempts, reconnectDelay, onOpen, onMessage, onError, onClose, }?: WebSocketOptions) => WebSocketHook;