UNPKG

@tanstack/db

Version:

A reactive client store for building super fast apps on sync

44 lines (43 loc) • 1.62 kB
import { BucketFacadeCompilation, ValueResolver } from './materialized-pipeline.js'; export type FacadePublication = { prepare: () => void; publish: () => void; rollback: () => void; }; /** * The only stateful boundary outside the materialization graph. It turns inert * bucket references into stable public Collection facades and applies the * graph's canonical bucket-row deltas to those facades. */ export declare class BucketFacadeAdapter { private readonly parentId; private readonly compilations; private readonly resolveRoot; private pending; private pendingActivity; private readonly activeBuckets; private readonly entries; private readonly retiredEntries; private resolvedValues; private cleanedUp; constructor(parentId: string, compilations: Array<BucketFacadeCompilation>, onMessages: (count: number) => void, resolveRoot: ValueResolver); hasPendingChanges(): boolean; flush(): FacadePublication; resolve<T>(value: T): T; cleanup(): void; private accumulate; private snapshot; /** Restore the facades, then discard their events even if restore throws. */ private abort; private restore; private accumulateActivity; private getActiveBuckets; private retireEntry; private getEntry; private applyChange; /** Resolve and validate every public key before opening a sync transaction. */ private prepareChange; private resolveValue; private readonly resolveFacade; } export declare function resolvePublicValue(value: unknown, resolveFacade: (value: unknown) => unknown): unknown;