diff --git a/src/renderer/store/TimelineSpace/Contents/Search.js b/src/renderer/store/TimelineSpace/Contents/Search.js deleted file mode 100644 index 9bead2c5..00000000 --- a/src/renderer/store/TimelineSpace/Contents/Search.js +++ /dev/null @@ -1,19 +0,0 @@ -import Account from './Search/Account' -import Tag from './Search/Tag' -import Toots from './Search/Toots' - -const Search = { - namespaced: true, - modules: { Account, Tag, Toots }, - state: { - loading: false - }, - mutations: { - changeLoading (state, loading) { - state.loading = loading - } - }, - actions: {} -} - -export default Search diff --git a/src/renderer/store/TimelineSpace/Contents/Search.ts b/src/renderer/store/TimelineSpace/Contents/Search.ts new file mode 100644 index 00000000..228f5da0 --- /dev/null +++ b/src/renderer/store/TimelineSpace/Contents/Search.ts @@ -0,0 +1,35 @@ +import Account from './Search/Account' +import Tag from './Search/Tag' +import Toots from './Search/Toots' +import { Module, MutationTree } from 'vuex' +import { RootState } from '@/store' + +export interface SearchState { + loading: boolean +} + +export interface SearchModuleState extends SearchState { +} + +const state = (): SearchState => ({ + loading: false +}) + +export const MUTATION_TYPES = { + CHANGE_LOADING: 'changeLoading' +} + +const mutations: MutationTree = { + [MUTATION_TYPES.CHANGE_LOADING]: (state, loading: boolean) => { + state.loading = loading + } +} + +const Search: Module = { + namespaced: true, + modules: { Account, Tag, Toots }, + state: state, + mutations: mutations +} + +export default Search