import type { TreeSitterNode } from '../../types.js';
export type AnyRules = any;
/** Callback type for the mutual recursion with processStatements in cfg-visitor. */
export type ProcessStatementsFn = (stmts: TreeSitterNode[], currentBlock: CfgBlockInternal, S: FuncState, cfgRules: AnyRules) => CfgBlockInternal | null;
export declare function nn(node: TreeSitterNode | null, context?: string): TreeSitterNode;
export interface CfgBlockInternal {
    index: number;
    type: string;
    startLine: number | null;
    endLine: number | null;
    label: string | null;
}
export interface CfgEdgeInternal {
    sourceIndex: number;
    targetIndex: number;
    kind: string;
}
export interface LabelCtx {
    headerBlock: CfgBlockInternal | null;
    exitBlock: CfgBlockInternal | null;
}
export interface LoopCtx {
    headerBlock: CfgBlockInternal;
    exitBlock: CfgBlockInternal;
}
export interface FuncState {
    blocks: CfgBlockInternal[];
    edges: CfgEdgeInternal[];
    makeBlock(type: string, startLine?: number | null, endLine?: number | null, label?: string | null): CfgBlockInternal;
    addEdge(source: CfgBlockInternal, target: CfgBlockInternal, kind: string): void;
    entryBlock: CfgBlockInternal;
    exitBlock: CfgBlockInternal;
    currentBlock: CfgBlockInternal | null;
    loopStack: LoopCtx[];
    labelMap: Map<string, LabelCtx>;
    cfgStack: FuncState[];
    funcNode: TreeSitterNode | null;
}
export interface CFGResultInternal {
    funcNode: TreeSitterNode;
    blocks: CfgBlockInternal[];
    edges: CfgEdgeInternal[];
    cyclomatic: number;
}
export declare function isIfNode(type: string, cfgRules: AnyRules): boolean;
export declare function isForNode(type: string, cfgRules: AnyRules): boolean;
export declare function isWhileNode(type: string, cfgRules: AnyRules): boolean;
export declare function isSwitchNode(type: string, cfgRules: AnyRules): boolean;
export declare function isCaseNode(type: string, cfgRules: AnyRules): boolean;
export declare function isBlockNode(type: string, cfgRules: AnyRules): boolean;
export declare function isControlFlow(type: string, cfgRules: AnyRules): boolean;
export declare function effectiveNode(node: TreeSitterNode, cfgRules: AnyRules): TreeSitterNode;
export declare function registerLabelCtx(S: FuncState, headerBlock: CfgBlockInternal, exitBlock: CfgBlockInternal): void;
export declare function getBodyStatements(bodyNode: TreeSitterNode | null, cfgRules: AnyRules): TreeSitterNode[];
export declare function makeFuncState(): FuncState;
//# sourceMappingURL=cfg-shared.d.ts.map