/**
 * CollabClient — headless WebSocket client for the collaboration signaling server.
 *
 * Lives in app/ (no TUI dependency). Manages connection, room lifecycle, and
 * message dispatch. Emits events via registered callbacks.
 */
import type { CollabCallbacks, CollabState, PeerInfo, SheetInfo } from './types.js';
export interface JoinResult {
    roomId: string;
    peerId: string;
    peers: PeerInfo[];
    docIds: string[];
}
export declare class CollabClient {
    private ws;
    private serverUrl;
    private callbacks;
    private _state;
    private createResolver;
    private joinResolver;
    private rejectResolver;
    constructor(serverUrl: string);
    get state(): Readonly<CollabState>;
    on<K extends keyof CollabCallbacks>(event: K, handler: CollabCallbacks[K]): void;
    private connect;
    private send;
    private handleBinaryMessage;
    sendSyncData(docId: string, data: Uint8Array): void;
    private handleMessage;
    createRoom(): Promise<string>;
    joinRoom(roomId: string, displayName: string): Promise<JoinResult>;
    sendChat(text: string): void;
    sendAwareness(sheets: SheetInfo[]): void;
    leave(): void;
    destroy(): void;
}
//# sourceMappingURL=collab-client.d.ts.map