import type { LspPosition } from "./types.js"; /** * Position/offset conversion for LSP using UTF-16 code units (the LSP default * and the only encoding we negotiate from servers on initialize). Operates on * a per-file line index and is CRLF/LF aware: line breaks are \n (with optional * \r ignored as part of the line terminator). */ export interface LineIndex { /** Byte offsets of each line start (0..n). */ lineStarts: number[]; } export declare function computeLineIndex(text: string): LineIndex; /** Convert a UTF-16 code-unit offset to an LSP position (0-based line/char). */ export declare function offsetToPosition(text: string, index: LineIndex, offset: number): LspPosition; /** Convert an LSP position (UTF-16) to a JS string offset. */ export declare function positionToOffset(text: string, index: LineIndex, pos: LspPosition): number; export declare function offsetToLineCharacter(text: string, offset: number): LspPosition; //# sourceMappingURL=position.d.ts.map