import { Recipe } from "../recipe"; import { ExecutionContext } from "../execution"; import { TreeVisitor } from "../visitor"; import { Parser } from "../parser"; import { SourceFile } from "../tree"; export interface SourceSpec { kind: string; before: string | null; after?: AfterRecipeText; path?: string; parser: (ctx: ExecutionContext) => Parser; beforeRecipe?: (sourceFile: T) => T | void | Promise | Promise; afterRecipe?: (sourceFile: T) => T | void | Promise | Promise; ext: string; } export declare class RecipeSpec { checkParsePrintIdempotence: boolean; allowEmptyDiff: boolean; recipe: Recipe; /** * Used for both parsing and recipe execution unless an alternative recipe execution context is set with * recipeExecutionContext. */ executionContext: ExecutionContext; /** * If not specified, will share executionContext instance with the parsing phase. */ recipeExecutionContext: ExecutionContext; private dataTableAssertions; dataTable(name: string, allRows: (rows: Row[]) => void): void; rewriteRun(...sourceSpecs: (SourceSpec | Generator, void, unknown> | AsyncGenerator, void, unknown>)[]): Promise; private expectNoParseFailures; private expectParsePrintIdempotence; private expectResultsToMatchAfter; private expectGeneratedFiles; private expectAfter; /** * Parse the whole group together so the sources can reference once another. */ private parse; private expectWhitespaceNotToContainNonwhitespaceCharacters; } export type AfterRecipeText = string | ((actual: string) => string | undefined) | undefined | null; /** * Simple dedent implementation that removes common leading whitespace from each line. * * Behavior: * - Removes ONE leading newline if present (for template string ergonomics) * - Preserves trailing newlines (important for testing formatters like Prettier) * - For lines with content: removes common indentation * - For lines with only whitespace: removes common indentation, preserving remaining spaces * * Examples: * - `\n code` → `code` (single leading newline removed) * - `\n\n code` → `\ncode` (first newline removed, second preserved) * - ` code\n` → `code\n` (trailing newline preserved) * - ` code\n\n` → `code\n\n` (trailing newlines preserved) */ export declare function dedent(s: string): string; export declare function dedentAfter(s?: AfterRecipeText): AfterRecipeText; export declare class AdHocRecipe extends Recipe { private visitor; name: string; displayName: string; description: string; constructor(visitor: TreeVisitor); editor(): Promise>; } export declare function fromVisitor(visitor: TreeVisitor): Recipe; //# sourceMappingURL=rewrite-test.d.ts.map