/** * AST Query Engine * * Pattern-based AST matching using ts-morph for TypeScript/JavaScript. * Supports parameterized patterns with capture groups. * * @module scanners/detection/engines/ast-query */ import { Node } from "ts-morph"; import type { ASTQueryConfig, DetectionMatch, DetectionRule } from "../types.js"; export interface ASTMatch { node: Node; file: string; line: number; column: number; endLine: number; endColumn: number; text: string; captures: Record; } export interface PatternPart { type: "literal" | "capture" | "wildcard"; value: string; name?: string; } export declare function parsePattern(pattern: string): PatternPart[]; export declare function matchPattern(text: string, parts: PatternPart[]): { matched: boolean; captures: Record; }; export declare function queryAST(filePath: string, config: ASTQueryConfig): Promise; export declare function runASTQueryEngine(projectPath: string, rules: DetectionRule[], files?: string[]): Promise; //# sourceMappingURL=ast-query.d.ts.map