/** * Parser Factory * * Creates the appropriate parser for a given file or language. * Implements the strategy pattern for parser selection. * * Strategy: * - TypeScript/JavaScript: Use TypeScriptParser (TypeScript Compiler API) * - Python, Go, Rust, Java: Use TreeSitterParser * - Unknown: Fall back to TreeSitterParser or null */ import type { IParser, ParserLanguage } from "../../domain/ports/parser"; /** * Create a parser for the given file. * * @param filepath - The file path to get a parser for * @returns The appropriate parser, or null if no parser supports the file */ export declare function createParserForFile(filepath: string): IParser | null; /** * Create a parser for the given language. * * @param language - The language to get a parser for * @returns The appropriate parser */ export declare function createParserForLanguage(language: ParserLanguage): IParser; /** * Detect the language from a file path. * * @param filepath - The file path to detect language from * @returns The detected language, or null if unknown */ export declare function detectLanguage(filepath: string): ParserLanguage | null; /** * Detect languages from a list of file paths. * Returns unique languages found. * * @param filepaths - Array of file paths * @returns Set of detected languages */ export declare function detectLanguagesFromFiles(filepaths: string[]): Set; /** * Check if a file is supported by any parser. * * @param filepath - The file path to check * @returns True if a parser can handle this file */ export declare function isFileSupported(filepath: string): boolean; /** * Get all supported file extensions. */ export declare function getSupportedExtensions(): string[]; /** * Get all supported languages. */ export declare function getSupportedLanguages(): ParserLanguage[];