import { ObjectWithId } from '@naturalcycles/js-lib';
import type { CommonDB } from '../common.db';
import { CommonDBOptions, CommonDBSaveOptions, DBTransaction } from '../db.model';
/**
 * Optimizes the Transaction (list of DBOperations) to do less operations.
 * E.g if you save id1 first and then delete it - this function will turn it into a no-op (self-eliminate).
 * UPD: actually, it will only keep delete, but remove previous ops.
 *
 * Currently only takes into account SaveBatch and DeleteByIds ops.
 * Output ops are maximum 1 per entity - save or delete.
 */
/**
 * Naive implementation of "Transaction" which just executes all operations one-by-one.
 * Does NOT actually implement a Transaction, cause partial ops application will happen
 * in case of an error in the middle.
 */
/**
 * Fake implementation of DBTransactionContext,
 * which executes all operations instantly, without any Transaction involved.
 */
export declare class FakeDBTransaction implements DBTransaction {
    protected db: CommonDB;
    constructor(db: CommonDB);
    rollback(): Promise<void>;
    getByIds<ROW extends ObjectWithId>(table: string, ids: string[], opt?: CommonDBOptions): Promise<ROW[]>;
    saveBatch<ROW extends ObjectWithId>(table: string, rows: ROW[], opt?: CommonDBSaveOptions<ROW>): Promise<void>;
    deleteByIds(table: string, ids: string[], opt?: CommonDBOptions): Promise<number>;
}
