import { CommandRenderOptions, DiffLikeOptions, formatMigrationHelpText, parseMigrationArgs, WizardOptions } from './migration-command-surface.js'; import { createMigrationDiff } from './migration-diff.js'; import { formatDiffReport } from './migration-render.js'; import { createMigrationRiskSummary } from './migration-risk.js'; import { doctorProjectMigrations, fixturesProjectMigrations, fuzzProjectMigrations, verifyProjectMigrations } from './migration-maintenance.js'; import type { MigrationBlockConfig, ParsedMigrationArgs } from './migration-types.js'; type MigrationPlanBlockSummary = { blockName: string; diff: ReturnType; riskSummary: ReturnType; }; type MigrationPlanSummary = { availableLegacyVersions: string[]; currentMigrationVersion: string; fromMigrationVersion: string; includedBlocks: string[]; nextSteps: string[]; skippedBlocks: string[]; summaries: MigrationPlanBlockSummary[]; targetMigrationVersion: string; }; export { formatMigrationHelpText, parseMigrationArgs }; export { formatDiffReport }; /** * Dispatch a parsed migration command to the matching runtime workflow. * * Most commands execute synchronously and preserve direct throw semantics for * existing callers. The interactive `wizard` command returns a promise because * it waits for prompt selection before running the shared read-only planner. * * @param command Parsed migration command and flags. * @param cwd Project directory to operate on. * @param options Optional prompt/render hooks for testable and interactive execution. * @returns The command result, or a promise when the selected command is interactive. */ export declare function runMigrationCommand(command: ParsedMigrationArgs, cwd: string, { prompt, renderLine }?: CommandRenderOptions): { block: import("./migration-types.js").ResolvedMigrationBlockTarget; diff: import("./migration-types.js").MigrationDiff; }[] | import("./migration-types.js").MigrationDiff | MigrationPlanSummary | import("./migration-types.js").MigrationProjectState | Promise | { verifiedVersions: string[]; } | { checkedVersions: string[]; checks: { detail: string; label: string; status: 'fail' | 'pass'; }[]; } | { generatedVersions: string[]; skippedVersions: string[]; } | { fuzzedVersions: string[]; seed: number | undefined; } | { blockName: string; diff: ReturnType; rulePath: string; } | { scaffolded: { blockName: string; diff: ReturnType; rulePath: string; }[]; }; /** * Preview one migration edge without scaffolding rules, fixtures, or generated files. * * @param projectDir Absolute or relative project directory containing the migration workspace. * @param options Selected source/target versions plus optional line rendering overrides. * @returns A structured summary of the selected edge, included/skipped block targets, and next steps. */ export declare function planProjectMigrations(projectDir: string, { fromMigrationVersion, renderLine, toMigrationVersion }?: DiffLikeOptions): MigrationPlanSummary; /** * Interactively choose one legacy version to preview, then run the same read-only planner. * * @param projectDir Absolute or relative project directory containing the migration workspace. * @param options Interactive prompt and rendering settings. Throws when no TTY is available. * @returns The planned migration summary, or `{ cancelled: true }` when the user exits the wizard. */ export declare function wizardProjectMigrations(projectDir: string, { isInteractive, prompt, renderLine }?: WizardOptions): Promise; /** * Initializes migration scaffolding for a detected single-block or multi-block project layout. * * @param projectDir Absolute or relative project directory containing the migration workspace. * @param currentMigrationVersion Initial migration version label to seed, such as `v1`. * @param options Console rendering options used to report retrofit detection and initialization output. * @returns The loaded migration project state after the config, snapshots, and generated files are written. * @throws Error When the project layout is unsupported or the migration version label is invalid. */ export declare function initProjectMigrations(projectDir: string, currentMigrationVersion: string, { renderLine }?: CommandRenderOptions): import("./migration-types.js").MigrationProjectState; /** * Captures the current project state as a named migration snapshot and refreshes generated artifacts. * * @param projectDir Absolute or relative project directory containing the migration workspace. * @param migrationVersion Migration version label to snapshot, such as `v2`. * @param options Console rendering options and snapshot side-effect flags. * @returns The loaded migration project state after the snapshot files and registry outputs are refreshed. * @throws Error When the label is invalid, the project is not migration-capable, or `sync-types` fails. */ export declare function snapshotProjectVersion(projectDir: string, migrationVersion: string, { renderLine, skipConfigUpdate, skipSyncTypes }?: CommandRenderOptions & { skipConfigUpdate?: boolean; skipSyncTypes?: boolean; }): import("./migration-types.js").MigrationProjectState; /** * Computes and renders migration diffs for a selected legacy-to-target edge. * * @param projectDir Absolute or relative project directory containing the migration workspace. * @param options Selected source and target migration versions plus optional line rendering overrides. * @returns A single diff for single-block workspaces, or an array of per-block diffs for multi-block workspaces. * @throws Error When `fromMigrationVersion` is missing or no eligible snapshots exist for the selected edge. */ export declare function diffProjectMigrations(projectDir: string, { fromMigrationVersion, toMigrationVersion, renderLine }?: DiffLikeOptions): { block: import("./migration-types.js").ResolvedMigrationBlockTarget; diff: import("./migration-types.js").MigrationDiff; }[] | import("./migration-types.js").MigrationDiff; /** * Scaffolds migration rule and fixture files for a selected legacy-to-target edge. * * @param projectDir Absolute or relative project directory containing the migration workspace. * @param options Selected source and target migration versions plus optional line rendering overrides. * @returns A single scaffold result for single-block workspaces, or a grouped result for multi-block workspaces. * @throws Error When `fromMigrationVersion` is missing or no eligible snapshots exist for the selected edge. */ export declare function scaffoldProjectMigrations(projectDir: string, { fromMigrationVersion, toMigrationVersion, renderLine }?: DiffLikeOptions): { blockName: string; diff: ReturnType; rulePath: string; } | { scaffolded: { blockName: string; diff: ReturnType; rulePath: string; }[]; }; export { doctorProjectMigrations, fixturesProjectMigrations, fuzzProjectMigrations, verifyProjectMigrations, }; /** * Initialize migration scaffolding for one or more block targets. * * Writes the migration config, creates the initial scaffold files, snapshots * the current project state, and regenerates generated migration artifacts. * * @param projectDir Absolute or relative project directory containing the migration workspace. * @param currentMigrationVersion Initial migration version label to seed into the migration config. * @param blocks Block targets to register for migration-aware scaffolding. * @param options Console rendering options for initialization output. * @returns The loaded migration project state after initialization completes. */ export declare function seedProjectMigrations(projectDir: string, currentMigrationVersion: string, blocks: MigrationBlockConfig[], { renderLine }?: CommandRenderOptions): import("./migration-types.js").MigrationProjectState;