/** * Text normalization utilities for the edit tool. * * Handles line endings, BOM, whitespace, and Unicode normalization. */ export type LineEnding = "\r\n" | "\n"; /** Detect the predominant line ending in content */ export declare function detectLineEnding(content: string): LineEnding; /** Normalize all line endings to LF */ export declare function normalizeToLF(text: string): string; /** Restore line endings to the specified type */ export declare function restoreLineEndings(text: string, ending: LineEnding): string; export interface BomResult { /** The BOM character if present, empty string otherwise */ bom: string; /** The text without the BOM */ text: string; } /** Strip UTF-8 BOM if present */ export declare function stripBom(content: string): BomResult; /** Count leading whitespace characters in a line */ export declare function countLeadingWhitespace(line: string): number; /** Get the leading whitespace string from a line */ export declare function getLeadingWhitespace(line: string): string; /** Compute minimum indentation of non-empty lines */ export declare function minIndent(text: string): number; /** Detect the indentation character used in text (space or tab) */ export declare function detectIndentChar(text: string): string; export declare function convertLeadingTabsToSpaces(text: string, spacesPerTab: number): string; export declare function normalizeUnicode(s: string): string; /** * Normalize a line for fuzzy comparison. * Trims, collapses whitespace, and normalizes punctuation. */ export declare function normalizeForFuzzy(line: string): string; /** * Adjust newText indentation to match the indentation delta between * what was provided (oldText) and what was actually matched (actualText). * * If oldText has 0 indent but actualText has 12 spaces, we add 12 spaces * to each line in newText. */ export declare function adjustIndentation(oldText: string, actualText: string, newText: string): string;