UNPKG

woaru

Version:

Universal Project Setup Autopilot - Analyze and automatically configure development tools for ANY programming language

79 lines 3.17 kB
/** * Language information structure for comprehensive programming language support * * Contains all necessary metadata for detecting and working with different * programming languages including file extensions, configuration files, * package managers, build systems, and popular frameworks. */ export interface LanguageInfo { /** Human-readable language name */ name: string; /** File extensions associated with this language */ extensions: string[]; /** Configuration files that indicate this language */ configFiles: string[]; /** Package managers used by this language */ packageManagers: string[]; /** Build configuration files for this language */ buildFiles: string[]; /** Popular frameworks for this language */ frameworks: string[]; } /** * LanguageDetector - Advanced multi-language project detection and analysis * * The LanguageDetector class provides sophisticated programming language detection * capabilities across multiple languages including JavaScript/TypeScript, Python, * C#, Java, Go, Rust, PHP, and Ruby. It uses a scoring algorithm that considers * file extensions, configuration files, and project structure to determine the * primary language and detect all languages present in a project. * * @example * ```typescript * const detector = new LanguageDetector(); * * // Detect all languages in a project * const languages = await detector.detectLanguages('./my-project'); * console.log('Detected languages:', languages); * * // Get primary language * const primary = await detector.detectPrimaryLanguage('./my-project'); * console.log('Primary language:', primary); * * // Get language information * const info = detector.getLanguageInfo('javascript'); * console.log('Extensions:', info?.extensions); * ``` * * @since 1.0.0 */ export declare class LanguageDetector { private languages; /** * Detects all programming languages present in a project directory * * Scans the project directory for configuration files and source code files * to identify all programming languages used in the project. This method * performs comprehensive analysis including file extensions and language-specific * configuration files to provide complete language coverage. * * @param projectPath - Absolute path to the project directory to analyze * @returns Promise resolving to array of detected language identifiers * * @example * ```typescript * const detector = new LanguageDetector(); * const languages = await detector.detectLanguages('./full-stack-app'); * // Returns: ['javascript', 'python', 'csharp'] * * // For a simple Node.js project * const simpleLanguages = await detector.detectLanguages('./node-app'); * // Returns: ['javascript'] * ``` */ detectLanguages(projectPath: string): Promise<string[]>; detectPrimaryLanguage(projectPath: string): Promise<string>; getLanguageInfo(language: string): LanguageInfo | undefined; detectFrameworks(projectPath: string, language: string): Promise<string[]>; } //# sourceMappingURL=LanguageDetector.d.ts.map