/// <reference types="node" />
/// <reference types="@adonisjs/application/build/adonis-typings" />
declare module '@ioc:Adonis/Lucid/Migrator' {
    import { EventEmitter } from 'events';
    import { ApplicationContract } from '@ioc:Adonis/Core/Application';
    import { FileNode, DatabaseContract } from '@ioc:Adonis/Lucid/Database';
    /**
     * Options accepted by migrator constructor
     */
    export type MigratorOptions = {
        direction: 'up';
        connectionName?: string;
        dryRun?: boolean;
        disableLocks?: boolean;
    } | {
        direction: 'down';
        batch?: number;
        connectionName?: string;
        dryRun?: boolean;
        disableLocks?: boolean;
    };
    /**
     * Shape of migrated file within migrator
     */
    export type MigratedFileNode = {
        status: 'completed' | 'error' | 'pending';
        queries: string[];
        file: FileNode<unknown>;
        batch: number;
    };
    /**
     * Shape of migrated file within migrator
     */
    export type MigrationListNode = {
        name: string;
        status: 'pending' | 'migrated' | 'corrupt';
        batch?: number;
        migrationTime?: Date;
    };
    /**
     * Shape of the migrator
     */
    export interface MigratorContract extends EventEmitter {
        dryRun: boolean;
        disableLocks: boolean;
        version: number;
        direction: 'up' | 'down';
        status: 'completed' | 'skipped' | 'pending' | 'error';
        error: null | Error;
        migratedFiles: {
            [file: string]: MigratedFileNode;
        };
        run(): Promise<void>;
        getList(): Promise<MigrationListNode[]>;
        close(): Promise<void>;
        on(event: 'start', callback: () => void): this;
        on(event: 'end', callback: () => void): this;
        on(event: 'acquire:lock', callback: () => void): this;
        on(event: 'release:lock', callback: () => void): this;
        on(event: 'create:schema:table', callback: () => void): this;
        on(event: 'create:schema_versions:table', callback: () => void): this;
        on(event: 'upgrade:version', callback: (payload: {
            from: number;
            to: number;
        }) => void): this;
        on(event: 'migration:start', callback: (file: MigratedFileNode) => void): this;
        on(event: 'migration:completed', callback: (file: MigratedFileNode) => void): this;
        on(event: 'migration:error', callback: (file: MigratedFileNode) => void): this;
    }
    /**
     * Migrator class constructor
     */
    const Migrator: {
        new (db: DatabaseContract, app: ApplicationContract, options: MigratorOptions): MigratorContract;
    };
    export default Migrator;
}
