import EventEmitter = require('eventemitter3');
import { Action } from './action';
export declare namespace Store {
class StoreBase {
state: A;
protected emitter: EventEmitter;
onChange(handler: Function): void;
}
class Store extends StoreBase {
removeChangeHandler(handler: Function): void;
}
class SingleStore extends Store {
constructor(store: PartialStore);
private updateState(nextState);
}
class CompoundStore extends Store {
constructor(stores: {
[key: string]: PartialStore;
});
private extractStoreEntries(stores);
private extractInitialState(entries);
private subscribeChildStoresChange(entries);
private subscribe(store, stateKey);
private updateState(nextState, key);
}
class PartialStore extends StoreBase {
constructor(initialState: A);
subscribe(action: Action.ActionWrapper, transformState: (prevState: A, payload?: B) => A): PartialStore;
onChange(handler: (nextState: A) => any): void;
private updateState(nextState);
}
function create(store: PartialStore): SingleStore;
function combine(stores: {
[key: string]: PartialStore;
}): CompoundStore;
function partial(initialState: A): PartialStore;
}