/** * Diff computation, line counting, and threshold decisions. */ import type { PiTsLintConfig } from "./config.js"; /** * Count the number of lines that differ between two strings. * Uses the `diff` library's `diffLines` to compute a line-level diff, * then counts the total lines that are added or removed. * This correctly handles insertions, deletions, and moves without * inflating the count due to positional shifts. */ export declare function countModifiedLines(oldContent: string, newContent: string): number; /** * Generate a unified diff string between two file contents. * Uses the `diff` library's `diffLines` and formats the output * in a simple, readable format that the model can easily correlate * with compilation error line numbers. */ export declare function getDiffString(oldContent: string, newContent: string): string; /** * Determine whether the diff should be included in the error message. * The diff is included only when the change is large enough to need context * AND small enough to be useful. * All three conditions must be met: * 1. Error count >= MIN_ERRORS_TO_SHOW (need correlation) * 2. Modified lines <= MAX_ABSOLUTE_LINES (diff fits) * 3. Modified lines / total lines of new file <= MAX_PERCENTAGE (diff is readable) */ export declare function shouldIncludeDiff(errorCount: number, modifiedLines: number, totalLinesNewFile: number, diffThreshold: PiTsLintConfig["diffThreshold"]): boolean; /** * Determine whether linting should be performed based on change complexity. * Linting is performed only when the change is large enough to justify the cost. * A change is considered "large" only when BOTH conditions are met: * 1. Modified lines >= MIN_ABSOLUTE_LINES * 2. Modified lines / total lines >= MIN_PERCENTAGE */ export declare function shouldLint(existingContent: string, newContent: string, changeComplexity: PiTsLintConfig["changeComplexity"]): boolean;