import { type WasmGrammarInfo, type WasmGrammarQuery } from "@oh-my-pi/pi-natives";
/**
* Download, verify, and install `info`'s wasm grammar into `dir` (default:
* the directory the addon reads). Returns whether `
/` exists
* afterwards. Concurrent calls for the same file share one install, and an OS
* file lock serializes installs across processes. Never throws: network and
* integrity failures are logged, return `false`, and back off for a few
* minutes. {@link ensureGrammar} is the usual entry point; this takes the
* resolved info directly (test seam).
*/
export declare function installGrammar(info: WasmGrammarInfo, dir?: string): Promise;
/**
* Make sure the wasm grammar for `query` (a `lang` alias or a file `path`) is
* installed, downloading it on first use. Returns `true` without network
* access for built-in, unknown, or already installed languages; otherwise
* whether the install succeeded. Offline or integrity failures log and return
* `false`; native AST APIs then treat the language as unsupported.
*/
export declare function ensureGrammar(query: WasmGrammarQuery): Promise;
/**
* Install the wasm grammars of `languages` (typically a native result's
* `missingGrammars`). Returns `true` when at least one of them is now
* installed, i.e. a caller that saw them missing should re-run.
*/
export declare function ensureGrammars(languages: readonly string[]): Promise;
/**
* Run an idempotent native AST call (a search or a dry-run preview) against
* the grammar cache and, when it reports `missingGrammars`, install them and
* run it once more. Never use it for calls that write: the re-run would apply
* rewrites twice.
*/
export declare function rerunWithGrammars(run: () => Promise): Promise;
/** Tool-output note for languages whose files were skipped because their grammar could not be installed. */
export declare function missingGrammarsNote(languages: readonly string[]): string;