/** * web-tree-sitter WASM loader * * Loads WASM grammar files and creates tree-sitter parsers for supported languages. * initParsers() must be called once at entry points (CLI boot, MCP server start) * before any adapterBridge use. Adapter calls to getParser() on an uninitialized * parser throw with a clear message — this is a programmer error, not a runtime * condition to recover from. */ import { Parser } from 'web-tree-sitter'; /** * Initialize tree-sitter parsers for all supported languages. * MUST be called once before any adapterBridge or adapter use. * * WASM paths are resolved relative to this module's location via import.meta.url, * NOT process.cwd(). This ensures the grammars are found regardless of the * working directory at runtime (critical for npx-invoked hooks). */ export declare function initParsers(): Promise; /** * Get a tree-sitter Parser for the given language. * Throws if initParsers() has not been called. * * @param lang - Language identifier ('typescript', 'javascript', 'go') * @param isTsx - If true and lang is 'typescript', use the TSX grammar */ export declare function getParser(lang: string, isTsx?: boolean): Parser; /** * Returns true if parsers have been initialized. */ export declare function isInitialized(): boolean; /** * Get available language identifiers. */ export declare function getAvailableLanguages(): string[]; //# sourceMappingURL=parser.d.ts.map