/** * TypeScript/JavaScript Code Parser * * Uses the TypeScript Compiler API for accurate AST-based parsing. * Extracts semantic chunks: functions, classes, interfaces, types, enums. * * This parser is specifically for TypeScript/JavaScript files. * For other file types, use the generic chunking in domain/services/chunking. */ import type { ChunkType } from "../../../domain/entities"; /** * Represents a parsed chunk of code with location information */ export interface ParsedChunk { /** The source code content */ content: string; /** 1-based start line number */ startLine: number; /** 1-based end line number */ endLine: number; /** The type of code construct */ type: ChunkType; /** Name of the construct (function name, class name, etc.) */ name?: string; /** Whether this is exported */ isExported?: boolean; /** JSDoc comment if present */ jsDoc?: string; } /** * Parse TypeScript/JavaScript code into semantic chunks. * * Uses the TypeScript Compiler API for accurate AST-based parsing. * Returns chunks for functions, classes, interfaces, types, enums, and exported variables. * * @param content - The source code content * @param filepath - The file path (used for JSX detection) * @returns Array of parsed chunks */ export declare function parseTypeScriptCode(content: string, filepath: string): ParsedChunk[]; /** * Generate a unique chunk ID from filepath and line numbers * @param filepath - The source file path * @param startLine - Start line number * @param endLine - End line number * @returns Unique chunk identifier */ export declare function generateChunkId(filepath: string, startLine: number, endLine: number): string;