Improved runtime.System

This commit is contained in:
Lea Anthony
2020-10-23 10:42:00 +11:00
parent 6153c48c86
commit 145656bc43
3 changed files with 6 additions and 0 deletions

View File

@@ -51,6 +51,8 @@ export function Init() {
IsDarkMode: Store.New('isdarkmode'),
LogLevel: Store.New('loglevel'),
};
// Copy platform specific information into it
Object.assign(window.wails.System, Platform.System);
// Do platform specific Init
Platform.Init();

View File

@@ -38,6 +38,8 @@ declare const wailsapp__runtime: {
DarkModeEnabled(): Promise<boolean>;
OnThemeChange(callback: (darkModeEnabled: boolean) => void): void;
LogLevel(): Store;
Platform: string;
AppType: string
};
Store: {
New(name: string, defaultValue?: any): Store;

View File

@@ -37,4 +37,6 @@ module.exports = {
OnThemeChange: OnThemeChange,
DarkModeEnabled: DarkModeEnabled,
LogLevel: window.wails.System.LogLevel,
Platform: window.wails.System.Platform,
AppType: window.wails.System.AppType
};