diff options
author | Remy Raes <raes.remy@gmail.com> | 2022-10-02 22:35:14 +0200 |
---|---|---|
committer | Remy Raes <raes.remy@gmail.com> | 2022-10-02 22:35:14 +0200 |
commit | 7a5ce8683993d056b68b52bfb9b37d09b7e71d2b (patch) | |
tree | 1c2177e33eecaf49abebff70cd1b674cebdbe06b /src-vue/src | |
parent | 22a7bd16852498a95f9733e228e126a644b9c3ed (diff) | |
download | FlightCore-7a5ce8683993d056b68b52bfb9b37d09b7e71d2b.tar.gz FlightCore-7a5ce8683993d056b68b52bfb9b37d09b7e71d2b.zip |
fix: store is now typed
Diffstat (limited to 'src-vue/src')
-rw-r--r-- | src-vue/src/components/PlayButton.vue | 5 | ||||
-rw-r--r-- | src-vue/src/plugins/store.ts | 15 | ||||
-rw-r--r-- | src-vue/src/views/DeveloperView.vue | 6 | ||||
-rw-r--r-- | src-vue/src/vuex-shim.d.ts | 8 |
4 files changed, 30 insertions, 4 deletions
diff --git a/src-vue/src/components/PlayButton.vue b/src-vue/src/components/PlayButton.vue index d3176d87..1b0dbc77 100644 --- a/src-vue/src/components/PlayButton.vue +++ b/src-vue/src/components/PlayButton.vue @@ -1,8 +1,9 @@ <script lang="ts"> +import { defineComponent } from 'vue'; import { NorthstarState } from '../utils/NorthstarState'; import { ReleaseCanal } from '../utils/ReleaseCanal'; -export default { +export default defineComponent({ name: 'PlayButton', computed: { playButtonLabel(): string { @@ -44,7 +45,7 @@ export default { this.$store.commit('launchGame'); } } -}; +}); </script> <template> diff --git a/src-vue/src/plugins/store.ts b/src-vue/src/plugins/store.ts index 67856b47..544d314a 100644 --- a/src-vue/src/plugins/store.ts +++ b/src-vue/src/plugins/store.ts @@ -8,6 +8,21 @@ import {ReleaseCanal} from "../utils/ReleaseCanal"; import { ElNotification } from 'element-plus'; import { NorthstarState } from '../utils/NorthstarState'; + +export type Store = { + current_tab: Tabs, + developer_mode: boolean, + game_path: string, + install_type: InstallType, + + installed_northstar_version: string, + northstar_state: NorthstarState, + release_canal: ReleaseCanal, + + northstar_is_running: boolean, + origin_is_running: boolean +} + export const store = createStore({ state () { return { diff --git a/src-vue/src/views/DeveloperView.vue b/src-vue/src/views/DeveloperView.vue index 8dcc9608..bfb206a2 100644 --- a/src-vue/src/views/DeveloperView.vue +++ b/src-vue/src/views/DeveloperView.vue @@ -7,14 +7,16 @@ </template> <script lang="ts"> -export default { +import {defineComponent} from "vue"; + +export default defineComponent({ name: "DeveloperView", methods: { disableDevMode() { this.$store.commit('toggleDeveloperMode'); } } -} +}); </script> <style scoped> diff --git a/src-vue/src/vuex-shim.d.ts b/src-vue/src/vuex-shim.d.ts new file mode 100644 index 00000000..1429115b --- /dev/null +++ b/src-vue/src/vuex-shim.d.ts @@ -0,0 +1,8 @@ +import { ComponentCustomProperties } from 'vue'
+import { Store } from 'vuex'
+
+declare module '@vue/runtime-core' {
+ interface ComponentCustomProperties {
+ $store: Store<State>
+ }
+}
|