import type { Message, ServerOptions, ServerPosition } from './messages'; export type ReplaceTextCommand = { start: ServerPosition; length: number; newText: string; cursorIndexAfter: ServerPosition; reason?: string | null; }; type HandlerMap = { open: () => void; message: (data: Message) => void; close: () => void; }; export declare class Connection { #private; constructor(url: string, { closed }: { closed: boolean | undefined; }); addEventListeners(listeners: Partial>): () => void; open(): void; isOpen(): boolean; sendReplaceText({ start, length, cursorIndexAfter, newText, reason }: ReplaceTextCommand): Promise; sendMoveCursor(cursorIndex: ServerPosition): Promise; sendTypeChar(char: string): Promise; sendCompletionState(indexOrCommand: 'info' | 'force' | number | 'cancel', indexIfInfo?: number): Promise; sendSignatureHelpState(command: 'force' | 'cancel'): Promise; sendRequestInfoTip(cursorIndex: ServerPosition): Promise; sendSlowUpdate(): Promise; sendApplyDiagnosticAction(actionId: number): Promise; sendSetOptions(options: Partial & Partial): Promise; setUrl(url: string, { closed }: { closed: boolean | undefined; }): void; close(): void; } export {};