declare namespace Vuex {
class Store {
constructor(options: StoreOption);
state: S;
dispatch(mutationName: string, ...args: any[]): void;
dispatch
(mutation: MutationObject
): void;
replaceState(state: S): void;
watch {
type: string;
silent?: boolean;
payload?: P;
}
interface Module, cb: (value: T) => void, options?: WatchOption): void;
hotUpdate(options: {
mutations?: MutationTree;
modules?: ModuleTree;
}): void;
subscribe(cb: (mutation: MutationObject {
state?: S;
mutations?: MutationTree;
modules?: ModuleTree;
plugins?: Plugin[];
strict?: boolean;
}
type Getter = (state: S) => T;
type Action = (store: Store, ...args: any[]) => any;
type Mutation = (state: S, ...args: any[]) => void;
type Plugin = (store: Store) => void;
interface MutationTree {
[key: string]: Mutation;
}
interface MutationObject {
state?: S;
mutations?: MutationTree;
modules?: ModuleTree;
}
interface ModuleTree {
[key: string]: Module {
getters: { [key: string]: Getter };
actions: { [key: string]: Action };
}
interface WatchOption {
deep?: boolean;
immidiate?: boolean;
}
function createLogger(option: LoggerOption): Plugin;
interface LoggerOption {
collapsed?: boolean;
transformer?: (state: S) => any;
mutationTransformer?: (mutation: MutationObject