import { Action, DomainContext, Equality, MutableStore, OnDispatch, Reducer, StoreMeta } from "../types"; /** * Creates a mutable store - the fundamental state container in FluxDom. * * A store encapsulates: * - State: The current value, updated via reducer * - Reducer: Pure function that computes new state from (state, action) * - Dispatch: Method to send actions (or thunks) to the store * - Subscriptions: onChange (state changes) and onDispatch (all actions) * * Key behaviors: * - State updates are synchronous and immediate * - Notifications can be batched via `batch()` for performance * - Equality checking prevents unnecessary notifications * - Domain actions are received and processed like store actions * * @template TState - Type of the store's state * @template TAction - Type of actions the store accepts directly * * @param name - Unique identifier for the store (used for debugging) * @param initial - Initial state value * @param reducer - Pure function: (state, action) => newState * @param domainContext - Context providing access to parent domain's dispatch/get * @param notifyParent - Callback to bubble dispatch events to parent domain * @param equals - Equality strategy for detecting state changes (default: "strict") * * @returns A MutableStore instance with dispatch, getState, onChange, etc. * * @example * ```ts * const counterStore = createStore( * "counter", * 0, * (state, action) => { * switch (action.type) { * case "INCREMENT": return state + 1; * case "DECREMENT": return state - 1; * default: return state; * } * }, * domainContext * ); * ``` * * @internal - Use `domain.store()` instead for public API */ export declare function createStore(name: string, initial: TState, reducer: Reducer, domainContext: DomainContext, notifyParent?: OnDispatch, equals?: Equality, meta?: StoreMeta): MutableStore; //# sourceMappingURL=store.d.ts.map