import { ErrorInterface, SuccessInterface } from "../../config/Interfaces/Helper/response.helper.interface"; export default class Transaction { private readonly collectionPath; private readonly transactionId; private operations; private readonly WAL; private readonly LockManager; private readonly Registry; private readonly IndexManager; private readonly ResponseHelper; private readonly Converter; private readonly FileManager; private readonly startTime; private readonly timeoutMs; private lockedDocuments; private savepoints; private pendingWALEntries; private resolvedOperations; constructor(collectionPath: string); /** * Creates a savepoint at the current state of the transaction. * Allows partial rollback to this point using rollbackTo(). * * @param name - Unique name for the savepoint * @returns The Transaction instance for chaining * @throws Error if savepoint name already exists */ savepoint(name: string): Transaction; /** * Rolls back the transaction to a specific savepoint. * All operations after the savepoint are discarded. * * @param name - Name of the savepoint to rollback to * @returns The Transaction instance for chaining * @throws Error if savepoint doesn't exist */ rollbackTo(name: string): Transaction; /** * Releases a savepoint without rolling back. * The savepoint is removed but operations remain. * * @param name - Name of the savepoint to release * @returns The Transaction instance for chaining */ releaseSavepoint(name: string): Transaction; insert(data: object): Transaction; update(query: object, data: object): Transaction; delete(query: object): Transaction; commit(): Promise; rollback(): Promise; private resolveAndLockDocuments; private executeOperations; private applyChanges; static recoverTransactions(collectionPath: string): Promise; private static listWALFiles; }