chore: introduce platform object for platform specific code

This commit is contained in:
Andrew Bastin
2022-12-21 19:21:52 -05:00
parent 3d7b057026
commit 1e5dd1cc53
4 changed files with 30 additions and 6 deletions

View File

@@ -1,4 +1,4 @@
import { createApp } from "vue"
import { createApp, Ref } from "vue"
import { setupLocalPersistence } from "./newstore/localpersistence"
import { performMigrations } from "./helpers/migrations"
import { initializeFirebase } from "./helpers/fb"
@@ -12,7 +12,26 @@ import "nprogress/nprogress.css"
import App from "./App.vue"
export function createHoppApp(el: string | Element) {
export type PlatformDef = {
ui?: {
appHeader?: {
paddingTop?: Ref<string>
paddingLeft?: Ref<string>
}
}
}
/**
* Defines the fields, functions and properties that will be
* filled in by the individual platforms.
*
* This value is populated upon calling `createHoppApp`
*/
export let platform: PlatformDef
export function createHoppApp(el: string | Element, platformDef: PlatformDef) {
platform = platformDef
const app = createApp(App)
// Some basic work that needs to be done before module inits even