import { PackageJson } from '../../project/package'; import { DetectionSource } from '..'; /** * Framework detection result. */ interface FrameworkDetection { /** Framework identifier */ id: string; /** Human-readable name */ name: string; /** Framework category */ category: 'frontend' | 'meta-framework'; /** Detected version */ version?: string; /** Detection confidence (0-100) */ confidence: number; /** Meta-frameworks built on this framework */ metaFrameworks?: FrameworkDetection[]; /** Detection sources */ detectedFrom: DetectionSource[]; } /** * Framework detector interface. */ interface FrameworkDetector { /** Framework identifier */ id: string; /** Human-readable name */ name: string; /** Framework category */ category: 'frontend' | 'meta-framework'; /** Check if framework is present */ detect(projectPath: string, packageJson?: PackageJson): FrameworkDetection | null; } /** * Detect Angular in project. * * @param projectPath - Project directory path * @param packageJson - Optional pre-loaded package.json * @returns Detection result or null if not detected * * @example Detecting Angular framework * ```typescript * const result = angularDetector('/path/to/angular-app', { * dependencies: { '@angular/core': '^17.0.0', '@angular/cli': '^17.0.0' } * }) * // => { * // id: 'angular', * // name: 'Angular', * // category: 'frontend', * // version: '17.0.0', * // confidence: 85, * // detectedFrom: [ * // { type: 'package.json', field: 'dependencies.@angular/core' }, * // { type: 'package.json', field: 'dependencies.@angular/cli' } * // ] * // } * ``` */ declare function angularDetector(projectPath: string, packageJson?: PackageJson): FrameworkDetection | null; /** * Detect Astro in project. * * @param projectPath - Project directory path * @param packageJson - Optional pre-loaded package.json * @returns Detection result or null if not detected * * @example Detecting Astro framework * ```typescript * const result = astroDetector('/path/to/astro-project', { * dependencies: { 'astro': '^4.0.0' } * }) * // => { * // id: 'astro', * // name: 'Astro', * // category: 'meta-framework', * // version: '4.0.0', * // confidence: 70, * // detectedFrom: [{ type: 'package.json', field: 'dependencies.astro' }] * // } * ``` */ declare function astroDetector(projectPath: string, packageJson?: PackageJson): FrameworkDetection | null; /** All frontend framework detectors */ declare const frameworkDetectors: FrameworkDetector[]; /** * Detect all frontend frameworks in project. * * @param projectPath - Project directory path * @param packageJson - Optional pre-loaded package.json * @returns Array of detected frameworks, sorted by confidence * * @example Detecting multiple frontend frameworks * ```typescript * const frameworks = detectFrontendFrameworks('/path/to/nextjs-app', { * dependencies: { 'react': '^18.0.0', 'next': '^14.0.0' } * }) * // => [ * // { id: 'nextjs', name: 'Next.js', category: 'meta-framework', confidence: 70, ... }, * // { id: 'react', name: 'React', category: 'frontend', confidence: 60, ... } * // ] * ``` */ declare function detectFrontendFrameworks(projectPath: string, packageJson?: PackageJson): FrameworkDetection[]; /** * Detect Gatsby in project. * * @param projectPath - Project directory path * @param packageJson - Optional pre-loaded package.json * @returns Detection result or null if not detected * * @example Detecting Gatsby framework * ```typescript * const result = gatsbyDetector('/path/to/gatsby-blog', { * dependencies: { * 'gatsby': '^5.0.0', * 'gatsby-plugin-image': '^3.0.0', * 'gatsby-source-filesystem': '^5.0.0' * } * }) * // => { * // id: 'gatsby', * // name: 'Gatsby', * // category: 'meta-framework', * // version: '5.0.0', * // confidence: 75, * // detectedFrom: [ * // { type: 'package.json', field: 'dependencies.gatsby' }, * // { type: 'package.json', field: 'dependencies (gatsby plugins)' } * // ] * // } * ``` */ declare function gatsbyDetector(projectPath: string, packageJson?: PackageJson): FrameworkDetection | null; /** * Detect Next.js in project. * * @param projectPath - Project directory path * @param packageJson - Optional pre-loaded package.json * @returns Detection result or null if not detected * * @example Detecting Next.js framework * ```typescript * const result = nextjsDetector('/path/to/nextjs-app', { * dependencies: { 'next': '^14.0.0', 'react': '^18.0.0' } * }) * // => { * // id: 'nextjs', * // name: 'Next.js', * // category: 'meta-framework', * // version: '14.0.0', * // confidence: 70, * // detectedFrom: [{ type: 'package.json', field: 'dependencies.next' }] * // } * ``` */ declare function nextjsDetector(projectPath: string, packageJson?: PackageJson): FrameworkDetection | null; /** * Detect Nuxt in project. * * @param projectPath - Project directory path * @param packageJson - Optional pre-loaded package.json * @returns Detection result or null if not detected * * @example Detecting Nuxt framework * ```typescript * const result = nuxtDetector('/path/to/nuxt-app', { * dependencies: { 'nuxt': '^3.0.0', 'vue': '^3.0.0' } * }) * // => { * // id: 'nuxt', * // name: 'Nuxt', * // category: 'meta-framework', * // version: '3.0.0', * // confidence: 70, * // detectedFrom: [{ type: 'package.json', field: 'dependencies.nuxt' }] * // } * ``` */ declare function nuxtDetector(projectPath: string, packageJson?: PackageJson): FrameworkDetection | null; /** * Detect Qwik in project. * * @param projectPath - Project directory path * @param packageJson - Optional pre-loaded package.json * @returns Detection result or null if not detected * * @example Detecting Qwik framework * ```typescript * const result = qwikDetector('/path/to/qwik-app', { * dependencies: { * '@builder.io/qwik': '^1.0.0', * '@builder.io/qwik-city': '^1.0.0' * } * }) * // => { * // id: 'qwik', * // name: 'Qwik', * // category: 'frontend', * // version: '1.0.0', * // confidence: 90, * // detectedFrom: [ * // { type: 'package.json', field: 'dependencies.@builder.io/qwik' }, * // { type: 'package.json', field: 'dependencies.@builder.io/qwik-city' } * // ] * // } * ``` */ declare function qwikDetector(projectPath: string, packageJson?: PackageJson): FrameworkDetection | null; /** * Detect React in project. * * @param projectPath - Project directory path * @param packageJson - Optional pre-loaded package.json * @returns Detection result or null if not detected * * @example Detecting React library * ```typescript * const result = reactDetector('/path/to/react-app', { * dependencies: { 'react': '^18.0.0', 'react-dom': '^18.0.0' } * }) * // => { * // id: 'react', * // name: 'React', * // category: 'frontend', * // version: '18.0.0', * // confidence: 80, * // detectedFrom: [ * // { type: 'package.json', field: 'dependencies.react' }, * // { type: 'package.json', field: 'dependencies.react-dom' } * // ] * // } * ``` */ declare function reactDetector(projectPath: string, packageJson?: PackageJson): FrameworkDetection | null; /** * Detect Remix in project. * * @param projectPath - Project directory path * @param packageJson - Optional pre-loaded package.json * @returns Detection result or null if not detected * * @example Detecting Remix framework * ```typescript * const result = remixDetector('/path/to/remix-app', { * dependencies: { * '@remix-run/react': '^2.0.0', * '@remix-run/node': '^2.0.0' * } * }) * // => { * // id: 'remix', * // name: 'Remix', * // category: 'meta-framework', * // version: '2.0.0', * // confidence: 90, * // detectedFrom: [ * // { type: 'package.json', field: 'dependencies.@remix-run/react' }, * // { type: 'package.json', field: 'dependencies.@remix-run/*' } * // ] * // } * ``` */ declare function remixDetector(projectPath: string, packageJson?: PackageJson): FrameworkDetection | null; /** * Detect Solid in project. * * @param projectPath - Project directory path * @param packageJson - Optional pre-loaded package.json * @returns Detection result or null if not detected * * @example Detecting Solid.js framework * ```typescript * const result = solidDetector('/path/to/solid-app', { * dependencies: { 'solid-js': '^1.8.0', 'vite-plugin-solid': '^2.0.0' } * }) * // => { * // id: 'solid', * // name: 'Solid', * // category: 'frontend', * // version: '1.8.0', * // confidence: 90, * // detectedFrom: [ * // { type: 'package.json', field: 'dependencies.solid-js' }, * // { type: 'package.json', field: 'dependencies.vite-plugin-solid' } * // ] * // } * ``` */ declare function solidDetector(projectPath: string, packageJson?: PackageJson): FrameworkDetection | null; /** * Detect Svelte in project. * * @param projectPath - Project directory path * @param packageJson - Optional pre-loaded package.json * @returns Detection result or null if not detected * * @example Detecting Svelte framework * ```typescript * const result = svelteDetector('/path/to/svelte-app', { * devDependencies: { 'svelte': '^4.0.0' } * }) * // => { * // id: 'svelte', * // name: 'Svelte', * // category: 'frontend', * // version: '4.0.0', * // confidence: 70, * // detectedFrom: [{ type: 'package.json', field: 'dependencies.svelte' }] * // } * ``` */ declare function svelteDetector(projectPath: string, packageJson?: PackageJson): FrameworkDetection | null; /** * Detect SvelteKit in project. * * @param projectPath - Project directory path * @param packageJson - Optional pre-loaded package.json * @returns Detection result or null if not detected * * @example Detecting SvelteKit framework * ```typescript * const result = sveltekitDetector('/path/to/sveltekit-app', { * devDependencies: { '@sveltejs/kit': '^2.0.0', 'svelte': '^4.0.0' } * }) * // => { * // id: 'sveltekit', * // name: 'SvelteKit', * // category: 'meta-framework', * // version: '2.0.0', * // confidence: 70, * // detectedFrom: [{ type: 'package.json', field: 'dependencies.@sveltejs/kit' }] * // } * ``` */ declare function sveltekitDetector(projectPath: string, packageJson?: PackageJson): FrameworkDetection | null; /** * Detect Vue in project. * * @param projectPath - Project directory path * @param packageJson - Optional pre-loaded package.json * @returns Detection result or null if not detected * * @example Detecting Vue.js framework * ```typescript * const result = vueDetector('/path/to/vue-app', { * dependencies: { 'vue': '^3.0.0', '@vue/cli-service': '^5.0.0' } * }) * // => { * // id: 'vue', * // name: 'Vue', * // category: 'frontend', * // version: '3.0.0', * // confidence: 85, * // detectedFrom: [ * // { type: 'package.json', field: 'dependencies.vue' }, * // { type: 'package.json', field: 'dependencies.@vue/cli-service' } * // ] * // } * ``` */ declare function vueDetector(projectPath: string, packageJson?: PackageJson): FrameworkDetection | null; export { angularDetector, astroDetector, detectFrontendFrameworks, frameworkDetectors, gatsbyDetector, nextjsDetector, nuxtDetector, qwikDetector, reactDetector, remixDetector, solidDetector, svelteDetector, sveltekitDetector, vueDetector }; export type { FrameworkDetection, FrameworkDetector };