export interface LspPosition {
    line: number;
    character: number;
}
export interface LspRange {
    start: LspPosition;
    end: LspPosition;
}
export interface LspDiagnostic {
    range: LspRange;
    severity?: number;
    code?: string | number;
    source?: string;
    message: string;
}
export interface LspTextEdit {
    range: LspRange;
    newText: string;
}
export interface LspTextDocumentEdit {
    textDocument: {
        uri: string;
        version?: number | null;
    };
    edits: LspTextEdit[];
}
export interface LspWorkspaceEdit {
    changes?: Record<string, LspTextEdit[]>;
    documentChanges?: LspTextDocumentEdit[];
}
export interface LspCodeAction {
    title: string;
    kind?: string;
    diagnostics?: LspDiagnostic[];
    edit?: LspWorkspaceEdit;
    command?: unknown;
}
export interface LspClientStatus {
    cwd: string;
    running: boolean;
    initialized: boolean;
    openDocuments: number;
    diagnosticFiles: number;
}
export interface LspClientLike {
    start(): Promise<void>;
    hover(filePath: string, line: number, character: number): Promise<unknown>;
    definition(filePath: string, line: number, character: number): Promise<unknown>;
    references(filePath: string, line: number, character: number): Promise<unknown>;
    diagnostics(filePath: string, timeoutMs?: number): Promise<LspDiagnostic[]>;
    rename(filePath: string, line: number, character: number, newName: string): Promise<LspWorkspaceEdit | null>;
    codeActions(filePath: string, line: number, character: number): Promise<LspCodeAction[]>;
    capabilities(): unknown;
    status(): LspClientStatus;
    shutdown(): Promise<void>;
}
export declare class LspClient {
    private process;
    private messageBuffer;
    private nextId;
    private pendingRequests;
    private initialized;
    private cwd;
    private serverCapabilities;
    private openDocuments;
    private documentVersions;
    private diagnosticsByUri;
    constructor(cwd: string);
    start(): Promise<void>;
    private processMessages;
    private parseContentLength;
    private handleMessage;
    private failPendingRequests;
    private sendMessage;
    private sendRequest;
    private sendNotification;
    private openDocument;
    private closeDocument;
    initialize(): Promise<void>;
    hover(filePath: string, line: number, character: number): Promise<unknown>;
    definition(filePath: string, line: number, character: number): Promise<unknown>;
    references(filePath: string, line: number, character: number): Promise<unknown>;
    diagnostics(filePath: string, timeoutMs?: number): Promise<LspDiagnostic[]>;
    rename(filePath: string, line: number, character: number, newName: string): Promise<LspWorkspaceEdit | null>;
    codeActions(filePath: string, line: number, character: number): Promise<LspCodeAction[]>;
    capabilities(): unknown;
    status(): LspClientStatus;
    private waitForDiagnostics;
    shutdown(): Promise<void>;
}
export declare function getOrCreateLspClient(cwd: string): LspClient;
export declare function closeLspClient(): Promise<void>;
export declare function applyWorkspaceEdit(edit: LspWorkspaceEdit): string[];
//# sourceMappingURL=lsp-client.d.ts.map