/**
 * Importance ranking over the code graph.
 *
 * Runs a weighted PageRank on the `imports`/`calls`/`inherits`/`implements`
 * edges so that symbols and files which many *important* others depend on
 * float to the top. This is the signal `buildRepoMap` uses to decide what to
 * keep within a token budget (cf. Aider's tree-sitter repo map).
 *
 * Pure and dependency-free (types + zod only) so it stays trivially testable
 * and obeys the module DAG — it performs no I/O and does not count tokens.
 */
import { z } from 'zod';
import type { CodebaseIndex } from './types.js';
export declare const RankEdgeWeightsSchema: z.ZodObject<{
    imports: z.ZodOptional<z.ZodNumber>;
    calls: z.ZodOptional<z.ZodNumber>;
    inherits: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>;
export type RankEdgeWeights = z.infer<typeof RankEdgeWeightsSchema>;
export declare const RankOptionsSchema: 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>;
export type RankOptions = z.infer<typeof RankOptionsSchema>;
export declare const RankedNodeSchema: z.ZodObject<{
    nodeId: z.ZodString;
    score: z.ZodNumber;
    normalizedScore: z.ZodNumber;
    type: z.ZodString;
    name: z.ZodString;
    path: z.ZodString;
    relativePath: z.ZodOptional<z.ZodString>;
    line: z.ZodOptional<z.ZodNumber>;
    containerName: z.ZodOptional<z.ZodString>;
    isExported: z.ZodBoolean;
}, z.core.$strip>;
export type RankedNode = z.infer<typeof RankedNodeSchema>;
export declare const RankedFileSchema: z.ZodObject<{
    path: z.ZodString;
    relativePath: z.ZodString;
    score: z.ZodNumber;
    normalizedScore: z.ZodNumber;
}, z.core.$strip>;
export type RankedFile = z.infer<typeof RankedFileSchema>;
export declare const RankResultSchema: z.ZodObject<{
    nodes: z.ZodArray<z.ZodObject<{
        nodeId: z.ZodString;
        score: z.ZodNumber;
        normalizedScore: z.ZodNumber;
        type: z.ZodString;
        name: z.ZodString;
        path: z.ZodString;
        relativePath: z.ZodOptional<z.ZodString>;
        line: z.ZodOptional<z.ZodNumber>;
        containerName: z.ZodOptional<z.ZodString>;
        isExported: z.ZodBoolean;
    }, z.core.$strip>>;
    fileScores: z.ZodArray<z.ZodObject<{
        path: z.ZodString;
        relativePath: z.ZodString;
        score: z.ZodNumber;
        normalizedScore: z.ZodNumber;
    }, z.core.$strip>>;
    iterations: z.ZodNumber;
    converged: z.ZodBoolean;
}, z.core.$strip>;
export type RankResult = z.infer<typeof RankResultSchema>;
/**
 * Weighted PageRank over the dependency/call graph.
 *
 * Edge direction matches storage (`from` depends on `to`), so rank flows from a
 * dependent toward the thing it depends on — heavily-relied-upon nodes
 * accumulate importance. `ambiguous`/`unresolved` edges (no concrete `to`) are
 * skipped because their importance cannot be attributed.
 */
export declare function rankNodes(index: CodebaseIndex, options?: RankOptions): RankResult;
/**
 * Memoized `rankNodes`. Repeated rankings of the same index object (e.g.
 * per-focused-map calls) skip PageRank entirely; up to
 * `RANK_CACHE_MAX_VARIANTS` option variants are retained per index, evicting
 * the oldest. The returned `RankResult` is shared between callers — treat it
 * as immutable. `rankNodes` itself stays pure and uncached.
 *
 * The index should be treated as immutable after construction. The cache key
 * carries only a `files`/`nodes`/`edges` length fingerprint, so in-place
 * mutations that change those lengths recompute, but mutations that keep them
 * constant (e.g. rewriting a node's name in place) are NOT detected and will
 * return a stale ranking.
 */
export declare function rankNodesCached(index: CodebaseIndex, options?: RankOptions): RankResult;
export declare function topRankedFiles(result: RankResult, limit: number): RankedFile[];
export declare function topRankedSymbols(result: RankResult, limit: number): RankedNode[];
