import type { DatabaseSync } from 'node:sqlite'; import type { CallSite, CodeMapGraph, Ref } from './schema.js'; import { type WriterSymbolGraphRow } from './writer-graph-helpers.js'; type Statement = ReturnType; type PrepareStatement = (sql: string) => Statement; /** * Hydrate symbol rows for an arbitrary id list. * * The personalised retrieval walk scores dense graph indices and then needs * the declarations behind the winners; this is that lookup. Chunked because * the id list is unbounded — the caller decides how many nodes to hydrate. */ export declare function getSymbolsByIdsWithStatement(stmt: PrepareStatement, ids: readonly number[]): WriterSymbolGraphRow[]; /** * Declarations in one file, in source order. * * Ordered by line rather than by any score so the list reads the way the file * does — the atlas uses it to describe a file, not to rank within it. */ export declare function getFileSymbolsWithStatement(stmt: PrepareStatement, file: string, limit: number): Array<{ id: number; name: string; kind: string; line: number; signature: string; }>; /** * Find all symbols that CALL/USE the named target symbol (incoming callers). * * Returns one `CallSite` per ref edge, with the caller's full metadata so the * agent sees file, line, kind, and signature without a second lookup. */ export declare function findIncomingCallsByName(stmt: PrepareStatement, symbolName: string, file: string | undefined, limit: number): { calls: CallSite[]; symbolFound: boolean; ambiguous: boolean; totalMatches: number; }; /** * Find all symbols that the named source symbol CALLS/USES (outgoing callees). * * Returns one `CallSite` per ref edge, with the callee's full metadata. */ export declare function findOutgoingCallsByName(stmt: PrepareStatement, symbolName: string, file: string | undefined, limit: number): { calls: CallSite[]; symbolFound: boolean; unresolvedCount: number; totalMatches: number; }; /** * Transitive incoming-call tree: all symbols that transitively call the target. * * Anchor: direct callers of the target symbol(s). * Recursive: callers of callers, up to `maxDepth` hops. * * `UNION` (not `UNION ALL`) deduplicates per recursion level, so dependency * cycles (A→B→C→A) terminate instead of looping. */ export declare function findTransitiveIncomingCallsByName(stmt: PrepareStatement, symbolName: string, file: string | undefined, limit: number): { calls: CallSite[]; symbolFound: boolean; ambiguous: boolean; totalMatches: number; }; /** * Transitive outgoing-call tree: all symbols that the target transitively calls. * * Anchor: direct callees of the target symbol(s). * Recursive: callees of callees, up to `maxDepth` hops. */ export declare function findTransitiveOutgoingCallsByName(stmt: PrepareStatement, symbolName: string, file: string | undefined, limit: number): { calls: CallSite[]; symbolFound: boolean; unresolvedCount: number; totalMatches: number; }; /** * Compute the set of symbol IDs reachable from a set of seed IDs using a * recursive CTE. Replaces the in-memory BFS in `dead-code-scan.ts`. * * The `UNION` (not `UNION ALL`) deduplication breaks dependency cycles * automatically: A→B→C→A terminates after 3 rows. * * Returns a `Set` of all transitively-reachable symbol IDs (including * the seeds themselves). Callers subtract this from the full symbol set to * find dead code. */ export declare function findReachableSymbolIds(stmt: PrepareStatement, seedIds: number[]): Set; export declare function findRefsToWithStatement(stmt: PrepareStatement, symbolId: number): Ref[]; export declare function findRefsFromWithStatement(stmt: PrepareStatement, symbolId: number): Ref[]; export declare function getPackageGraphWithStatement(stmt: PrepareStatement): CodeMapGraph; export declare function getFileGraphWithStatement(stmt: PrepareStatement, packageFilter: string): CodeMapGraph; export declare function getSymbolGraphWithStatement(stmt: PrepareStatement, fileFilter: string): CodeMapGraph; export {}; //# sourceMappingURL=writer-graph-reader.d.ts.map