import type { SyncTransactionResult } from '../../kernel/types.js'; import type { SyncEngine } from './sync.js'; import type { Vault } from '../../kernel/vault.js'; /** * Sync transaction. * * Stages local writes and then pushes only those records to remote in a * single batch. If any record conflicts during the push, the result * carries `status: 'conflict'` — no automatic rollback is performed; * the caller handles conflict resolution. * * Obtain via `db.transaction(compartmentName)`. */ export declare class SyncTransaction { private readonly comp; private readonly engine; private readonly ops; /** @internal — constructed by `Noydb.transaction()` */ constructor(comp: Vault, engine: SyncEngine); /** Stage a record write. Does not write to any adapter until `commit()`. */ put(collection: string, id: string, record: unknown): this; /** Stage a record delete. Does not write to any adapter until `commit()`. */ delete(collection: string, id: string): this; /** * Commit the transaction. * * Phase 1 — writes all staged operations to the local adapter via the * collection layer (encryption + dirty-log tracking). * * Phase 2 — pushes only the records that were written in this * transaction to the remote adapter. Existing dirty entries from * outside this transaction are not affected. * * If any record conflicts during the push, `status` is `'conflict'` * and `conflicts` lists the affected records. No automatic rollback is * performed. */ commit(): Promise; }