import { InjectionKey } from "vue"; import { createStore, Store as VuexStore, useStore as baseUseStore, } from "vuex"; import generic, { State as GenericState, Store as GenericStore, } from "./modules/__generic_module"; import other, { State as OtherState, Store as OtherStore, } from "./modules/other_module"; // define tipos pro state da store export interface RootState { debitos: GenericState; /* other: OtherState; */ } export type RootStore = GenericStore>; // & OtherStore> & // define injection key export const key: InjectionKey> = Symbol(); export const store = createStore({ modules: { generic, // other }, }); // o usar `import useStore from '@store'` export default function useStore(): RootStore { return baseUseStore(key); }