import { z } from 'zod';
import type { CodebaseIndex, CodeCapabilities, NormalizedSymbolKind } from './types.js';
import type { RankResult } from './rank.js';
import type { GitDiffHunks, GitRange } from '../git/types.js';
export declare const ChangedSymbolSchema: z.ZodObject<{
    nodeId: z.ZodOptional<z.ZodString>;
    kind: z.ZodEnum<{
        function: "function";
        file: "file";
        enum: "enum";
        type: "type";
        module: "module";
        class: "class";
        interface: "interface";
        variable: "variable";
        parameter: "parameter";
        method: "method";
        other: "other";
    }>;
    name: z.ZodString;
    containerName: z.ZodOptional<z.ZodString>;
    file: z.ZodString;
    relativePath: z.ZodString;
    line: z.ZodOptional<z.ZodNumber>;
    endLine: z.ZodOptional<z.ZodNumber>;
    endLineApprox: z.ZodOptional<z.ZodBoolean>;
    changeKind: z.ZodEnum<{
        signature: "signature";
        added: "added";
        modified: "modified";
        removed: "removed";
    }>;
    churn: z.ZodObject<{
        added: z.ZodNumber;
        deleted: z.ZodNumber;
    }, z.core.$strip>;
    rank: z.ZodNumber;
    isExported: z.ZodBoolean;
    isNewExport: z.ZodBoolean;
    signature: z.ZodOptional<z.ZodString>;
    provenance: z.ZodEnum<{
        index: "index";
        "function-context": "function-context";
        "hunk-scan": "hunk-scan";
        "base-index": "base-index";
    }>;
}, z.core.$strip>;
export interface ChangedSymbol {
    nodeId?: string;
    kind: NormalizedSymbolKind;
    name: string;
    containerName?: string;
    file: string;
    relativePath: string;
    line?: number;
    endLine?: number;
    endLineApprox?: boolean;
    changeKind: 'added' | 'modified' | 'removed' | 'signature';
    churn: {
        added: number;
        deleted: number;
    };
    rank: number;
    isExported: boolean;
    isNewExport: boolean;
    signature?: string;
    provenance: 'index' | 'function-context' | 'hunk-scan' | 'base-index';
}
export declare const FileChangeSchema: z.ZodObject<{
    changeType: z.ZodEnum<{
        added: "added";
        modified: "modified";
        deleted: "deleted";
        renamed: "renamed";
        copied: "copied";
    }>;
    path: z.ZodString;
    relativePath: z.ZodString;
    oldPath: z.ZodOptional<z.ZodString>;
    churn: z.ZodObject<{
        added: z.ZodNumber;
        deleted: z.ZodNumber;
        binary: z.ZodBoolean;
    }, z.core.$strip>;
    topLevelChurn: z.ZodObject<{
        added: z.ZodNumber;
        deleted: z.ZodNumber;
    }, z.core.$strip>;
    importsChanged: z.ZodBoolean;
    symbolCount: z.ZodNumber;
    rank: z.ZodNumber;
}, z.core.$strip>;
export type FileChange = z.infer<typeof FileChangeSchema>;
export declare const CodeDiffResultSchema: z.ZodObject<{
    range: z.ZodObject<{
        base: z.ZodOptional<z.ZodString>;
        head: z.ZodOptional<z.ZodString>;
        kind: z.ZodEnum<{
            "three-dot": "three-dot";
            "two-dot": "two-dot";
            "working-tree": "working-tree";
            staged: "staged";
            commit: "commit";
        }>;
        mergeBase: z.ZodOptional<z.ZodString>;
        resolvedBase: z.ZodOptional<z.ZodString>;
        resolvedHead: z.ZodOptional<z.ZodString>;
        describe: z.ZodString;
    }, z.core.$strip>;
    repoRoot: z.ZodString;
    files: z.ZodArray<z.ZodObject<{
        changeType: z.ZodEnum<{
            added: "added";
            modified: "modified";
            deleted: "deleted";
            renamed: "renamed";
            copied: "copied";
        }>;
        path: z.ZodString;
        relativePath: z.ZodString;
        oldPath: z.ZodOptional<z.ZodString>;
        churn: z.ZodObject<{
            added: z.ZodNumber;
            deleted: z.ZodNumber;
            binary: z.ZodBoolean;
        }, z.core.$strip>;
        topLevelChurn: z.ZodObject<{
            added: z.ZodNumber;
            deleted: z.ZodNumber;
        }, z.core.$strip>;
        importsChanged: z.ZodBoolean;
        symbolCount: z.ZodNumber;
        rank: z.ZodNumber;
    }, z.core.$strip>>;
    symbols: z.ZodArray<z.ZodObject<{
        nodeId: z.ZodOptional<z.ZodString>;
        kind: z.ZodEnum<{
            function: "function";
            file: "file";
            enum: "enum";
            type: "type";
            module: "module";
            class: "class";
            interface: "interface";
            variable: "variable";
            parameter: "parameter";
            method: "method";
            other: "other";
        }>;
        name: z.ZodString;
        containerName: z.ZodOptional<z.ZodString>;
        file: z.ZodString;
        relativePath: z.ZodString;
        line: z.ZodOptional<z.ZodNumber>;
        endLine: z.ZodOptional<z.ZodNumber>;
        endLineApprox: z.ZodOptional<z.ZodBoolean>;
        changeKind: z.ZodEnum<{
            signature: "signature";
            added: "added";
            modified: "modified";
            removed: "removed";
        }>;
        churn: z.ZodObject<{
            added: z.ZodNumber;
            deleted: z.ZodNumber;
        }, z.core.$strip>;
        rank: z.ZodNumber;
        isExported: z.ZodBoolean;
        isNewExport: z.ZodBoolean;
        signature: z.ZodOptional<z.ZodString>;
        provenance: z.ZodEnum<{
            index: "index";
            "function-context": "function-context";
            "hunk-scan": "hunk-scan";
            "base-index": "base-index";
        }>;
    }, z.core.$strip>>;
    summary: z.ZodObject<{
        filesChanged: z.ZodNumber;
        symbolsChanged: z.ZodNumber;
        added: z.ZodNumber;
        removed: z.ZodNumber;
        modified: z.ZodNumber;
        signatureChanges: z.ZodNumber;
        newExports: z.ZodNumber;
        removedExports: z.ZodNumber;
        totalChurn: z.ZodObject<{
            added: z.ZodNumber;
            deleted: z.ZodNumber;
        }, z.core.$strip>;
        droppedSymbols: z.ZodNumber;
        approxEndLines: z.ZodNumber;
    }, z.core.$strip>;
    tokenizer: z.ZodOptional<z.ZodString>;
    tokenBudget: z.ZodOptional<z.ZodNumber>;
    tokensUsed: z.ZodNumber;
    truncated: z.ZodBoolean;
    unmappedHunks: z.ZodNumber;
    capabilities: z.ZodRecord<z.ZodString, z.ZodObject<{
        definitions: z.ZodBoolean;
        imports: z.ZodBoolean;
        calls: z.ZodBoolean;
        inheritance: z.ZodBoolean;
        content: z.ZodBoolean;
    }, z.core.$strip>>;
}, z.core.$strip>;
export interface CodeDiffResult {
    range: GitRange;
    repoRoot: string;
    files: FileChange[];
    symbols: ChangedSymbol[];
    summary: {
        filesChanged: number;
        symbolsChanged: number;
        added: number;
        removed: number;
        modified: number;
        signatureChanges: number;
        newExports: number;
        removedExports: number;
        totalChurn: {
            added: number;
            deleted: number;
        };
        droppedSymbols: number;
        approxEndLines: number;
    };
    tokenizer?: string;
    tokenBudget?: number;
    tokensUsed: number;
    truncated: boolean;
    unmappedHunks: number;
    capabilities: Record<string, CodeCapabilities>;
}
export declare const CodeDiffOptionsSchema: z.ZodObject<{
    base: z.ZodOptional<z.ZodString>;
    head: z.ZodOptional<z.ZodString>;
    staged: z.ZodOptional<z.ZodBoolean>;
    paths: z.ZodOptional<z.ZodArray<z.ZodString>>;
    excludePaths: z.ZodOptional<z.ZodArray<z.ZodString>>;
    mapTokens: z.ZodOptional<z.ZodNumber>;
    tokenizer: z.ZodOptional<z.ZodString>;
    rank: z.ZodOptional<z.ZodObject<{
        damping: z.ZodOptional<z.ZodNumber>;
        maxIterations: z.ZodOptional<z.ZodNumber>;
        epsilon: z.ZodOptional<z.ZodNumber>;
        edgeWeights: z.ZodOptional<z.ZodObject<{
            imports: z.ZodOptional<z.ZodNumber>;
            calls: z.ZodOptional<z.ZodNumber>;
            inherits: z.ZodOptional<z.ZodNumber>;
        }, z.core.$strip>>;
        biasExports: z.ZodOptional<z.ZodBoolean>;
        includeExternal: z.ZodOptional<z.ZodBoolean>;
    }, z.core.$strip>>;
}, z.core.$strip>;
type CodeDiffSerializableOptions = z.infer<typeof CodeDiffOptionsSchema>;
export interface CodeDiffOptions extends CodeDiffSerializableOptions {
    signal?: AbortSignal;
    countTokens?: (text: string) => number;
}
export declare function codeDiffSymbolLine(symbol: ChangedSymbol): string;
export declare function joinHunksToSymbols(_index: CodebaseIndex, _hunks: GitDiffHunks, _rank: RankResult): ChangedSymbol[];
/**
 * Join hunks to symbols and, alongside the changed symbols, report how many
 * hunks matched no indexed symbol interval. A hunk can overlap several
 * intervals, so this cannot be derived from the symbol count — it is counted
 * directly here where each hunk's interval matches are known.
 */
export declare function joinHunksToSymbolsWithStats(_index: CodebaseIndex, _hunks: GitDiffHunks, _rank: RankResult): {
    symbols: ChangedSymbol[];
    unmappedHunks: number;
};
export declare function computeCodeDiff(_index: CodebaseIndex, _options: CodeDiffOptions): Promise<CodeDiffResult>;
export {};
