import MagicString from 'magic-string'; export type ParsecraftPluginOptions = { /** Extra module specifiers to treat as parseman re-exports */ moduleAliases?: string[]; /** * Warn when a regex terminal can't LOWER to a fast `charCodeAt` scan and falls * back to `RegExp.exec`. **Default `false` (opt-in).** `RegExp.exec` is an * accepted, JIT-fast compiled path — most un-lowered regexes are perfectly fine * and lowering them often shows no real gain — so this is a diagnostic you turn * ON when specifically auditing lowering coverage, not a build-time nag. */ warnUnloweredRegex?: boolean; /** * Bake automatic list recovery into the macro-compiled output. **Default `false`.** * When on, `many`/`oneOrMore`/`sepBy` in every compiled grammar gain a * `_ctx._tolerant`-gated recovery branch (dormant on strict parses — a normal * parse is unaffected and allocates nothing). The output stays macro-inlinable * (sentinels build via `_ctx._rec`, not `_rp`). Turn it on for grammars you drive * from an editor/language service so `run(g, src, { tolerant: true })` recovers on * the fast compiled path; leave it off for build-only grammars. */ recovery?: boolean; /** Emit grammar-coverage hooks in macro output. Off by default, so ordinary * macro output remains byte-identical. */ grammarCoverage?: boolean; }; declare const _default: import("unplugin").UnpluginInstance; export default _default; export type TransformMacroResult = { code: string; map: ReturnType; /** Diagnostics for macro-referencing shapes that fell back to the interpreter. */ warnings: string[]; }; /** * Transform one module, ALWAYS releasing the process-global capture state. * * `beginDegradationCapture()`, `beginLoweringCapture()` and `setReducerResolver()` set * module-level globals that the body's straight-line path released at the end. The body * also THROWS — `composeLeaf() must macro-fuse` at the `compileComposeLeafCall` site is * one of several — and every one of those throws jumped over the release. * * The consequence was process-wide and silent: one failed macro transform left the * degradation sink OPEN forever, so every later `recordDegradation` — including from an * unrelated runtime `compile()` in the same process — was filed into an orphaned Map that * nobody would ever drain, and printed nothing. Measured: 0 `console.warn` calls after an * aborted capture, 1 finding stranded in the orphan. * * So the release lives in a `finally`, and whatever the failed frame had collected is * printed rather than dropped — a degradation that was real before the abort is still * real after it. */ export declare function transformMacro(code: string, id: string, moduleAliases?: Set, warnUnloweredRegex?: boolean, recovery?: boolean, grammarCoverage?: boolean): TransformMacroResult | null; //# sourceMappingURL=index.d.ts.map