interface UserState { authenticationInvoked : boolean ; isLoggedIn : boolean ; username : string | null ; avatar : string | null ; isVerified : boolean ; } const state = { authenticationInvoked : false , isLoggedIn : false , username : null , avatar : null , isVerified : false } ; const getters = { getAuthenticationInvokedStatus ( ) { return state . authenticationInvoked ; } , getUsername ( ) { return state . username ; } , getLoginStatus ( ) { return state . isLoggedIn ; } , getAvatar ( ) { return state . avatar ; } , getEmailVerifiedStatus ( ) { return state . isVerified ; } } ; const actions = { updateAuthenticationInvokedStatus ( { commit } , isInvoked ) { commit ( 'mutateAuthenticationInvokedStatus' , isInvoked ) ; } , updateUsername ( { commit } , username ) { commit ( 'mutateUsername' , username ) ; } , updateLoginStatus ( { commit } , status ) { commit ( 'mutateLoginStatus' , status ) ; } , updateAvatar ( { commit } , avatar ) { commit ( 'mutateAvatar' , avatar ) ; } , updateEmailVerifiedStatus ( { commit } , status ) { commit ( 'mutateEmailVerifiedStatus' , status ) ; } } ; const mutations = { mutateAuthenticationInvokedStatus ( state , isInvoked ) { state . authenticationInvoked = isInvoked ; } , mutateUsername ( state , username ) { state . username = username ; } , mutateLoginStatus ( state , status ) { state . isLoggedIn = status ; } , mutateAvatar ( state , avatar ) { state . avatar = avatar ; } , mutateEmailVerifiedStatus ( state , status ) { state . isVerified = status ; } , } ; export default { state , getters , actions , mutations } ;