/** * Tree-sitter TypeScript/JavaScript adapter implementing the LanguageAdapter interface. * * Uses web-tree-sitter WASM parsers behind the adapter seam — no TypeScript compiler API. * Supports .ts, .tsx, .js, and .jsx files. */ import type { AST, ASTNode, ClassInfo, ExportInfo, FunctionInfo, ImportInfo, InterfaceInfo, LanguageAdapter, NodePattern, SourceLocation } from '../types.js'; export declare class TreeSitterTypeScriptAdapter implements LanguageAdapter { readonly name = "typescript"; readonly fileExtensions: string[]; supportsFile(filePath: string): boolean; parse(filePath: string, content: string): Promise; findNodes(ast: AST, pattern: NodePattern): ASTNode[]; getParent(node: ASTNode): ASTNode | null; getChildren(node: ASTNode): ASTNode[]; getSiblings(node: ASTNode): ASTNode[]; getNodeType(node: ASTNode): string; getNodeText(node: ASTNode, sourceCode: string): string; getNodeName(node: ASTNode): string | null; getNodeLocation(node: ASTNode): SourceLocation; extractFunctions(ast: AST): FunctionInfo[]; extractClasses(ast: AST): ClassInfo[]; extractImports(ast: AST): ImportInfo[]; extractExports(ast: AST): ExportInfo[]; isClass(node: ASTNode): boolean; isFunction(node: ASTNode): boolean; isMethod(node: ASTNode): boolean; isInterface(node: ASTNode): boolean; isImport(node: ASTNode): boolean; isExport(node: ASTNode): boolean; isLoop(node: ASTNode): boolean; isConditional(node: ASTNode): boolean; isVariableDeclaration(node: ASTNode): boolean; getTypeInfo(node: ASTNode): string | null; getDocumentation(node: ASTNode): string | null; getComplexity(node: ASTNode): number; extractInterfaces(ast: AST): InterfaceInfo[]; extractRawImports(_filePath: string, content: string): Array<{ moduleSpecifier: string; isStatic: boolean; isDynamic: boolean; isRequire: boolean; line: number; }>; extractExportedSymbols(ast: AST): Array<{ name: string; line: number; }>; /** Walk all ASTNodes in a tree (depth-first). */ private walk; /** Walk all TreeSitterNodes in a tree (depth-first). */ private walkRaw; /** Collect ERROR nodes from tree-sitter's error recovery. */ private collectErrors; /** Match an ASTNode against a NodePattern. */ private matchesPattern; /** Extract the name/identifier from a tree-sitter TreeSitterNode. */ private extractName; /** Extract a type annotation string from a node. */ private extractTypeAnnotation; /** Extract JSDoc or leading comment from a node. */ private extractDocumentation; /** Strip comment syntax markers. */ private cleanCommentText; /** * Cyclomatic complexity: count decision points + 1. * Decision points: if, for, while, do, switch_case, ternary, &&, ||. */ private calculateCyclomaticComplexity; /** Get the operator text from a binary expression node. */ private getOperator; private buildFunctionInfo; private buildClassInfo; private buildPropertyInfo; private buildImportInfo; private buildExportInfo; private buildInterfaceInfo; private extractParameters; /** Check if a node has an `async` modifier keyword. */ private hasModifier; /** Check if a node is under an export_statement. */ private isNodeExported; /** Get the enclosing class name for a method. */ private getEnclosingClassName; /** Find first child of node matching one of the given types. */ private getChildByType; /** Find the first named child matching one of the given types. */ private findFirstNamedChild; /** Check if node has a direct child (named or anonymous) with the given text. */ private hasChild; } //# sourceMappingURL=TreeSitterTypeScriptAdapter.d.ts.map