I am using pinia with nuxt and typescript to create stores.
This is code of auth store (with nuxt auth module) -
import { defineStore } from 'pinia';
export const useAuthStore = defineStore('authStore', {
getters: {
isAuthenticated(state) {
return state.$nuxt.$auth.loggedIn
}
}
})
Now the issue is, IDE gives typescript error -
Property '$nuxt' does not exist on type '{} and {}'. ts(2339)