import type { Message, ServerOptions } from '../interfaces/protocol'; import type { SelfDebug } from './self-debug'; export declare type ConnectionEventMap = { open: (e: Event) => void; message: (data: Message, e: MessageEvent) => void; error: (e: ErrorEvent) => void; close: (e: CloseEvent) => void; }; export declare class Connection { #private; constructor(url: string, selfDebug: SelfDebug | null, { delayedOpen }?: { delayedOpen?: boolean; }); open: () => void; on>(key: TKey, handler: ConnectionEventMap[TKey]): void; off>(key: TKey, handler: ConnectionEventMap[TKey]): void; sendReplaceText(start: number, length: number, newText: string, cursorIndexAfter: number, reason?: string | null): Promise; sendMoveCursor(cursorIndex: number): Promise; sendTypeChar(char: string): Promise; sendCompletionState(indexOrCommand: 'info' | 'force' | number | 'cancel', indexIfInfo?: number): Promise; sendSignatureHelpState(command: 'force' | 'cancel'): Promise; sendRequestInfoTip(cursorIndex: number): Promise; sendSlowUpdate(): Promise; sendApplyDiagnosticAction(actionId: number): Promise; sendSetOptions(options: ServerOptions | Partial): Promise; sendRequestSelfDebugData(): Promise; close(): void; }