import { type Dispatch, type SetStateAction } from "react";
import { type EditorSocketDiagnostics } from "../socketDiagnostics";
export type ConcurrentUserLimitError = {
    backendReachable: boolean;
    currentUsers: number;
    maxUsers: number;
    message: string;
};
/**
 * Closes the active editor websocket so the hook's own reconnect machinery picks it back
 * up. Used by recovery code that wants the freshly opened socket to re-issue agent
 * subscriptions via the existing onOpen callback chain — not for routine close handling.
 *
 * Returns whether a reconnect was actually initiated. The hook's close handler does NOT null
 * `globalThis.editorSocket`; the next `connect()` call detects `readyState === CLOSED`
 * and overwrites the global, so we must not delete it from this helper. When the socket
 * is missing or already CLOSING/CLOSED there is no close event to drive recovery, so we route
 * through the hook's reconnect handler, which re-enters the connect path directly.
 */
export declare function forceEditorSocketReconnect(reason: string): boolean;
export declare function useEditorWebSocket(params: {
    sessionId: string;
    onMessage: (event: MessageEvent<any>) => void;
    onOpen?: () => void;
    onError?: (error: Event) => void;
    onConcurrentUserLimit?: (error: ConcurrentUserLimitError) => void;
    onSessionRevoked?: () => void;
    connectSocket: (sessionId: string) => WebSocket;
    requestQuota?: () => void;
    sendClientInfo: () => Promise<void> | void;
    setSocketDiagnostics?: Dispatch<SetStateAction<EditorSocketDiagnostics>>;
    enableWebSocketTransport?: boolean;
    enableSseFallback?: boolean;
    transportSettingsReady?: boolean;
}): {
    readonly socketRef: import("react").RefObject<WebSocket | null>;
};
