import type { WsState } from '../ws-client.js'; import type { TuiFrame, HandshakeAck } from '../../platform/tui/protocol.js'; export interface UseWsClientOpts { /** WebSocket address, e.g. ws://127.0.0.1:3003 */ address: string; /** Session ID to resume (null for fresh) */ resumeSessionId?: string | null; /** Project to join (null for default) */ project?: string | null; /** Called for every parsed frame */ onFrame?: (frame: TuiFrame) => void; /** Called on successful connection after handshake.ack */ onConnected?: (ack: HandshakeAck) => void; /** Called on cap-exceeded (all retries exhausted) */ onCapExceeded?: () => void; } export interface UseWsClientResult { /** Current connection state */ state: WsState; /** Connected handshake ack (null until connected) */ ack: HandshakeAck | null; /** Send a frame to the server */ sendFrame: (frame: TuiFrame) => void; /** Manually reconnect */ reconnect: () => void; /** Disconnect */ disconnect: () => void; } export declare function useWsClient(opts: UseWsClientOpts): UseWsClientResult;