/** * Tree-sitter AST parsing for accurate code analysis. * Uses web-tree-sitter (WASM-based, no native compilation). * Falls back to regex-based parsing if grammars unavailable. * * Supported languages: TypeScript, JavaScript, Python, Go, Java, Rust, C/C++ */ export interface ASTSymbol { name: string; type: 'function' | 'class' | 'method' | 'interface' | 'enum' | 'variable' | 'type' | 'module' | 'struct' | 'trait'; startLine: number; endLine: number; exported: boolean; params?: string[]; returnType?: string; docComment?: string; /** Methods inside classes, etc. */ children?: ASTSymbol[]; } export interface CallGraphEntry { caller: string; callee: string; file: string; line: number; } export interface ScopeInfo { name: string; type: string; startLine: number; endLine: number; variables: string[]; children: ScopeInfo[]; } /** * Initialize tree-sitter. Call once at startup. * @returns True if initialization succeeded */ export declare function initTreeSitter(): Promise; /** * Check if tree-sitter is available and ready. * @returns True if tree-sitter has been initialized */ export declare function isTreeSitterReady(): boolean; /** * Get supported languages for tree-sitter. * @returns Array of supported language names */ export declare function getTreeSitterLanguages(): string[]; /** * Parse a file into an AST and extract symbols. * Falls back to null if tree-sitter isn't available for this language. * @param filePath - Path to the source file * @param language - The programming language * @returns Array of AST symbols or null if parsing unavailable */ export declare function parseAST(filePath: string, language: string): Promise; /** * Extract call graph from a file -- which functions call which. * @param filePath - Path to the source file * @param language - The programming language * @returns Array of call graph entries or null if parsing unavailable */ export declare function extractCallGraph(filePath: string, language: string): Promise; /** * Extract scope information from a file. * @param filePath - Path to the source file * @param language - The programming language * @returns Array of scope information or null if parsing unavailable */ export declare function extractScopes(filePath: string, language: string): Promise; //# sourceMappingURL=tree-sitter.d.ts.map