import { ConnectOptions, Connection, Model, HydratedDocument } from 'mongoose';

interface MigrationFile {
    filename: string;
    createdAt: Date;
    existsInDatabase: boolean;
}
interface Migration {
    name: string;
    filename: string;
    state: 'down' | 'up';
    createdAt: Date;
    updatedAt: Date;
}
interface ConfigOptionsDefault {
    default?: ConfigOptions;
}
interface MigrationFunctions {
    up?: (connection: Connection) => Promise<void>;
    down?: (connection: Connection) => Promise<void>;
}
interface MigrationFunctionsDefault {
    default?: MigrationFunctions;
}
interface CommonOptions {
    connectOptions?: ConnectOptions;
    migrationsPath?: string;
    templatePath?: string;
    collection?: string;
    autosync?: boolean;
}
interface ConfigOptions extends CommonOptions {
    uri?: string;
    configPath?: string;
    mode?: string;
}
interface MigratorOptions extends CommonOptions {
    uri: string;
    cli?: boolean;
}
declare enum Env {
    MIGRATE_CONFIG_PATH = "MIGRATE_CONFIG_PATH",
    MIGRATE_MONGO_COLLECTION = "MIGRATE_MONGO_COLLECTION",
    MIGRATE_MIGRATIONS_PATH = "MIGRATE_MIGRATIONS_PATH",
    MIGRATE_AUTOSYNC = "MIGRATE_AUTOSYNC",
    MIGRATE_CLI = "MIGRATE_CLI",
    MIGRATE_MODE = "MIGRATE_MODE",
    MIGRATE_MONGO_URI = "MIGRATE_MONGO_URI",
    MIGRATE_TEMPLATE_PATH = "MIGRATE_TEMPLATE_PATH"
}

declare class Migrator {
    readonly migrationModel: Model<Migration>;
    readonly connection: Connection;
    private readonly uri?;
    private readonly template;
    private readonly migrationsPath;
    private readonly collection;
    private readonly autosync;
    private readonly cli;
    private constructor();
    static connect(options: MigratorOptions): Promise<Migrator>;
    close(): Promise<void>;
    list(): Promise<HydratedDocument<Migration>[]>;
    create(migrationName: string): Promise<HydratedDocument<Migration>>;
    run(direction: 'up' | 'down', migrationName?: string, single?: boolean): Promise<HydratedDocument<Migration>[]>;
    private findUntilMigration;
    private collectMigrationsToRun;
    sync(): Promise<HydratedDocument<Migration>[]>;
    prune(): Promise<HydratedDocument<Migration>[]>;
    private noPendingMigrations;
    private log;
    private logMigrationStatus;
    private getTemplate;
    private ensureMigrationsPath;
    private connected;
    private syncMigrations;
    private getMigrations;
    private choseMigrations;
    private runMigrations;
}

export { Env, Migrator };
export type { ConfigOptions, ConfigOptionsDefault, Migration, MigrationFile, MigrationFunctions, MigrationFunctionsDefault, MigratorOptions };
//# sourceMappingURL=index.d.cts.map
