/** * AST Parser Utilities * Provides tree-sitter-based AST parsing and analysis utilities * * Core functionality for parsing TypeScript/JavaScript/Go files and * extracting information for code analysis. * * This module replaces the old TypeScript compiler API with tree-sitter * via the adapter bridge. Consumers receive AST/ASTNode instead of * ts.SourceFile/ts.Node. */ import { getNodeName } from '../languages/adapterBridge.js'; import type { AST, ASTNode } from '../languages/types.js'; export { getNodeText, getLineAndColumn, hasModifier, calculateComplexity } from '../languages/adapterBridge.js'; export interface ParseResult { ast: AST; errors: Array<{ message: string; line?: number; column?: number; }>; } export interface ImportInfo { moduleSpecifier: string; importedNames: string[]; isDefaultImport: boolean; isNamespaceImport: boolean; line: number; } export interface ExportInfo { name: string; type: 'function' | 'class' | 'interface' | 'type' | 'const' | 'let' | 'var' | 'enum'; isDefault: boolean; line: number; } /** * Parse a TypeScript/JavaScript/Go file and return AST. */ export declare function parseTypeScriptFile(filePath: string): Promise; /** * Extract import statements from an AST. */ export declare function getImports(ast: AST): ImportInfo[]; /** * Extract export statements from an AST. */ export declare function getExports(ast: AST): ExportInfo[]; /** * Find all ASTNode matching a type string (replaces ts.SyntaxKind enum). */ export declare function findNodesByType(ast: ASTNode, type: string): ASTNode[]; /** * Kept for backward compatibility — returns ASTNode[] where each node's type * matches one of the provided type strings. */ export declare function findNodesByKind(ast: ASTNode, kind: string): ASTNode[]; export { isExported } from '../languages/adapterBridge.js'; export { getNodeName }; /** * Store source content for an AST so getNodeText() can work without passing * sourceCode each time. */ export declare function setSourceContent(ast: AST, content: string): void; //# sourceMappingURL=astParser.d.ts.map