import { CFG_RULES } from '../ast-analysis/rules/index.js';
import { makeCfgRules as _makeCfgRules } from '../ast-analysis/shared.js';
import type { BetterSqlite3Database, Definition, TreeSitterNode } from '../types.js';
export { _makeCfgRules as makeCfgRules, CFG_RULES };
interface CfgBuildBlock {
    index: number;
    type: string;
    startLine: number;
    endLine: number;
    label: string;
}
interface CfgBuildEdge {
    sourceIndex: number;
    targetIndex: number;
    kind: string;
}
interface CfgBuildResult {
    blocks: CfgBuildBlock[];
    edges: CfgBuildEdge[];
    cyclomatic: number;
}
export declare function buildFunctionCFG(functionNode: TreeSitterNode, langId: string): CfgBuildResult;
interface FileSymbols {
    definitions: Definition[];
    _tree?: {
        rootNode: TreeSitterNode;
    };
    _langId?: string;
}
export declare function buildCFGData(db: BetterSqlite3Database, fileSymbols: Map<string, FileSymbols>, rootDir: string, engineOpts?: {
    nativeDb?: {
        bulkInsertCfg?(entries: Array<Record<string, unknown>>): number;
    };
    suspendJsDb?: () => void;
    resumeJsDb?: () => void;
}): Promise<void>;
interface CfgQueryBlock {
    index: number;
    type: string;
    startLine: number;
    endLine: number;
    label: string | null;
}
interface CfgQueryEdge {
    source: number;
    sourceType: string;
    target: number;
    targetType: string;
    kind: string;
}
interface CfgQueryFunctionResult {
    name: string;
    kind: string;
    file: string;
    line: number;
    blocks: CfgQueryBlock[];
    edges: CfgQueryEdge[];
    summary: {
        blockCount: number;
        edgeCount: number;
    };
}
interface CfgDataResult {
    name: string;
    results: CfgQueryFunctionResult[];
    warning?: string;
    _pagination?: unknown;
}
interface CfgOpts {
    noTests?: boolean;
    file?: string | string[];
    kind?: string;
    limit?: number;
    offset?: number;
}
export declare function cfgData(name: string, customDbPath: string | undefined, opts?: CfgOpts): CfgDataResult;
export declare function cfgToDOT(cfgResult: CfgDataResult): string;
export declare function cfgToMermaid(cfgResult: CfgDataResult): string;
//# sourceMappingURL=cfg.d.ts.map