/**
 * LSP Client implementation
 * Manages connections to language servers via JSON-RPC over stdio
 */
import { EventEmitter } from 'node:events';
import { CodeAction, CompletionItem, Diagnostic, FormattingOptions, InitializeResult, Position, ServerCapabilities, TextEdit } from './protocol.js';
export interface LSPServerConfig {
    name: string;
    command: string;
    args?: string[];
    env?: Record<string, string>;
    languages: string[];
    rootUri?: string;
}
export declare class LSPClient extends EventEmitter {
    private config;
    private process;
    private buffer;
    private requestId;
    private pendingRequests;
    private initialized;
    private serverCapabilities;
    private openDocuments;
    constructor(config: LSPServerConfig);
    /**
     * Start the language server process and initialize
     */
    start(): Promise<InitializeResult>;
    /**
     * Stop the language server
     */
    stop(): Promise<void>;
    /**
     * Check if the server is running and initialized
     */
    isReady(): boolean;
    /**
     * Get server capabilities
     */
    getCapabilities(): ServerCapabilities | null;
    /**
     * Open a text document
     */
    openDocument(uri: string, languageId: string, text: string): void;
    /**
     * Update a text document
     */
    updateDocument(uri: string, text: string): void;
    /**
     * Close a text document
     */
    closeDocument(uri: string): void;
    /**
     * Get completions at a position
     */
    getCompletions(uri: string, position: Position): Promise<CompletionItem[]>;
    /**
     * Get code actions (quick fixes, refactorings)
     */
    getCodeActions(uri: string, diagnostics: Diagnostic[], startLine: number, startChar: number, endLine: number, endChar: number): Promise<CodeAction[]>;
    /**
     * Format a document
     */
    formatDocument(uri: string, options?: Partial<FormattingOptions>): Promise<TextEdit[]>;
    /**
     * Request diagnostics for a document (pull model)
     * Note: Most LSPs use push model via publishDiagnostics notification
     */
    getDiagnostics(uri: string): Promise<Diagnostic[]>;
    private initialize;
    private sendRequest;
    private sendNotification;
    private send;
    private handleData;
    private handleMessage;
    private handleNotification;
}
//# sourceMappingURL=lsp-client.d.ts.map