type ClassConstructor = new (...args: any[]) => any; export type OptionInputObject = { [key: string]: string | number | boolean | object; }; export declare global { namespace OpenRewrite { /** * Assumes that the package.json has a "main" property pointing to the * compiled js recipe. This will be required for publishing. This method * will run the before string provided through the recipe defined in main and * return the resulting string. * * @param before The string to be run through the recipe. * @param parserType The parser used to analyze the before text. Expressed as a file extension type for example: 'json' * @param recipe The exported class extending Recipe * @param options If your recipe receives options you can pass them here * @returns The resulting string. */ function runRecipe( before: string, parserType: string, recipe: ClassConstructor, options?: OptionInputObject ): Promise; /** * Runs a basic test suite. Can be called in a test file and will create it's * own Describe block. * * @param recipe The exported class extending Recipe */ function runBasicRecipeTests(recipe: ClassConstructor): void; } namespace jest { interface Matchers { /** * Asserts that run id is defined and provides contextual messaging * for when test does not pass. */ toBeADefinedRunId(message?: string): R; /** * Asserts that run summary is defined and provides contextual messaging * for when test does not pass. */ toBeADefinedRunSummary(id: string, message?: string): R; /** * Asserts that run result is defined and provides contextual messaging * for when test does not pass. */ toBeADefinedRunResult(id: string, link: string, message?: string): R; } } }