import type { LspClient, ServerConfig } from "./types"; /** * Configure the idle timeout for LSP clients. * @param ms - Timeout in milliseconds, or null/undefined to disable */ export declare function setIdleTimeout(ms: number | null | undefined): void; /** Timeout for warmup initialize requests (5 seconds) */ export declare const WARMUP_TIMEOUT_MS = 5000; /** * Get or create an LSP client for the given server configuration and working directory. * @param config - Server configuration * @param cwd - Working directory * @param initTimeoutMs - Optional timeout for the initialize request (defaults to 30s) */ export declare function getOrCreateClient(config: ServerConfig, cwd: string, initTimeoutMs?: number): Promise; /** * Ensure a file is opened in the LSP client. * Sends didOpen notification if the file is not already tracked. */ export declare function ensureFileOpen(client: LspClient, filePath: string, signal?: AbortSignal): Promise; /** * Wait for the server's initial project loading to complete. * Races the server's $/progress tracking against the abort signal. * Returns immediately if loading already completed or timed out. */ export declare function waitForProjectLoaded(client: LspClient, signal?: AbortSignal): Promise; /** * Sync in-memory content to the LSP client without reading from disk. * Use this to provide instant feedback during edits before the file is saved. */ export declare function syncContent(client: LspClient, filePath: string, content: string, signal?: AbortSignal): Promise; /** * Notify LSP that a file was saved. * Assumes content was already synced via syncContent - just sends didSave. */ export declare function notifySaved(client: LspClient, filePath: string, signal?: AbortSignal): Promise; /** * Refresh a file in the LSP client. * Increments version, sends didChange and didSave notifications. */ export declare function refreshFile(client: LspClient, filePath: string, signal?: AbortSignal): Promise; export declare function shutdownClient(key: string): Promise; /** * Send an LSP request and wait for response. */ export declare function sendRequest(client: LspClient, method: string, params: unknown, signal?: AbortSignal, timeoutMs?: number): Promise; /** * Send an LSP notification (no response expected). */ export declare function sendNotification(client: LspClient, method: string, params: unknown): Promise; /** * Shutdown all LSP clients. */ export declare function shutdownAll(): Promise; /** Status of an LSP server */ export interface LspServerStatus { name: string; status: "connecting" | "ready" | "error"; fileTypes: string[]; error?: string; } /** * Get status of all active LSP clients. */ export declare function getActiveClients(): LspServerStatus[];