import { MutationTree , ActionTree , Module , GetterTree } from 'vuex' ; import { State as RootState } from '../index' ; import { namespaced , register as commonRegister , State as CommonState , state as commonState , mutations as commonMutations , getters as commonGetters , } from '@/stores/modules/template' ; import { moduleHelper } from '@/stores' ; import debug from '@/functions/debug' ; import { presetInvoker } from '@/functions' ; export const register = { ... commonRegister , } ; const state = { ... commonState , } ; const mutations = { ... commonMutations , } ; const webActions = { } ; const ipcActions = { } ; const actions = { ... ( TARGET_BROWSER === 'web' ? webActions : ipcActions ) , init : ( ) => { } , } ; const getters = { ... commonGetters , sourceLayout : ( state , getters , RootState ) : LayoutPreset => { const { layouts , sourceLayouts } = state ; const { translation : { source } } = RootState ; const id = sourceLayouts [ source . id ] [ 1 ] ; return presetInvoker ( id , layouts ) [ 1 ] as LayoutPreset ; } , } ; export const template = { namespaced , state , actions , mutations , getters , } ; export default moduleHelper ( template , register ) ; type C = DefaultConfig ; export interface State extends CommonState { test ? : boolean ; }