import { MutationTree , ActionTree , Module , GetterTree } from 'vuex' ; import { State as RootState } from '@/stores/index' ; import { update , clear } from '@/stores/mutations' ; export const namespaced = true ; export const register = { template_source_layouts : 'sourceLayouts' , template_crawler_layouts : 'crawlerLayouts' , template_enabled_layouts : 'enabledLayouts' , template_layouts : 'layouts' , } ; export const state = { sourceLayouts : { nil : [ 'nil' , 'nil' ] , } , crawlerLayouts : { } , enabledLayouts : [ ] , layouts : [ JSON . stringify ( { id : 'nil' , rows : [ ] } as LayoutPreset ) ] , } ; export const mutations = { update , clear } ; export const webActions = { } ; export const ipcActions = { } ; export const actions = { ... ( TARGET_BROWSER === 'web' ? webActions : ipcActions ) , } ; export const getters = { } ; export const template = { namespaced , state , actions , mutations , getters , } ; export default template ; type C = DefaultConfig ; export interface State { sourceLayouts : C [ 'template_source_layouts' ] ; crawlerLayouts : C [ 'template_crawler_layouts' ] ; enabledLayouts : C [ 'template_enabled_layouts' ] ; layouts : C [ 'template_layouts' ] ; }