/** * Migration engine — file discovery and migration orchestration. * * The engine walks a directory tree, filters files by extension, and runs * migration units in detect-only or detect+apply mode. All file I/O uses * Node built-in modules (no external dependencies). * * Security: * - Writes files only when `apply: true` is explicitly set * - Skips unreadable files and directories silently * - Normalises all output paths to forward slashes * * @module migrate/engine */ import type { MigrationResult, MigrationUnit } from './types.js'; /** Directories that are always skipped during file discovery. */ export declare const DEFAULT_SKIP_DIRS: Set; /** * Discover all files under `basePath` whose extension is in `extensions`. * * @param basePath - Root directory to scan * @param extensions - Set of extensions to include (e.g. `new Set(['.ts', '.html'])`) * @param skipDirs - Directory names to skip (defaults to {@link DEFAULT_SKIP_DIRS}) * @returns Sorted array of absolute file paths */ export declare function discoverFiles(basePath: string, extensions: Set, skipDirs?: Set): Promise; /** Options for {@link runMigrations}. */ export interface RunOptions { /** Root directory to scan for files */ basePath: string; /** Migration units to execute */ units: MigrationUnit[]; /** When true, apply transformations and write files. Default: false (detect only). */ apply?: boolean; /** Additional directory names to skip during file discovery */ skipDirs?: string[]; } /** * Run one or more migration units against a directory tree. * * In detect-only mode (default), files are scanned but never modified. * In apply mode (`apply: true`), each unit's `apply()` function is called * and the result is written back to disk. * * @param options - Configuration for the migration run * @returns One {@link MigrationResult} per unit, in the same order as `options.units` */ export declare function runMigrations(options: RunOptions): Promise;