I've created a repository using Pinia with the following implementation:
export const useLanguage = defineStore<string, { current: string }>({
id: 'language',
state: () => ({
current: 'en',
}),
getters: {
currentLanguage: (state): ILanguage =>
supportedLanguages.get(state.current) as ILanguage,
},
persist: true,
})
This is how I try to access and use the reactive getter:
const { currentLanguage } = storeToRefs(useLanguage())
However, TypeScript and WebStorm give an error stating that the property does not exist:
Volar: Property 'currentLanguage' does not exist on type 'StoreToRefs >'.
It's possible that the issue lies within the Vite configuration settings.
I'm a bit puzzled, could someone point me in the right direction?
Even though the code works when executed, I still desire IntelliSense support.