import { Observable } from 'rxjs'; export type WithPreviousState = T & { __previousState: T; }; /** * BaseStore class to manage state in a unified location */ export declare abstract class BaseStore { private __state; private __hasDestroyed; /** * Must be overridden. Takes in an initial state. * * @param initialState state to start store with */ protected constructor(initialState: T); /** * Get the state as an observable */ getState$(): Observable>; /** * Get the state synchonously */ getState(): WithPreviousState; /** * Destory the state and call `.complete()` on * the state's underlying observable * * _NOTE: once this is called, the store cannot_ * _be reused_ */ destroy(): void; /** * Check to see if the store has been destroyed. * If it has been, it can no longer be used. */ hasDestroyed(): boolean; /** * Change part of the state to the passed in value. * * This will create a shallow copy of the current state * and set all properties of the new passed in state * using the spread operator. * * Throws an error if called when the store has already * been destroyed (using `.destroy()`). * * @param state partial state to change */ protected dispatch(state: Partial): void; /** * @deprecated use `dispatch` instead */ protected _dispatch(state: Partial): void; }