import { IDBPDatabase } from 'idb';
import { BaseDto, DtoClass } from './DBAccess';
export interface TransactionEntry<T> {
    onExecute: () => Promise<T | T[] | undefined>;
    onGetPostTransactionState?: () => Promise<T | undefined>;
}
export declare class Transaction {
    entries: TransactionEntry<BaseDto>[];
    entityNames: Set<string>;
    completeEntries: TransactionEntry<BaseDto>[];
    constructor();
    addEntry<T extends BaseDto>(entry: TransactionEntry<T>): void;
    hasNextEntry(): boolean;
    getNextEntry(): TransactionEntry<BaseDto>;
    addEntity(name: string): void;
}
export declare class TransactionManager {
    db: IDBPDatabase | undefined;
    initPromise: Promise<void> | undefined;
    private stores;
    constructor();
    addObjectStore(objectStoreName: string): void;
    init(dbName: string): Promise<void>;
    deleteDB(dbName: string): Promise<void>;
    private dataChangeListeners;
    private transactionSemaphore;
    lock(): Promise<void>;
    unlock(): void;
    runTransaction(callback: (dbtransaction: Transaction, wait: CallableFunction) => Promise<Promise<any> | void>): Promise<void>;
    addDataChangeListener(listener: (data: BaseDto) => void, type: DtoClass): Promise<void>;
}
//# sourceMappingURL=Transaction.d.ts.map