///
import { EventEmitter } from 'events';
import { Middleware, Store } from 'redux';
import { ProxyReducer, RepoSnapshot, Snapshot } from './types';
/**
* A StoreManager generates a Redux store with persistence (via the Repo class), networking (via
* @localfirst/relay-client), and magical synchronization with peers (via automerge)
*/
export declare class StoreManager extends EventEmitter {
private databaseName;
private proxyReducer;
private initialState;
private urls;
private middlewares;
private repo?;
private connectionManager?;
private collections;
private log;
store?: Store;
constructor({ databaseName, proxyReducer, initialState, urls, middlewares, collections, }: StoreManagerOptions);
joinStore: (discoveryKey: string) => Promise>;
createStore: (discoveryKey: string) => Promise>;
private getStore;
private createReduxStore;
get connectionCount(): number;
/**
* Close all connections and the repo's database
*/
close: () => Promise;
}
export interface StoreManagerOptions {
/** A proxy reducer that returns a ChangeMap (map of change functions) for each action. */
proxyReducer: ProxyReducer;
/** Redux middlewares to add to the store. */
middlewares?: Middleware[];
/** The starting state of a blank document. */
initialState: Snapshot | RepoSnapshot;
/** A name for the storage feed, to distinguish this application's data from any other
* @localfirst/state data stored on the same machine. */
databaseName: string;
/** The address(es) of one or more relays to try. */
urls?: string[];
/** The names of any collections that we need to manage */
collections?: string[];
}