import type { ClientSession, Db } from 'mongodb'; import { LoggerFactory } from '@nl-framework/logger'; import type { Migration, MigrationStatusEntry } from '../interfaces/migration'; export declare const MIGRATION_HISTORY_COLLECTION = "_nl_migrations"; /** The connection surface the runner needs; `MongoConnection` satisfies it. */ export interface MigrationConnection { ensureConnection(): Promise; getDatabase(): Db; withTransaction(fn: (session: ClientSession) => Promise): Promise; } export interface MigrationRunnerOptions { /** Override the history collection name (default `_nl_migrations`). */ historyCollection?: string; } /** Compute a stable checksum for a migration from its explicit value or its source. */ export declare const migrationChecksum: (migration: Migration) => string; /** * Applies and reverts {@link Migration}s in declared order, recording each in the * `_nl_migrations` history collection. Mirrors the seeding architecture. Each * migration runs in a transaction when the topology supports it; otherwise the * runner warns and runs without one. */ export declare class MigrationRunner { private readonly connection; private readonly migrations; private readonly connectionName; private readonly logger; private readonly historyName; constructor(connection: MigrationConnection, migrations: Migration[], loggerFactory: LoggerFactory, connectionName?: string, options?: MigrationRunnerOptions); /** Apply every pending migration in order. Returns the names applied. */ up(): Promise; /** Revert the last `steps` applied migrations, most-recent first. Returns the names reverted. */ down(steps?: number): Promise; /** Report each migration's applied state and whether its checksum drifted. */ status(): Promise; private history; private loadApplied; private runReversible; } //# sourceMappingURL=migration-runner.d.ts.map