/**
 * Inline-comment line-mapping validator (see design.md → Error Handling →
 * Inline-comment line mapping).
 *
 * GitHub's `POST /repos/:owner/:repo/pulls/:N/reviews` rejects inline comments
 * at file:line positions not present in the PR diff. Before adding a finding to
 * the `comments[]` payload, the caller classifies it against the parsed hunk
 * ranges. Out-of-diff findings are NOT silently dropped or shifted — the caller
 * downgrades them to a top-level "Findings outside the PR diff" subsection.
 *
 * Two parsers feed one classifier with a single shared {@link HunkRange} shape:
 *  - {@link parsePullFilesPatch} for the per-file `patch` field of
 *    `gh api /repos/.../pulls/<N>/files` (rich-context mode).
 *  - {@link parseUnifiedDiff} for `gh pr diff <N>` (diff-only fallback mode).
 */
/** A single diff hunk's old- and new-side ranges. Shared by both parsers. */
export interface HunkRange {
    /** 1-based start line on the old (LEFT) side. */
    oldStart: number;
    /** Line count on the old side. */
    oldCount: number;
    /** 1-based start line on the new (RIGHT) side. */
    newStart: number;
    /** Line count on the new side. */
    newCount: number;
    /** Pre-rename path, when the owning file was renamed. */
    previousFilename?: string;
}
/** A finding location to classify against a file's hunk ranges. */
export interface FindingLocation {
    file: string;
    line: number;
    /** Set when the finding is explicitly about removed code (LEFT side). */
    removed?: boolean;
}
export interface InDiffClassification {
    status: 'in-diff';
    side: 'RIGHT' | 'LEFT';
    line: number;
}
export interface OutOfDiffClassification {
    status: 'out-of-diff';
    /** Original file reference, carried through for the downgrade subsection. */
    file: string;
    /** Original line reference, carried through for the downgrade subsection. */
    line: number;
}
export type FindingClassification = InDiffClassification | OutOfDiffClassification;
/**
 * Parse the `patch` field of a single `gh api .../pulls/<N>/files` entry into
 * its hunk ranges. Returns `[]` for an empty patch (e.g., a binary file, whose
 * entry has no `patch`).
 *
 * Caller contract for renamed files: a `gh api .../files` entry carries the
 * pre-rename path in a sibling `previous_filename` field, NOT in `patch`. This
 * parser only sees `patch`, so it cannot populate `HunkRange.previousFilename`
 * in rich-context (gh api) mode. When a finding is reported against the
 * pre-rename path, the caller must remap it to the entry's post-rename
 * `filename` (using the JSON `previous_filename`) before calling
 * `classifyFinding` — otherwise the finding is treated as out-of-diff. (The
 * `gh pr diff` path handles this internally: `parseUnifiedDiff` records
 * `previousFilename` from the `rename from` header.)
 */
export declare function parsePullFilesPatch(patch: string): HunkRange[];
/**
 * Parse a full `gh pr diff <N>` unified diff into a map of post-image file path
 * → hunk ranges. Renamed files are keyed under their post-rename path with
 * `previousFilename` recorded; binary files map to an empty array.
 */
export declare function parseUnifiedDiff(diff: string): Record<string, HunkRange[]>;
/**
 * Classify a finding against a file's hunk ranges.
 *
 * A line inside any hunk's new-side range is `in-diff` on the `RIGHT` side
 * (additions/context); when the finding is explicitly about removed code it is
 * mapped to the `LEFT` side instead. A line outside every hunk — or a file with
 * no ranges (binary) — is `out-of-diff`, carrying the original `file:line` so
 * the caller can downgrade it without mutating the source finding.
 */
export declare function classifyFinding(finding: FindingLocation, ranges: HunkRange[]): FindingClassification;
//# sourceMappingURL=line-mapper.d.ts.map