import { Subject } from 'rxjs'; import { IStore, IState, IAction, StateChange, Reducer, StoreFactory, } from './types'; export * from './types'; export interface IReducerItem { reducer: Reducer; actionType?: string; } export type IReducerItems = Array< IReducerItem >; export interface IData { key?: string; // Used to identify a child or dictionary-child store. reducers: IReducerItems; children: IChildStore[]; childDictionaries: IDictionaryStore[]; parent?: StoreInternal; current: S; state$: Subject>; context?: any; } export type StoreInternal = IStore< S, A > & { data: IData; }; export interface IChildStore { path: string; store: StoreInternal; } export interface IDictionaryStore { path: string; factory: StoreFactory; items: IChildStore[]; isPersistent: boolean; // Flag indicating if the object should be removed from the state tree if all children are removed. }