import type { LspServerSpec, ResolvedCommand } from "./servers.js";
/** LSP diagnostic shape (the subset we render). */
export interface LspDiagnostic {
    range: {
        start: {
            line: number;
            character: number;
        };
        end: {
            line: number;
            character: number;
        };
    };
    severity?: number;
    message: string;
    source?: string;
    code?: string | number;
}
/**
 * One language-server process bound to one project root. Owns document sync
 * (didOpen / didChange / didSave with per-uri version counters), the
 * push-diagnostics cache, and LSP 3.17 pull diagnostics with the
 * push-vs-pull race that the POC proved necessary for rust-analyzer.
 */
export declare class LspClient {
    private readonly spec;
    private readonly rootPath;
    private readonly proc;
    private readonly conn;
    private readonly versions;
    private readonly published;
    private waiters;
    private hasPullDiagnostics;
    private readonly activeProgressTokens;
    private alive;
    private readonly initializationOptions;
    constructor(spec: LspServerSpec, rootPath: string, command: ResolvedCommand);
    get isAlive(): boolean;
    /** True while the server reports indexing/analysis through LSP work progress. */
    get hasActiveProgress(): boolean;
    initialize(timeoutMs: number): Promise<void>;
    /**
     * Sync `content` into the server's overlay for `filePath` — didOpen the
     * first time, didChange (full text) + didSave afterwards. Clears the
     * push-diagnostics cache for the uri so a subsequent collect waits for a
     * report computed against THIS content rather than a stale one.
     */
    syncDocument(filePath: string, content: string): string;
    /**
     * Current diagnostics for `uri`, racing the push channel (next
     * publishDiagnostics after the last sync) against a pull-diagnostics poll
     * loop when the server supports LSP 3.17 pull. Returns null on timeout.
     */
    collectDiagnostics(uri: string, timeoutMs: number): Promise<LspDiagnostic[] | null>;
    /**
     * Graceful shutdown/exit handshake with SIGKILL fallback. Synchronous so it
     * is safe inside `process.on("exit")` handlers: the shutdown request and
     * exit notification are written immediately; the SIGKILL timer covers
     * servers that ignore them (and stdin EOF reaps them when we die first).
     */
    shutdown(): void;
    private markDead;
    private waitForPublish;
    private pullDiagnostics;
}
//# sourceMappingURL=client.d.ts.map