/** * Convert tree-sitter TreeSitterNode → ASTNode * * Maps tree-sitter's S-expression node types (e.g. "function_declaration") to * the language-agnostic ASTNode format used by the LanguageAdapter interface. */ import type { Node as TreeSitterNode } from 'web-tree-sitter'; import type { ASTNode, SourceLocation } from '../types.js'; /** * Convert a tree-sitter TreeSitterNode to an ASTNode. * The raw TreeSitterNode reference is preserved so adapters can access * tree-sitter-specific properties when needed. */ export declare function toASTNode(node: TreeSitterNode, parent?: ASTNode, language?: string): ASTNode; /** * Convert tree-sitter node position to 1-based SourceLocation. * * INVARIANT: All positions returned by this function are 1-based (line and column). * Tree-sitter uses 0-based positions internally; the conversion happens once here. * Callers MUST NOT add their own +1 compensations — doing so produces 2-based values. * * This is the single conversion point for the adapter boundary. All downstream * consumers (violation display, DB index, churn mapping, SARIF export, hook * contract validation) receive 1-based positions from this function. */ export declare function toSourceLocation(node: TreeSitterNode): SourceLocation; /** * Check if a S-expression type string represents a function-like node. */ export declare function isFunctionType(type: string): boolean; /** * Check if a S-expression type string represents a class-like node. */ export declare function isClassType(type: string): boolean; /** * Check if a S-expression type string represents an import statement. */ export declare function isImportType(type: string): boolean; /** * Check if a S-expression type string represents an export statement. */ export declare function isExportType(type: string): boolean; /** * Check if a S-expression type string represents a loop node. */ export declare function isLoopType(type: string): boolean; /** * Check if a S-expression type string represents a conditional. */ export declare function isConditionalType(type: string): boolean; //# sourceMappingURL=converter.d.ts.map