Unfortunately this does not work at all. Intellisense does note recognize $store property.
Here is what I tried:
declare module "@vue/runtime-core" {
// declare your own store states
interface State {
count: number;
}
// provide typings for `this.$store`
interface ComponentCustomProperties {
$store: Store<State>;
}
}
I managed to make a workaround for that (which also does not work as expected, but at least somehow). I added following to a global d.ts file:
declare module "vue-class-component" {
interface Vue {
$store: Store<State>;
}
}```
The problem with that is, that intellisense does not recognize `$store` property, but after I type it manually it manages to show all `Store` properties and methods.
Looking at Vue.js guide for augumenting types (https://v3.vuejs.org/guide/typescript-support.html#augmenting-types-for-globalproperties) I tried to add my own
$store
property to my Vue components typings.Unfortunately this does not work at all. Intellisense does note recognize
$store
property.Here is what I tried:
I managed to make a workaround for that (which also does not work as expected, but at least somehow). I added following to a global
d.ts
file: