import { GetterTree , MutationTree , ActionTree , ActionContext } from "vuex" ; export class State { count : number = 0 ; } const getters = < GetterTree < State , any > > { count ( state ) { return state . count ; } } ; const mutations = < MutationTree < State > > { inc ( state , amount ) { state . count += amount ; } , dec ( state ) { state . count -= 1 ; } } ; const actions = < ActionTree < State , any > > { inc ( store , amount ) { store . commit ( 'inc' , amount ) ; } , dec ( store ) { store . commit ( 'dec' ) ; } } ; export const counter = { state : new State ( ) , getters : getters , mutations : mutations , actions : actions } ;