/** * BlobSavingQueue - Queues resolved blobs for saving back to IndexedDB * * Uses setTimeout(fn, 0) instead of queueMicrotask to completely isolate * from Dexie's Promise.PSD context. This prevents the save operation * from inheriting any ongoing transaction. * * Each blob is saved atomically using downCore transaction with the specific * keyPath to avoid race conditions with other property changes. */ import { ResolvedBlob } from './blobResolve'; import { DexieCloudDB } from '../db/DexieCloudDB'; export declare class BlobSavingQueue { private queue; private isProcessing; private db; constructor(db: DexieCloudDB); /** * Queue a resolved blob for saving. * Only the specific blob property will be updated atomically. */ saveBlobs(tableName: string, primaryKey: any, resolvedBlobs: ResolvedBlob[]): void; /** * Start the consumer if not already processing. * Uses setTimeout(fn, 0) to completely break out of any * Dexie transaction context (Promise.PSD). */ private startConsumer; /** * Process all queued blobs. * Runs in a completely isolated context (no inherited transaction). * Uses atomic updates to avoid race conditions. */ private processQueue; }