import { $REFRESH } from "../core/index.js"; import { type NoFn, type ProjectionOptions, type Store, type StoreSetter } from "./store.js"; /** * Creates an optimistic store that can be used to optimistically update a value * and then revert it back to the previous value at end of transition. * * When called with a plain value, creates an optimistic store. * When called with a function, creates a derived optimistic store with `ProjectionOptions` (name, key, all). * * @param fn a function that receives the current store and can be used to mutate it directly inside a transition * @param initial The initial value of the store. * @param options Optional projection options for reconciliation. * * @returns A tuple containing a store accessor and a setter function to apply changes. */ export declare function createOptimisticStore(store: NoFn | Store>): [get: Store, set: StoreSetter]; export declare function createOptimisticStore(fn: (store: T) => void | T | Promise | AsyncIterable, store?: NoFn | Store>, options?: ProjectionOptions): [get: Store & { [$REFRESH]: any; }, set: StoreSetter];