import { Transaction } from './component/transaction.js';
import { Database } from './component/database.js';
export type MigrationVersion = number;
export interface MigrationInterface {
    version: MigrationVersion;
    migration: (migrationCtx: {
        db: Database;
        transaction: Transaction;
        dbOldVersion: number;
        dbNewVersion: number;
        migrationVersion: MigrationVersion;
    }) => Promise<void>;
}
export type OnBlocked = (ctx: {
    oldVersion: number;
    newVersion: number;
}) => Promise<Error | string>;
export declare class DatabaseFactory {
    private static _factory;
    private static readonly factory;
    static cmp<T>(a: T, b: T): number;
    static databases(): Promise<IDBDatabaseInfo[]>;
    static deleteDatabase(name: string): Promise<void>;
    static open(name: string, version?: number, migrations?: MigrationInterface[], onBlocked?: OnBlocked): Promise<Database>;
}
