import { Transaction as LMDBNativeTransaction } from 'lmdb';
import { DatabaseTransaction, type CommitOptions, type TransactionWrite, type CommitResolution } from './DatabaseTransaction';
import { Transaction as RocksTransaction } from '@harperfast/rocksdb-js';
import type { RootDatabaseKind } from './databases.ts';
export declare const TRANSACTION_STATE: {
    CLOSED: number;
    OPEN: number;
    LINGERING: number;
};
export declare function replicationConfirmation(callback: any): void;
type ReadTransaction = LMDBNativeTransaction & {
    openTimer?: number;
    retryRisk?: number;
};
export declare class LMDBTransaction extends DatabaseTransaction {
    #private;
    writes: TransactionWrite[];
    validated: number;
    _timestamp: number;
    next: DatabaseTransaction;
    stale: boolean;
    overloadChecked: boolean;
    open: number;
    getReadTxn(): ReadTransaction;
    useReadTxn(): (LMDBNativeTransaction | RocksTransaction) & {
        openTimer?: number;
        retryRisk?: number;
    };
    doneReadTxn(): void;
    disregardReadTxn(): void;
    addWrite(operation: TransactionWrite): Promise<CommitResolution>;
    removeWrite(operation: TransactionWrite): void;
    /**
     * Resolves with information on the timestamp and success of the commit
     */
    commit(options?: CommitOptions): Promise<CommitResolution>;
    abort(): void;
    save(): void;
}
export declare class ImmediateTransaction extends LMDBTransaction {
    constructor(db: RootDatabaseKind);
    save(_transaction: ImmediateTransaction, _isRetry?: boolean): Promise<CommitResolution>;
    get timestamp(): number;
    getReadTxn(): void;
}
export declare function setTxnExpiration(ms: any): Set<DatabaseTransaction>;
export {};
