/**
 * KiroGraph Database Layer
 * Wraps node-sqlite3-wasm for portability (no native bindings needed).
 */
import type { Node, Edge, FileRecord, NodeKind, GraphStats, NodeContext, NodeMetrics, SearchOptions } from '../types';
import type { ArchPackage, ArchLayer, ArchPackageDep, ArchLayerDep, ArchCoupling } from '../architecture/types';
export declare class GraphDatabase {
    private db;
    private projectRoot;
    constructor(projectRoot: string);
    private applySchema;
    private runMigrations;
    upsertFile(record: FileRecord): void;
    getFile(filePath: string): FileRecord | null;
    getAllFiles(): FileRecord[];
    deleteFile(filePath: string): void;
    private rowToFile;
    upsertNode(node: Node): void;
    getNode(id: string): Node | null;
    getNodesByFile(filePath: string): Node[];
    getNodesByKind(kind: Node['kind']): Node[];
    findNodesByExactName(name: string, kinds?: NodeKind[], limit?: number): Node[];
    searchNodes(query: string, opts?: SearchOptions): Node[];
    searchNodesByName(name: string, opts?: SearchOptions): Node[];
    deleteNodesByFile(filePath: string): void;
    private rowToNode;
    insertEdge(edge: Edge): void;
    getCallers(nodeId: string, limit?: number): Node[];
    getCallees(nodeId: string, limit?: number): Node[];
    getImpactRadius(nodeId: string, depth?: number): Node[];
    getEdgesForNodes(nodeIds: string[]): Edge[];
    /**
     * Find files that import (depend on) the given file path.
     * Used for affected-test traversal.
     */
    getDependentFiles(filePath: string): string[];
    insertUnresolvedRef(sourceId: string, refName: string, refKind: string, filePath: string, line?: number, column?: number): void;
    deleteUnresolvedRefsByFile(filePath: string): void;
    /**
     * Resolve pending references:
     * - refKind='function': 3-strategy name matching → 'calls' edge
     * - refKind='import': path-based resolution → 'imports' edge
     *
     * Returns the number of edges successfully created.
     */
    resolveUnresolvedRefs(): number;
    /** @deprecated Use resolveUnresolvedRefs() */
    resolveCallEdges(): number;
    /**
     * Resolve a module import path to the ID of the first node in the target file.
     * Returns null if no indexed file matches.
     */
    private resolveImportPath;
    getNodeContext(nodeId: string): NodeContext | null;
    getNodeMetrics(nodeId: string): NodeMetrics;
    /**
     * Find symbols with no incoming edges (potential dead code).
     * Excludes exported symbols since they may be consumed externally.
     */
    findDeadCode(limit?: number): Node[];
    /**
     * Find circular import dependencies using DFS over import edges.
     * Returns arrays of file paths forming cycles.
     */
    findCircularDependencies(): string[][];
    /**
     * Find the shortest path between two nodes via directed BFS (outgoing edges only).
     */
    findPath(fromId: string, toId: string, maxDepth?: number): Node[];
    /**
     * Traverse type hierarchy via 'extends' and 'implements' edges.
     * direction 'up' = base types, 'down' = derived types, 'both' = all.
     */
    getTypeHierarchy(nodeId: string, direction?: 'up' | 'down' | 'both'): Node[];
    getEmbeddingCount(): number;
    storeEmbedding(nodeId: string, embedding: Float32Array, model: string): void;
    getEmbeddedNodeIds(): string[];
    getAllEmbeddings(): Array<{
        nodeId: string;
        embedding: Float32Array;
    }>;
    getAllNodes(): import('../types').Node[];
    getStats(): GraphStats;
    clearArchitecture(): void;
    upsertArchPackage(pkg: ArchPackage): void;
    upsertArchLayer(layer: ArchLayer): void;
    upsertArchFilePackage(filePath: string, packageId: string): void;
    upsertArchFileLayer(filePath: string, layerId: string, confidence: number, matchedPattern: string): void;
    upsertArchPackageDep(sourcePkg: string, targetPkg: string, depCount: number, files?: Array<{
        from: string;
        to: string;
    }>): void;
    upsertArchLayerDep(sourceLayer: string, targetLayer: string, depCount: number): void;
    upsertArchCoupling(coupling: ArchCoupling): void;
    getArchPackages(): ArchPackage[];
    getArchLayers(): ArchLayer[];
    getArchPackageDeps(): ArchPackageDep[];
    getArchLayerDeps(): ArchLayerDep[];
    getArchCoupling(): ArchCoupling[];
    getArchStats(): {
        packages: number;
        layers: number;
        packageDeps: number;
    };
    /**
     * Return file-to-file import relationships by joining edges + nodes.
     * Used by ArchitectureAnalyzer to roll up package-level dependencies.
     */
    getFileImportPairs(): Array<{
        sourceFile: string;
        targetFile: string;
    }>;
    getArchFilePackages(): Array<{
        filePath: string;
        packageId: string;
    }>;
    getArchFileLayers(): Array<{
        filePath: string;
        layerId: string;
        confidence: number;
        matchedPattern: string;
    }>;
    getArchitectureResult(): {
        packages: ArchPackage[];
        layers: ArchLayer[];
        packageDeps: ArchPackageDep[];
        layerDeps: ArchLayerDep[];
        coupling: ArchCoupling[];
    };
    transaction<T>(fn: () => T): T;
    close(): void;
}
//# sourceMappingURL=database.d.ts.map