import { Parser } from 'web-tree-sitter';
import type { EngineMode, ExtractorOutput, LanguageRegistryEntry } from '../types.js';
export { extractBashSymbols, extractClojureSymbols, extractCppSymbols, extractCSharpSymbols, extractCSymbols, extractCudaSymbols, extractDartSymbols, extractElixirSymbols, extractErlangSymbols, extractFSharpSymbols, extractGleamSymbols, extractGoSymbols, extractGroovySymbols, extractHaskellSymbols, extractHCLSymbols, extractJavaSymbols, extractJuliaSymbols, extractKotlinSymbols, extractLuaSymbols, extractObjCSymbols, extractOCamlSymbols, extractPHPSymbols, extractPythonSymbols, extractRSymbols, extractRubySymbols, extractRustSymbols, extractScalaSymbols, extractSoliditySymbols, extractSwiftSymbols, extractSymbols, extractVerilogSymbols, extractZigSymbols, } from '../extractors/index.js';
export type { LanguageRegistryEntry } from '../types.js';
interface ParseEngineOpts {
    engine?: EngineMode;
    dataflow?: boolean;
    ast?: boolean;
}
/**
 * Load ALL WASM grammars. Used by full builds and feature modules (CFG, dataflow, complexity)
 * that may process files of any language.
 */
export declare function createParsers(): Promise<Map<string, Parser | null>>;
export declare function disposeParsers(): Promise<void>;
export declare function getParser(parsers: Map<string, Parser | null>, filePath: string): Parser | null;
/**
 * Backfill missing AST-analysis data (astNodes, dataflow, def.complexity,
 * def.cfg) via the WASM worker pool for files that were parsed by the native
 * engine but are missing one or more analyses.
 *
 * Historically this function populated `symbols._tree` so the main-thread
 * visitor walk in `ast-analysis/engine.ts` could run. After the worker-isolation
 * refactor (#965), the worker runs every visitor itself and returns pre-computed
 * analysis data — `_tree` is never set on the main thread.
 *
 * Name is preserved for caller compatibility; the function now ensures
 * *analysis data* rather than *trees*.
 */
export declare function ensureWasmTrees(fileSymbols: Map<string, any>, rootDir: string): Promise<void>;
/**
 * Check whether the required WASM grammar files exist on disk.
 */
export declare function isWasmAvailable(): boolean;
export declare function getInstalledWasmExtensions(): Set<string>;
/**
 * Lowercase file extensions covered by the native Rust addon.
 *
 * Mirrors `LanguageKind::from_extension` in
 * `crates/codegraph-core/src/parser_registry.rs`. Used to classify why the
 * native orchestrator dropped a file: extensions outside this set are a
 * legitimate parser limit (no Rust extractor exists), while extensions inside
 * it indicate a real native bug (parse/read/extract failure).
 *
 * Keep this list in sync with the Rust enum — the native addon is a separate
 * npm package, so JS has no runtime way to discover its language coverage.
 */
export declare const NATIVE_SUPPORTED_EXTENSIONS: ReadonlySet<string>;
/**
 * Classification for a file the native orchestrator dropped.
 * - `unsupported-by-native`: extension has no Rust extractor (legitimate parser limit).
 * - `native-extractor-failure`: extension is supported by native but the file was
 *   still dropped — points at a real bug (read error, parse failure, extractor crash).
 */
export type NativeDropReason = 'unsupported-by-native' | 'native-extractor-failure';
export interface NativeDropClassification {
    /** Per-reason → per-extension → list of relative paths that hit that bucket. */
    byReason: Record<NativeDropReason, Map<string, string[]>>;
    /** Total file count per reason. */
    totals: Record<NativeDropReason, number>;
}
/**
 * Group the missing files (relative paths) by drop reason and extension so the
 * caller can log per-extension counts and a sample path. Pure function — no
 * I/O, safe to unit-test independently of the build pipeline.
 */
export declare function classifyNativeDrops(relPaths: Iterable<string>): NativeDropClassification;
/**
 * Render `{ ext → paths[] }` as `ext (n: sample.ext, ...)` slices for log lines.
 * Caps at 3 sample paths per extension and 6 extensions total to keep warnings
 * readable when many languages are dropped at once. Extensions are sorted by
 * descending file count so the loudest offender shows up first; ties keep
 * insertion order. Pure function — safe to unit-test independently.
 */
export declare function formatDropExtensionSummary(buckets: Map<string, string[]>): string;
/**
 * Declarative registry of all supported languages.
 * Adding a new language requires only a new entry here + its extractor function.
 */
export declare const LANGUAGE_REGISTRY: LanguageRegistryEntry[];
export declare const SUPPORTED_EXTENSIONS: Set<string>;
/**
 * Parse a single file and return normalized symbols.
 */
export declare function parseFileAuto(filePath: string, source: string, opts?: ParseEngineOpts): Promise<ExtractorOutput | null>;
/**
 * Parse multiple files in bulk and return a Map<relPath, symbols>.
 */
export declare function parseFilesAuto(filePaths: string[], rootDir: string, opts?: ParseEngineOpts): Promise<Map<string, ExtractorOutput>>;
/**
 * Report which engine is active.
 */
export declare function getActiveEngine(opts?: ParseEngineOpts): {
    name: 'native' | 'wasm';
    version: string | null;
};
/**
 * Create a native ParseTreeCache for incremental parsing.
 * Returns null if the native engine is unavailable (WASM fallback).
 */
export declare function createParseTreeCache(): any;
/**
 * Parse a file incrementally using the cache, or fall back to full parse.
 */
export declare function parseFileIncremental(cache: any, filePath: string, source: string, opts?: ParseEngineOpts): Promise<ExtractorOutput | null>;
//# sourceMappingURL=parser.d.ts.map