import type { ReadFolder } from "../types.ts"; import { type GrammarResolver } from "./grammar-assets.ts"; import { type TreeSitterLanguage } from "./syntax.ts"; /** A structural read must never outlast this budget: an exhausted parse falls back, it does not stall. */ export declare const TREE_SITTER_PARSE_BUDGET_MS = 250; export declare const TREE_SITTER_FOLDER_ID = "tree-sitter-wasm"; export declare const TREE_SITTER_FOLDER_VERSION = "1"; export type TreeSitterFolderOptions = { /** Used verbatim when a grammar is absent, the parse fails or the budget is exhausted. */ readonly fallback: ReadFolder; readonly parseBudgetMs?: number; readonly resolveGrammar?: GrammarResolver; readonly resolveRuntime?: () => Promise; /** Off for tests that inject resolvers; the shipped read path always shares one loaded grammar. */ readonly cache?: boolean; }; /** * Load the grammar for one language and return a folder that produces the same fold-boundary * output the heuristic produces, with the heuristic itself as the fallback. Grammars load lazily, * on the first structural read for their language. */ export declare function loadTreeSitterFolder(language: TreeSitterLanguage, options: TreeSitterFolderOptions): Promise; /** Test seam: drop the memoized runtime/grammars so a resolver change is observable. */ export declare function resetTreeSitterGrammars(): void; //# sourceMappingURL=engine.d.ts.map