import type { SubscribeListener } from "./subscribe.js"; import type { WithSnapshotContributes } from "./enhancers/with-snapshot.js"; import type { WithSubscribeContributes } from "./enhancers/with-subscribe.js"; export interface StoreCreateOptions { } export type StoreSubscriber = ( /** * Callback to be called when state changes. */ callback: SubscribeListener, /** * Whether to sync the callback with the current state. */ sync?: boolean, /** * @deprecated It is confusing, and makes TS type wrong in callback's `changes` argument. It will be removed in the next major version. */ selector?: (state: State) => object) => () => void; export interface VanillaStore { /** * The mutable state object, whose changes will trigger subscribers. */ mutate: State; /** * Restore to initial state. */ restore: (options?: RestoreOptions) => void; } export interface RestoreOptions { /** * Exclude some **top** keys from restoring. * * @since 0.2.5 */ exclude?: (keyof State)[]; } /** * Create a vanilla store. * * @param initState The initial state object. * @param options Options for creating the store. * * @since 0.2.0 */ export declare function createVanilla(initState: State, _options?: StoreCreateOptions): VanillaStore & WithSubscribeContributes & WithSnapshotContributes; export declare const create: typeof createVanilla; //# sourceMappingURL=create.d.ts.map