import { RecursiveRefIR } from "../types.js"; import { RecursionState } from "./types.js"; //#region src/core/extract/recursion.d.ts /** * Mint the back-edge for a detected cycle, keyed on the schema the cycle * RE-ENTERS. * * Two detectors reach here and they MUST agree on refIds, or a back-edge calls * a validator hosting a different shape: `extractLazy` sees a cycle one level * early — at the `z.lazy()` wrapper, keyed on the schema it resolves to — while * `dispatch` sees a getter-declared cycle only by re-entering the target * itself. Keying on the re-entered schema in both makes them mint the same id. * * A `recursiveRef` re-invokes the validator hosting its target's shape. The * ROOT schema's resolution is hosted by the schema's own `safeParse_` / * fast-check, so a cycle back to it emits the implicit refId 0 (the directly * self-recursive case). A cycle back to a NON-root sub-schema (recursive schema * nested in a wrapper, multiple distinct recursive sub-schemas, or mutual * recursion) gets a stable refId (≥ 1) keyed by schema identity; `dispatch` * wraps that schema's IR in a `recursionTarget` node so codegen hosts it as a * standalone validator the ref can call. */ declare function makeRecursiveRef(target: unknown, recursion: RecursionState): RecursiveRefIR; //#endregion export { makeRecursiveRef }; //# sourceMappingURL=recursion.d.ts.map