import type { RpcRecipe } from "./recipe"; /** * Prepare a Java recipe via the active {@link RewriteRpc} connection. * * Routes a `PrepareRecipe` request to whichever side hosts the Java * implementation: * - in production, the Java host that spawned the TS server (`dist/rpc/server.js`); * - in tests, the JVM spawned via `JavaRpcTestServer` (see * `@openrewrite/rewrite/test/java-rpc`). * * The returned {@link RpcRecipe} extends `Recipe`, so it can be used directly * as a recipe — e.g. assigned to `RecipeSpec.recipe` — or composed inside a * larger TS recipe (as the editor of a `check(usesType(...), ...)` * precondition, or as a step in `recipeList()`). * * Top-level convenience functions for specific Java recipes (e.g. * `addDependency`, `changeType`) sit naturally on top of this primitive: * * ```ts * export function addDependency(options: AddDependencyOptions): Promise { * return prepareJavaRecipe("org.openrewrite.javascript.AddDependency", options); * } * ``` * * There is no in-process fallback by design: a Java recipe's editor is the * single source of truth — we don't reimplement editing recipes in TS. For * preconditions that need a graceful no-RPC fallback, use the {@link RecipeRef} * pattern via `usesType` / `usesMethod`, which carries a `localVisitor`. * * @throws Error when no active {@link RewriteRpc} connection is registered. */ export declare function prepareJavaRecipe(id: string, options?: Record): Promise; //# sourceMappingURL=java-recipe.d.ts.map