import { StateCreator } from '../../types'; import { SyncContext } from '../sync/syncEnhancer'; type WrappedOnRehydrateStorage = (userCallback: ((state: S) => ((finalState?: S, error?: unknown) => void) | void) | undefined, syncContext: SyncContext | undefined) => (state: S) => (finalState?: S, error?: unknown) => void; /** * Creates hydration-gating middleware that queues state updates until rehydration completes. * * **Before hydration**: Queues all `set()` calls and flushes them sequentially after rehydration. * * **After hydration**: Passes `set()` calls through synchronously without batching. * * This ensures persistence sees a fully rehydrated base state before applying queued updates, * while keeping in-memory state changes synchronous post-hydration. */ export declare function createHydrationGate(stateCreator: StateCreator): { hydrationPromise: () => Promise; stateCreator: StateCreator; wrapOnRehydrateStorage: WrappedOnRehydrateStorage; }; export {}; //# sourceMappingURL=createHydrationGate.d.ts.map