import { BlockFile } from './blockFile'; /** * On-demand line reading over a BlockFile, ported from less input.c's * forw_line/back_line: lines materialize from byte positions, so no * line index or full scan is ever required. */ /** Pathological lines split at this many bytes (less grows linebuf; * we bound memory instead — the renderer wraps/chops anyway, and * every split segment costs a transform+layout per visible row). */ export declare const MAX_LINE: number; interface ForwLine { text: string; /** Start of the next line (past the newline), or the file size. */ next: number; /** True when the cap split a newline-less monster line. */ split: boolean; } interface BackLine { text: string; /** Start position of the returned line. */ start: number; } /** * Reads the line starting at `pos`, like forw_line. * * The result is shared with the other callers reading the same * position, so it must be treated as read-only. */ export declare function forwLine(bf: BlockFile, pos: number, noScan?: boolean): ForwLine | null; /** * Reads the line that ends just before line-start `pos`, like * back_line walking to the previous newline. * * @param pos - A known line start (0 returns null). */ export declare function backLine(bf: BlockFile, pos: number): BackLine | null; /** * The start of the last line of the file, like less's end-of-file seek * for G: a trailing newline belongs to the line before it. */ export declare function lastLineStart(bf: BlockFile): number; export {};