import { StoreBackend } from './store-interface.js';
import { MapxGraph } from './graph.js';
import '../types.js';

declare class Store {
    private backend;
    constructor(dbPath: string);
    private runMigrations;
    private getSchemaVersion;
    private columnExists;
    get raw(): StoreBackend;
    setMeta(key: string, value: string): void;
    getMeta(key: string): string | null;
    upsertFile(file: {
        path: string;
        repo: string;
        language: string;
        gitBlobHash: string | null;
        contentHash: string | null;
        lastScanned: string;
        sizeBytes: number;
        lines: number;
        metadata?: Record<string, any>;
        namespace?: string | null;
    }): void;
    updateFileMetadata(filePath: string, metadata: Record<string, any>): void;
    deleteFile(filePath: string): void;
    getFile(filePath: string): Record<string, unknown> | undefined;
    getAllFiles(repo?: string): Record<string, unknown>[];
    insertSymbol(sym: {
        filePath: string;
        repo: string;
        name: string;
        kind: string;
        scope: string | null;
        signature: string;
        startLine: number;
        endLine: number;
        metadata: string;
    }): void;
    deleteSymbolsForFile(filePath: string): void;
    searchSymbols(namePattern: string, repo?: string): Record<string, unknown>[];
    getSymbolsForFile(filePath: string): Record<string, unknown>[];
    getAllSymbols(repo?: string): Record<string, unknown>[];
    insertEdge(edge: {
        sourceFile: string;
        targetFile: string;
        sourceSymbol: string | null;
        targetSymbol: string | null;
        edgeType: string;
        repo: string;
        weight: number;
        verifiability?: 'verified' | 'inferred';
        metadata?: Record<string, any>;
        targetRepo?: string | null;
    }): void;
    deleteEdgesForFile(filePath: string): void;
    deleteFrameworkEdgesForRepo(repoName: string): void;
    getEdgesForFile(filePath: string): Record<string, unknown>[];
    getReverseEdges(filePath: string): Record<string, unknown>[];
    getAllEdges(repo?: string): Record<string, unknown>[];
    queryEdges(options: {
        type?: string;
        from?: string;
        to?: string;
        repo?: string;
    }): Record<string, unknown>[];
    getFileCount(repo?: string): number;
    getSymbolCount(repo?: string): number;
    getEdgeCount(repo?: string): number;
    getLanguageBreakdown(repo?: string): Record<string, number>;
    upsertSnapshot(snap: {
        commitSha: string;
        parentSha: string | null;
        timestamp: string;
        filesAdded: string;
        filesModified: string;
        filesRemoved: string;
        symbolsDelta: string;
    }): void;
    getLatestSnapshot(): Record<string, unknown> | undefined;
    clearClusters(repo: string): void;
    insertCluster(cluster: {
        repo: string;
        name: string;
        label: string;
        source: string;
        parentName: string | null;
        depth: number;
        fileCount: number;
        layer?: string;
    }): void;
    insertClusterMembership(membership: {
        filePath: string;
        clusterName: string;
        repo: string;
        isPrimary: number;
    }): void;
    getClusters(repo?: string): Record<string, unknown>[];
    getClusterMemberships(repo?: string): Record<string, unknown>[];
    getClusterFiles(clusterName: string, repo: string): string[];
    getClusterEdges(clusterName: string, repo: string): {
        sourceCluster: string;
        targetCluster: string;
        edgeCount: number;
        dominantType: string;
    }[];
    /**
     * Wipe all data owned by a repo in preparation for a fresh forced re-scan.
     * Unlike deleteRepo(), this intentionally preserves:
     *   - Cross-repo edges where this repo is only the TARGET (those belong to
     *     other repos' scans and will be cleaned up when those repos are re-scanned).
     *   - last_scan_commit / last_scan_time meta keys (updated once scan completes).
     */
    resetRepoForScan(repoName: string): void;
    deleteRepo(repoName: string): void;
    searchSymbolsFiltered(options: {
        term: string;
        kind?: string;
        filePrefix?: string;
        exact?: boolean;
        limit?: number;
        offset?: number;
        repo?: string;
    }): Record<string, any>[];
    countSymbolsFiltered(options: {
        term: string;
        kind?: string;
        filePrefix?: string;
        exact?: boolean;
        repo?: string;
    }): number;
    /**
     * Return all distinct symbol names in the index.
     * Used by the fuzzy matcher to generate suggestions when a search fails.
     */
    getAllSymbolNames(repo?: string): string[];
    /**
     * Return all symbol kinds and their counts.
     * Used to provide helpful error messages when a kind filter yields no results.
     */
    listSymbolKinds(repo?: string): {
        kind: string;
        count: number;
    }[];
    /**
     * Return a lightweight candidates list for fuzzy matching.
     * Only fetches name, kind, file_path — no full row scan.
     */
    getSymbolCandidatesForFuzzy(repo?: string): Array<{
        name: string;
        kind: string;
        file_path: string;
    }>;
    getSymbolByName(fullName: string, repo?: string): Record<string, any> | undefined;
    getFilesFiltered(options: {
        pathPrefix?: string;
        lang?: string;
        sort?: 'lines' | 'path';
        limit?: number;
        repo?: string;
    }): Record<string, any>[];
    getCallersOfSymbol(fullName: string, repo?: string): Record<string, any>[];
    getCalleesOfSymbol(fullName: string, repo?: string): Record<string, any>[];
    getTopFilesByPageRank(graph: MapxGraph, limit?: number): any[];
    getTopSymbolsByPageRank(graph: MapxGraph, limit?: number): any[];
    updateFileRole(filePath: string, role: string, confidence: number): void;
    insertClassificationSignal(signal: {
        filePath: string;
        repo: string;
        source: string;
        role: string;
        confidence: number;
        reason: string;
    }): void;
    getClassificationSignals(filePath: string): Record<string, any>[];
    deleteClassificationSignalsForFile(filePath: string): void;
    insertClusterMetrics(m: {
        clusterName: string;
        repo: string;
        fileCount: number;
        afferentCoupling: number;
        efferentCoupling: number;
        instability: number;
        internalEdges: number;
        externalEdges: number;
        cohesionRatio: number;
        abstractness: number;
        distanceFromMainSeq: number;
    }): void;
    getClusterMetrics(repo: string): Record<string, any>[];
    insertArchSmell(smell: {
        repo: string;
        type: string;
        severity: string;
        description: string;
        involvedFiles: string[];
        involvedClusters?: string[];
        suggestion: string;
    }): void;
    getArchSmells(repo: string): Record<string, any>[];
    inTransaction<T>(fn: () => T): T;
    close(): void;
}

export { Store };
