import type { Observable, Subscription } from 'rxjs'; import type { AnyAction } from '../action-bus'; import { ActionBus } from '../action-bus'; import type { AnyActionReducer, Effect, IStore } from './store.types'; /** * `Store` provides the state container and facilitates effects & reducers upon state. * * @param initialState The initial state intended for the store. */ export declare class Store extends ActionBus implements IStore { readonly initialState: StateType; constructor(initialState: StateType); /** * Current state subject at any given time. */ private readonly subject$; /** * A clone of the action$ that emits only once the state has been updated. * Used for effects to guarantee the order of operations. */ private readonly internalReducedAction$; private readonly internalReducer$; /** * Registers a new reducer to the store. * * @param reducer The reducer that gets registered to the store. */ registerReducer: (reducer: AnyActionReducer) => void; registerEffect: (effect: Effect) => Subscription; /** * Synchronous getter for current state. Use `state$` when possible. * * @return Current state */ get state(): StateType; /** * Getter for the state observable * * @return The state observable */ get state$(): Observable; get reducer$(): Observable>; /** * Registers a new effect to the store. * * @param effect The effect to register. * @return A subscription. Unsubscribe to the subscription to stop the effect from listening */ get reducedAction$(): Observable; }