import { LoadedMigration } from './migration.interface'; /** * Loads migration files from the filesystem. * * Migration files must: * - Be TypeScript files with .ts extension * - Export a default class/object implementing the Migration interface (up/down methods) * * Naming conventions (all supported): * - YYYYMMDD-HHMMSS.ts (recommended, generated by scaffold) * - 001_initial.ts, 002_add_users.ts (numbered) * - create_users.ts, add_posts.ts (descriptive) * * Files are sorted lexicographically, so use consistent naming for proper order. * * @example * ```typescript * const loader = new MigrationLoader('./migrations'); * const migrations = await loader.loadAllMigrations(); * ``` */ export declare class MigrationLoader { private migrationsDirectory; constructor(migrationsDirectory: string); /** * Extract a sort key from the filename. * For timestamp patterns, extracts the timestamp. * For other patterns, uses the filename without extension. */ private extractSortKey; /** * Get all migration files in the directory, sorted lexicographically. * Includes all .ts files in the directory. */ getMigrationFiles(): Promise; /** * Load a single migration file. * * Uses require() to load the TypeScript file, which works when running * with ts-node, tsx, or other TypeScript loaders. * * @param filename - The migration filename to load * @returns The loaded migration with metadata * @throws Error if the file doesn't exist or doesn't implement Migration */ loadMigration(filename: string): Promise; /** * Load all migrations from the directory, sorted lexicographically. * @returns Array of loaded migrations in order */ loadAllMigrations(): Promise; /** * Generate a new migration filename with the current timestamp. * Format: YYYYMMDD-HHMMSS.ts (recommended naming convention) * * @returns A new unique migration filename */ generateFilename(): string; /** * Get the absolute path to the migrations directory. * Resolves relative paths against process.cwd(). */ getAbsoluteDirectory(): string; /** * Ensure the migrations directory exists. * Creates it (including parent directories) if it doesn't exist. */ ensureDirectory(): void; } //# sourceMappingURL=migration-loader.d.ts.map