/** @hidden */ /** */
import { ChangeHandler, IStore } from '../api/PluginModel';
export declare class Store<TState, TMsg> implements IStore<TState, TMsg> {
    readonly update: (cmd: TMsg, state: TState) => TState;
    private _state;
    private readonly _handlers;
    private _lastKey;
    private _debug;
    private _storeName;
    constructor(state: TState, update: (cmd: TMsg, state: TState) => TState, onChange?: ChangeHandler<TState>, debug?: boolean, stateName?: string);
    dispatch: (msg: TMsg) => void;
    get state(): TState;
    subscribe(onUpdate: ChangeHandler<TState>): () => void;
}
type CompositeMsg<T> = {
    type: keyof T;
    payload: any;
};
type InnerStoreMsg<TState, K extends keyof TState, TMsg extends CompositeMsg<TState>> = TMsg extends {
    type: K;
    payload: infer R;
} ? R : never;
export declare class CompositeStore<TState, TMsg extends CompositeMsg<TState>> implements IStore<TState, TMsg> {
    private readonly _index;
    private _dispose;
    private _onUpdateEvent;
    private _triggerUpdate;
    constructor(_index: {
        [P in keyof TState]: IStore<TState[P], InnerStoreMsg<TState, P, TMsg>>;
    });
    /** Replaces one or more of inner stores */
    replace(updated: Partial<{
        [P in keyof TState]: IStore<TState[P], InnerStoreMsg<TState, P, TMsg>>;
    }>): void;
    get state(): TState;
    dispatch(msg: TMsg): void;
    subscribe: (onUpdate: ChangeHandler<TState>) => (() => void);
}
export {};
