import { TreeVisitor } from "./visitor"; import { Cursor, SourceFile } from "./tree"; import { ExecutionContext } from "./execution"; import { DataTableDescriptor } from "./data-table"; export type Minutes = number; export declare abstract class Recipe { constructor(options?: {}); /** * A unique name for the recipe consisting of a dot separated sequence of category * names in which the recipe should appear followed by a name. For example, * "org.openrewrite.typescript.find-methods-by-pattern". */ readonly abstract name: string; /** * A human-readable display name for the recipe, initial capped with no period. * For example, "Find text". The display name can be assumed to be rendered in * documentation and other places where markdown is understood, so it is possible * to use stylistic markers like backticks to indicate types. For example, * "Find uses of `console.log`". * * @language Markdown */ readonly abstract displayName: string; /** * A human-readable description for the recipe, consisting of one or more full * sentences ending with a period. * * "Find methods by pattern." is an example. The description can be assumed to be rendered in * documentation and other places where markdown is understood, so it is possible * to use stylistic markers like backticks to indicate types. For example, * "Find uses of `console.log`.". * * @language Markdown. */ readonly abstract description: string; readonly tags: string[]; readonly estimatedEffortPerOccurrence: Minutes; readonly dataTables: DataTableDescriptor[]; recipeList(): Promise; /** * A human-readable display name for this recipe instance, including some descriptive * text about the recipe options that are supplied, if any. The name must be * initial capped with no period. For example, "Find text "hello world"". * * For consistency, when surrounding option descriptive text in quotes to visually differentiate * it from the text before it, use single ``. * * Override to provide meaningful recipe instance names for recipes with complex sets of options. * * @return A name that describes this recipe instance. */ instanceName(): string; descriptor(): Promise; /** * Returns the visitor that performs the transformation. This method is called by the * recipe framework during execution and must be overridden by concrete recipe implementations. * * @returns A visitor that performs the recipe's transformation */ editor(): Promise>; /** * At the end of a recipe run, the recipe scheduler will call this method to allow the * recipe to perform any cleanup or finalization tasks. This method is guaranteed to be called * only once per run. * * @param _ctx The recipe run execution context. */ onComplete(_ctx: ExecutionContext): Promise; } export interface RecipeDescriptor { readonly name: string; readonly displayName: string; readonly instanceName: string; readonly description: string; readonly tags: string[]; readonly estimatedEffortPerOccurrence: Minutes; readonly options: ({ name: string; value?: any; } & OptionDescriptor)[]; readonly preconditions: RecipeDescriptor[]; readonly recipeList: RecipeDescriptor[]; readonly dataTables: DataTableDescriptor[]; readonly maintainers: any[]; readonly contributors: any[]; readonly examples: any[]; } export interface OptionDescriptor { readonly displayName: string; readonly description: string; readonly required?: boolean; readonly example?: string; readonly valid?: string[]; } export declare abstract class ScanningRecipe

extends Recipe { private readonly recipeAccMessage; accumulator(cursor: Cursor, ctx: ExecutionContext): P; abstract initialValue(ctx: ExecutionContext): P; editor(): Promise>; editorWithData(acc: P): Promise>; generate(acc: P, ctx: ExecutionContext): Promise; scanner(acc: P): Promise>; } export declare function Option(descriptor: OptionDescriptor): (target: any, propertyKey: string) => void; /** * Mark a property as transient, meaning it should not be part of the serialized form of * a recipe. * * @param target * @param propertyKey * @constructor */ export declare function Transient(target: any, propertyKey: string): void; //# sourceMappingURL=recipe.d.ts.map