import { Observable, Subscription } from "rxjs"; import { Broker } from "./broker"; import { Reducer } from "./reducer"; import { CQRS } from "./main"; import { Settlement } from "./interface/store.interface"; /** * Split of writing functionality * Focus on reading repositories * * Store doesn't depend on any one. * */ export declare class Store extends Broker { static isStoreCreated: boolean; _storeId: string; private subscriptionMap; private subscription; private _CQRS; private _reducers; private _withRelation$; get withRelation(): initialState; get withRelation$(): Observable; get reducers(): Reducers; private _state$; get state$(): Observable; get state(): initialState; private _settlement$; get settlement$(): Observable; constructor(); private _storeInitial; setCQRS(cqrs: CQRS): void; setInitial(reducers: Reducers, initialState: initialState): void; addReducer(reducer: Reducer): void; subscribe(next?: (state: initialState) => void, error?: (error: any) => void, complete?: () => void): Subscription; /** * 如果直接 cloneDeep(Store) 的話,每次更新都要重新綁全部的邏輯 * 所以根據 settlement 的結果修正 RelationStore中的 state * 然後只重新綁訂有更新部分的關係,以達到最小消耗 */ private buildRelationStore; } export declare const settlementToObject: () => import("rxjs").UnaryFunction, Observable>;