fantasia-archive/src/store/index.ts

52 lines
1.5 KiB
TypeScript
Raw Normal View History

2021-01-31 02:43:13 +13:00
import { BlueprintStateInterface } from "./module-blueprints/state"
import { store } from "quasar/wrappers"
import Vuex from "vuex"
// import example from './module-example';
// import { ExampleStateInterface } from './module-example/state';
import blueprintsModule from "./module-blueprints"
import openedDocumentsModule from "./module-openedDocuments"
import allDocumentsModule from "./module-allDocuments"
import keybindsModule from "./module-keybinds"
2021-02-26 14:50:46 +13:00
import dialogsModule from "./module-dialogs"
2021-03-18 10:26:08 +13:00
import optionsModule from "./module-options"
import floatingWindowsModule from "./module-floatingWindows"
import projectModule from "./module-project"
2021-01-31 02:43:13 +13:00
/*
* If not building with SSR mode, you can
* directly export the Store instantiation
*/
export interface StateInterface {
// Define your own store structure, using submodules if needed
// example: ExampleStateInterface;
// Declared as unknown to avoid linting issue. Best to strongly type as per the line above.
blueprintsModule: BlueprintStateInterface;
}
export default store(function ({ Vue }) {
Vue.use(Vuex)
const Store = new Vuex.Store<StateInterface>({
modules: {
blueprintsModule,
openedDocumentsModule,
allDocumentsModule,
2021-02-26 14:50:46 +13:00
keybindsModule,
2021-03-18 10:26:08 +13:00
dialogsModule,
optionsModule,
floatingWindowsModule,
projectModule
2021-01-31 02:43:13 +13:00
// example
},
// enable strict mode (adds overhead!)
// for dev mode only
strict: !!process.env.DEBUGGING
})
return Store
})