import _Vue, { WatchOptions } from "vue";
// augment typings of Vue.js
import "./vue";
import { mapState, mapMutations, mapGetters, mapActions, createNamespacedHelpers } from "./helpers";
export * from "./helpers";
export declare class Store {
constructor(options: StoreOptions);
readonly state: S;
readonly getters: any;
replaceState(state: S): void;
dispatch: Dispatch;
commit: Commit;
subscribe
(fn: (mutation: P, state: S) => any): () => void; subscribeAction
(fn: SubscribeActionOptions
): () => void;
watch (payloadWithType: P, options?: DispatchOptions): Promise (payloadWithType: P, options?: CommitOptions): void;
}
export interface ActionContext = (action: P, state: S) => any;
export interface ActionSubscribersObject {
before?: ActionSubscriber ;
after?: ActionSubscriber ;
}
export type SubscribeActionOptions = ActionSubscriber | ActionSubscribersObject ;
export interface DispatchOptions {
root?: boolean;
}
export interface CommitOptions {
silent?: boolean;
root?: boolean;
}
export interface StoreOptions;
mutations?: MutationTree;
getters?: GetterTree;
modules?: ModuleTree;
}): void;
}
export declare function install(Vue: typeof _Vue): void;
export interface Dispatch {
(type: string, payload?: any, options?: DispatchOptions): Promise {
dispatch: Dispatch;
commit: Commit;
state: S;
getters: any;
rootState: R;
rootGetters: any;
}
export interface Payload {
type: string;
}
export interface MutationPayload extends Payload {
payload: any;
}
export interface ActionPayload extends Payload {
payload: any;
}
export type ActionSubscriber {
state?: S | (() => S);
getters?: GetterTree;
actions?: ActionTree;
mutations?: MutationTree;
modules?: ModuleTree;
plugins?: Plugin[];
strict?: boolean;
}
export type ActionHandler = (this: Store, payload?: any) => any;
export interface ActionObject {
root?: boolean;
handler: ActionHandler;
}
export type Getter = (state: S, getters: any, rootState: R, rootGetters: any) => any;
export type Action = ActionHandler | ActionObject;
export type Mutation = (state: S, payload?: any) => any;
export type Plugin = (store: Store) => any;
export interface Module {
namespaced?: boolean;
state?: S | (() => S);
getters?: GetterTree;
actions?: ActionTree;
mutations?: MutationTree;
modules?: ModuleTree {
[key: string]: Getter;
}
export interface ActionTree {
[key: string]: Action;
}
export interface MutationTree {
[key: string]: Mutation;
}
export interface ModuleTree