Skip to content

Commit

Permalink
Follow guidance for typing
Browse files Browse the repository at this point in the history
  • Loading branch information
cefn committed Jan 30, 2022
1 parent 389c5ed commit e5ce11b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/shims-vue.d.ts
@@ -1,4 +1,12 @@
import type { HelloStore } from "./store";

declare module "*.vue" {
import Vue from "vue";
export default Vue;
}

declare module "@vue/runtime-core" {
interface ComponentCustomProperties {
$store: HelloStore;
}
}
6 changes: 5 additions & 1 deletion src/store/index.ts
Expand Up @@ -11,9 +11,13 @@ const state: RootState = {
message: "olleH",
};

export default new Vuex.Store({
const store = new Vuex.Store({
state,
mutations: {},
actions: {},
modules: {},
});

export type HelloStore = typeof store;

export default store;

0 comments on commit e5ce11b

Please sign in to comment.