/** * Matches one line ending: CRLF (`\r\n`), lone CR (`\r`), or LF (`\n`). * Safe to share: `String.prototype.split` ignores the `g` flag/lastIndex, * and `String.prototype.match` with `g` always scans from index 0. */ export declare const newLineRe: RegExp; /** * Gets the file's most common line ending, falling back to the platform * default for content with no line endings at all — the exact semantics of * upstream's `getPreferredLineEnding(input, os)`. `applyFixesToContent` * joins fixed lines with this, so an all-CRLF file round-trips through * --fix still CRLF (and a mixed-endings file is normalized to its * majority ending, as markdownlint's `applyFixes` does). */ /** * Maps a 0-based character offset within `text` to a 1-based * (line, column) pair, treating CRLF, lone CR, and lone LF each as ONE * line ending — the single offset→position mapping every scope-rule * internals must use instead of hand-rolled `split('\n')` / * `lastIndexOf('\n')` arithmetic (which, on a CR-only file, keeps every * offset on line 1 with a column counted from the start of the text). * * An offset pointing INTO a CRLF pair (at its '\n') is reported as * column 1 of the following line; real callers pass match/sentence * offsets, which never start inside a line ending. */ export declare function offsetToLineColumn(text: string, offset: number): { line: number; column: number; }; export declare function getPreferredLineEnding(input: string): string; //# sourceMappingURL=line-endings.d.ts.map