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;
export declare function ensureWasmTrees(fileSymbols: Map<string, any>, rootDir: string, needsFn?: (relPath: string, symbols: any) => boolean): 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 a multi-line tabular breakdown for log lines.
 * Each extension occupies its own line so a long warning scans like a table
 * instead of a wall of semicolon-separated slices. Caps at 3 sample paths per
 * extension and 6 extensions total to keep output bounded 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.
 *
 * Returns the empty string for empty input, and otherwise a string that
 * begins with `\n` so callers can append it directly after the header line
 * (`"Backfilling via WASM:" + formatDropExtensionSummary(...)`).
 *
 * 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>;
/**
 * Backfill helper: small batches use the inline (main-thread) path; larger
 * batches keep the worker-pool isolation against tree-sitter WASM crashes
 * (#965). Threshold matches typical engine-parity drop sizes (a few fixture
 * files in one or two languages).
 *
 * `opts.symbolsOnly` skips the AST/complexity/CFG/dataflow visitors in the
 * worker (and their result serialization across the thread boundary) for
 * callers that only consume definitions/calls/typeMap — the native
 * orchestrator's prototype-methods and this-dispatch post-passes. Callers
 * that ingest the files into the DB (dropped-language backfill) must keep
 * the default full analysis.
 */
export declare function parseFilesWasmForBackfill(filePaths: string[], rootDir: string, opts?: {
    symbolsOnly?: boolean;
}): Promise<Map<string, ExtractorOutput>>;
/**
 * 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;
    binaryVersion: 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