/*! * Copyright (c) 2026 Interop Alliance. All rights reserved. */ /** * The hydration MECHANISM: the per-collection re-hydrate hooks (decrypt the * localStore rows into the app's stores) plus the debounced remote-change * scheduler used by every sync entry point. Generic over an injected * {@link StoreRegistry} -- the app supplies the concrete per-collection * handlers; nothing here knows the domain entities. */ import type { Json } from '../sync/index.js'; import type { StoreRegistry } from '../config.js'; /** * Hydrates every registered store from the (already opened) localStore. * * @param registry {StoreRegistry} * @returns {Promise} */ export declare function hydrateAll(registry: StoreRegistry): Promise; /** * Empties every registered store (logout). * * @param registry {StoreRegistry} * @returns {void} */ export declare function clearAllEntityStores(registry: StoreRegistry): void; /** * Patches ONE store from a single RxDB change event (per-doc, no whole-collection * re-hydrate): decrypt the changed envelope, then upsert the payload (INSERT / * UPDATE, including conflict-resolved rows) or drop it (DELETE / tombstone). The * `uuid -> envelopeId` index is kept in step so a later local edit of a * remotely-created doc still finds its envelope. Falls back to a debounced * whole-collection re-hydrate if the envelope is missing or fails to decrypt. * * @param registry {StoreRegistry} * @param collectionKey {string} * @param event {object} an RxDB change event (operation + documentData) * @returns {Promise} */ export declare function patchFromChange(registry: StoreRegistry, collectionKey: string, event: { operation: string; documentData?: { id: string; data?: Json; _deleted?: boolean; }; }): Promise; /** * Schedules a debounced re-hydrate of one collection's store after a pull. * * @param registry {StoreRegistry} * @param collectionKey {string} * @returns {void} */ export declare function scheduleRehydrate(registry: StoreRegistry, collectionKey: string): void; /** * Cancels every pending debounced re-hydrate. Called on logout so a timer that * fires after the LocalStore is torn down does not reach a `requireStore()` that * throws (an unhandled rejection). * * @returns {void} */ export declare function cancelScheduledRehydrates(): void; //# sourceMappingURL=rehydrate.d.ts.map