Support dynamic loglevel

This commit is contained in:
Lea Anthony
2020-10-10 15:06:27 +11:00
parent ba6538da7c
commit f1cd84d0c8
7 changed files with 46 additions and 13 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "@wails/runtime",
"version": "1.0.1",
"version": "1.0.2",
"description": "Wails V2 Javascript runtime library",
"main": "main.js",
"types": "runtime.d.ts",

View File

@@ -1,5 +1,12 @@
export = wailsapp__runtime;
interface Store {
get(): any;
set(value: any): void;
subscribe(callback: (newvalue: any) => void): void;
update(callback: (currentvalue: any) => any): void;
}
declare const wailsapp__runtime: {
Browser: {
OpenFile(filename: string): Promise<any>;
@@ -24,6 +31,10 @@ declare const wailsapp__runtime: {
System: {
DarkModeEnabled(): Promise<boolean>;
OnThemeChange(callback: (darkModeEnabled: boolean) => void): void;
LogLevel(): Store;
};
Store: {
New(name: string, defaultValue?: any): Store;
}
};

View File

@@ -36,4 +36,5 @@ function DarkModeEnabled() {
module.exports = {
OnThemeChange: OnThemeChange,
DarkModeEnabled: DarkModeEnabled,
LogLevel: window.wails.System.LogLevel,
};