import { Recipe } from "../../recipe"; import { TreeVisitor } from "../../visitor"; import { ExecutionContext } from "../../execution"; /** * Changes an import from one module to another, updating all type attributions. * * This recipe is useful for: * - Library migrations (e.g., moving `act` from `react-dom/test-utils` to `react`) * - Module restructuring (e.g., split packages) * - Renaming exported members * * @example * // Migrate act import from react-dom/test-utils to react * const recipe = new ChangeImport({ * oldModule: "react-dom/test-utils", * oldMember: "act", * newModule: "react" * }); * // Before: import { act } from 'react-dom/test-utils'; * // After: import { act } from 'react'; * * @example * // Change a named import to a different name * const recipe = new ChangeImport({ * oldModule: "lodash", * oldMember: "extend", * newModule: "lodash", * newMember: "assign" * }); * // Before: import { extend } from 'lodash'; * // After: import { assign } from 'lodash'; */ export declare class ChangeImport extends Recipe { readonly name = "org.openrewrite.javascript.change-import"; readonly displayName = "Change import"; readonly description = "Changes an import from one module/member to another, updating all type attributions."; oldModule: string; oldMember: string; newModule: string; newMember?: string; newAlias?: string; constructor(options?: { oldModule?: string; oldMember?: string; newModule?: string; newMember?: string; newAlias?: string; }); editor(): Promise>; } //# sourceMappingURL=change-import.d.ts.map