/** * LineIndex - Fast row/col → offset conversion */ /** * LineIndex interface for fast row/col → offset conversion */ export interface LineIndex { offsetAt(row: number, col: number, exclusive?: boolean): number; lineEndOffset(row: number): number; hasNewline(row: number): boolean; getLine(row: number): string; getLines(): string[]; lineCount(): number; } /** * LineIndex implementation - Fast row/col → offset conversion * * Build once per originalScript. Provides O(1) offset conversion * by pre-computing line-start offsets. */ export declare class LineIndexImpl implements LineIndex { private readonly lineStartOffsets; private readonly lines; private readonly originalScript; constructor(originalScript: string); /** * Convert row/column to character offset * @param row Zero-based row number * @param col Zero-based column number * @param exclusive If true, return offset one past the column (for end positions) * @returns Character offset in the script string */ offsetAt(row: number, col: number, exclusive?: boolean): number; /** * Get the offset at the end of a line (after the newline) */ lineEndOffset(row: number): number; /** * Check if a line has a newline character */ hasNewline(row: number): boolean; /** * Get the text content of a specific line */ getLine(row: number): string; /** * Get all lines as an array */ getLines(): string[]; /** * Get the total number of lines */ lineCount(): number; }