-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- use vite import.meta.env for things on the client that come from .env * would've been nice to just integrate this into shared/settings such that when called from the client, import.meta.env would be used instead of process.env but this is extremely difficult to do - Constants -> settings - add $settings vue global for accessing shared settings easier
- Loading branch information
Showing
25 changed files
with
117 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { State } from "@port-of-mars/shared/game/client/state"; | ||
import Getters from "@port-of-mars/client/store/getters"; | ||
import Mutations from "@port-of-mars/client/store/mutations"; | ||
import { VueConstructor } from "vue"; | ||
import { Store } from "vuex"; | ||
|
||
export interface TStore { | ||
state: State; | ||
readonly getters: { [K in keyof typeof Getters]: ReturnType<(typeof Getters)[K]> }; | ||
|
||
commit<K extends keyof typeof Mutations>( | ||
name: K, | ||
payload?: Parameters<(typeof Mutations)[K]>[1] | ||
): void; | ||
} | ||
|
||
declare module "vue/types/vue" { | ||
interface Vue { | ||
$tstore: TStore; | ||
} | ||
} | ||
|
||
export const TypedStore = { | ||
install(instance: VueConstructor) { | ||
Object.defineProperty(instance.prototype, "$tstore", { | ||
get: function (this: { $store: Store<any> }) { | ||
return this.$store; | ||
}, | ||
}); | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.