/**
 * Grammar Module — lazy WASM grammar loading for tree-sitter.
 * Centralises all grammar management previously inline in extractor.ts.
 * Sequential loading via grammarLoadChain prevents WASM race condition on Node 20+.
 */
import type { Language } from '../types';
/**
 * Maps each Language to its WASM file name (without .wasm extension).
 * Empty string means no WASM is available for that language.
 * Pascal is bundled separately; all others come from tree-sitter-wasms.
 */
export declare const GRAMMAR_FILE_MAP: Record<Language, string>;
/**
 * Initialises the tree-sitter Parser runtime without loading any language grammars.
 * Safe to call multiple times — idempotent.
 */
export declare function initGrammars(): Promise<void>;
/**
 * Loads WASM grammars for the given languages sequentially.
 * Already-loaded grammars are skipped.
 * WASM load failures are swallowed silently — no throw.
 */
export declare function loadGrammarsForLanguages(languages: Language[]): Promise<void>;
/**
 * Returns a configured Parser instance for the given language.
 * Loads the grammar on demand if not yet cached.
 * Returns null if no grammar is available (unsupported/unknown language).
 */
export declare function getParser(language: Language): Promise<any | null>;
/**
 * Returns true when the grammar for the given language is already in the cache.
 */
export declare function isGrammarLoaded(language: Language): boolean;
/**
 * Returns the list of languages for which a WASM grammar file is known.
 * Languages with an empty GRAMMAR_FILE_MAP entry are excluded.
 */
export declare function getSupportedLanguages(): Language[];
/**
 * Removes all cached grammars and resets the module to uninitialised state.
 * Primarily for testing.
 */
export declare function clearParserCache(): void;
/**
 * Convenience wrapper — loads all known supported language grammars.
 */
export declare function loadAllGrammars(): Promise<void>;
//# sourceMappingURL=grammars.d.ts.map