/** * Parse unified-diff text and return the set of 1-based line numbers that are * ADDED in the new version of the file. Works at any `--unified` context level. */ export declare function addedLinesFromUnifiedDiff(diff: string): Set; /** Keep only findings whose line number is in the added-line set. */ export declare function filterToAddedLines(findings: T[], added: Set): T[]; /** Lines added in `relPath` relative to a git base ref (branch/commit/HEAD~N). */ export declare function getAddedLinesForDiff(base: string, relPath: string, cwd: string): Set; /** Lines added in `relPath` in the staged (index) changes — for pre-commit gating. */ export declare function getAddedLinesStaged(relPath: string, cwd: string): Set; export interface BaseResolution { ok: boolean; base?: string; error?: string; } /** * Resolve a usable diff base. Distinguishes "not a git repository" from "that ref does * not exist here" (the old code conflated both as "Ensure you're in a git repository"), * and — when no base is explicitly requested — auto-detects instead of hard-coding `main` * (which fails on `master`-named or freshly-initialized repos). Fallback order: * origin/HEAD → main → master → HEAD~1 → HEAD (uncommitted changes). * * @param strict when a base IS requested but missing, error instead of falling back * (used by the CLI so a typo'd ref is reported, not silently swapped). */ export declare function resolveGitBase(cwd: string, requested?: string, opts?: { strict?: boolean; }): BaseResolution;