import type { NativeAstConfig, NativeLang, NativeKind, NativeDiagnostic, RouteInfo, SchemaModel, ImportEdge, Framework } from "../types.js"; /** Effective, resolved native-AST settings for one scan. */ export interface NativeAstResolved { mode: false | "on" | "strict"; /** Languages native parsing applies to. Empty set = all discovered languages. */ languages: Set; /** * True when an explicit language list was given (so those languages are * AUTHORITATIVE — they preempt built-in extraction). Empty list / "all" = * additive. Equivalent to `languages.size > 0`, captured for clarity. */ authoritative: boolean; /** Plugin directories searched in order (PATH-style waterfall). */ pluginDirs: string[]; /** Shared, mutable sink for strict-mode diagnostics. */ diagnostics: NativeDiagnostic[]; /** Shared, mutable sink for non-fatal warnings (collisions, name mismatch, etc.). */ warnings: string[]; } /** A plugin adapted to codesight's domain types. Methods return null when the * plugin produced nothing (caller falls back to the built-in parser). */ export interface NativePlugin { routes?(file: string, content: string, framework: Framework, tags: string[]): RouteInfo[] | null; schemas?(file: string, content: string): SchemaModel[] | null; imports?(file: string, content: string): ImportEdge[] | null; } /** * Resolve raw config into effective settings. Returns a shared disabled value * when native AST is off. Memoized per config object so all detectors share the * same diagnostics sink. */ export declare function resolveNativeAst(cfg: NativeAstConfig | undefined, projectRoot: string): NativeAstResolved; /** Is native parsing enabled for this language under the resolved settings? */ export declare function nativeEnabledFor(r: NativeAstResolved, lang: NativeLang): boolean; export declare function isStrict(r: NativeAstResolved): boolean; /** A language's adapted plugin + whether it preempts built-in extraction. */ export interface NativeRegistryEntry { lang: string; authoritative: boolean; plugin: NativePlugin; } /** Extension → owning plugin, for one scan. */ export interface NativeRegistry { /** Lowercased extension (leading dot) → the plugin that handles it. */ byExt: Map; } /** * Build the extension→plugin registry: target the explicit languages (or * enumerate all discovered plugins for "all"), resolve each language's * identity (`describe().languageId` wins over the filename) and extensions * (`describe().extensions`, else the built-in default map), and route extensions * with the collision rule. Records strict diagnostics for enabled-but-unavailable * or unroutable languages, and warnings for name mismatches / extension collisions. */ export declare function buildNativeRegistry(r: NativeAstResolved): NativeRegistry; /** * Get the native plugin for (lang, kind), or null when native is disabled for * the language, no plugin is available, or the plugin doesn't support the kind. * Under strict mode, an expected-but-unavailable plugin records a single * diagnostic (deduped per lang+kind). Call once per sub-detector, not per file. */ export declare function nativePluginFor(lang: NativeLang, kind: NativeKind, r: NativeAstResolved): NativePlugin | null; /** Record a per-file parse failure (strict mode). */ export declare function recordParseError(r: NativeAstResolved, lang: NativeLang, kind: NativeKind, file: string, err: unknown): void; /** CLI-formatted summary of strict-mode diagnostics, or "" when there are none. */ export declare function reportNativeDiagnostics(diagnostics: NativeDiagnostic[]): string;