import { PackageJson } from '../../project/package'; import { DetectionSource } from '..'; /** * Testing framework detection result. */ interface TestingFrameworkDetection { /** Framework identifier */ id: string; /** Human-readable name */ name: string; /** Detected version */ version?: string; /** Config file path */ configPath?: string; /** Test type */ type: 'unit' | 'e2e' | 'integration'; /** Detection confidence (0-100) */ confidence: number; /** Detection sources */ detectedFrom: DetectionSource[]; } /** * Testing framework detector interface. */ interface TestingFrameworkDetector { /** Framework identifier */ id: string; /** Human-readable name */ name: string; /** Test type */ testType: 'unit' | 'e2e' | 'integration'; /** Check if framework is present */ detect(projectPath: string, packageJson?: PackageJson): TestingFrameworkDetection | null; } /** Config patterns for Cypress */ declare const CYPRESS_CONFIG_PATTERNS: string[]; /** * Detect Cypress in project. * * @param projectPath - Project directory path * @param packageJson - Optional pre-loaded package.json * @returns Detection result or null if not detected * * @example Detecting Cypress testing framework * ```typescript * import { cypressDetector } from '@hyperfrontend/project-scope' * * const result = cypressDetector('./my-project') * if (result) { * console.log(`Cypress ${result.version} detected (${result.confidence}% confidence)`) * // => "Cypress 13.6.0 detected (95% confidence)" * } * ``` */ declare function cypressDetector(projectPath: string, packageJson?: PackageJson): TestingFrameworkDetection | null; /** All testing framework detectors */ declare const testingDetectors: TestingFrameworkDetector[]; /** * Detect all testing frameworks in project. * * @param projectPath - Project directory path * @param packageJson - Optional pre-loaded package.json * @returns Array of detected testing frameworks, sorted by confidence * * @example Detecting multiple testing frameworks * ```typescript * import { detectTestingFrameworks } from '@hyperfrontend/project-scope' * * const frameworks = detectTestingFrameworks('./my-project') * // => [ * // { id: 'jest', name: 'Jest', type: 'unit', confidence: 95, ... }, * // { id: 'cypress', name: 'Cypress', type: 'e2e', confidence: 85, ... } * // ] * * // Results are sorted by confidence (highest first) * const primary = frameworks[0]?.name ?? 'None' * console.log(`Primary testing framework: ${primary}`) * ``` */ declare function detectTestingFrameworks(projectPath: string, packageJson?: PackageJson): TestingFrameworkDetection[]; /** Config patterns for Jest */ declare const JEST_CONFIG_PATTERNS: string[]; /** * Detect Jest in project. * * @param projectPath - Project directory path * @param packageJson - Optional pre-loaded package.json * @returns Detection result or null if not detected * * @example Detecting Jest testing framework * ```typescript * import { jestDetector } from '@hyperfrontend/project-scope' * * const result = jestDetector('./my-project') * if (result) { * console.log(`Jest ${result.version} detected`) * console.log('Sources:', result.detectedFrom.map(s => s.type)) * // => "Sources: ['package.json', 'config-file']" * } * ``` */ declare function jestDetector(projectPath: string, packageJson?: PackageJson): TestingFrameworkDetection | null; /** Config patterns for Mocha */ declare const MOCHA_CONFIG_PATTERNS: string[]; /** * Detect Mocha in project. * * @param projectPath - Project directory path * @param packageJson - Optional pre-loaded package.json * @returns Detection result or null if not detected * * @example Detecting Mocha testing framework * ```typescript * import { mochaDetector } from '@hyperfrontend/project-scope' * * const result = mochaDetector('./my-project') * if (result) { * console.log(`Mocha ${result.version} detected (${result.confidence}%)`) * // => "Mocha 10.2.0 detected (95%)" * } * ``` */ declare function mochaDetector(projectPath: string, packageJson?: PackageJson): TestingFrameworkDetection | null; /** Config patterns for Playwright */ declare const PLAYWRIGHT_CONFIG_PATTERNS: string[]; /** * Detect Playwright in project. * * @param projectPath - Project directory path * @param packageJson - Optional pre-loaded package.json * @returns Detection result or null if not detected * * @example Detecting Playwright testing framework * ```typescript * import { playwrightDetector } from '@hyperfrontend/project-scope' * * const result = playwrightDetector('./my-project') * if (result) { * console.log(`Playwright ${result.version} (${result.type} tests)`) * // => "Playwright 1.42.0 (e2e tests)" * } * ``` */ declare function playwrightDetector(projectPath: string, packageJson?: PackageJson): TestingFrameworkDetection | null; /** Config patterns for Vitest */ declare const VITEST_CONFIG_PATTERNS: string[]; /** * Detect Vitest in project. * * @param projectPath - Project directory path * @param packageJson - Optional pre-loaded package.json * @returns Detection result or null if not detected * * @example Detecting Vitest testing framework * ```typescript * import { vitestDetector } from '@hyperfrontend/project-scope' * * const result = vitestDetector('./my-project') * if (result) { * console.log(`Vitest ${result.version} detected`) * console.log('Config:', result.configPath) * // => "Config: vitest.config.ts" * } * ``` */ declare function vitestDetector(projectPath: string, packageJson?: PackageJson): TestingFrameworkDetection | null; export { CYPRESS_CONFIG_PATTERNS, JEST_CONFIG_PATTERNS, MOCHA_CONFIG_PATTERNS, PLAYWRIGHT_CONFIG_PATTERNS, VITEST_CONFIG_PATTERNS, cypressDetector, detectTestingFrameworks, jestDetector, mochaDetector, playwrightDetector, testingDetectors, vitestDetector }; export type { TestingFrameworkDetection, TestingFrameworkDetector };