From 7c7b6ba0827fa7f5e8252fdb0e6be1113cc8b695 Mon Sep 17 00:00:00 2001 From: Lea Anthony Date: Tue, 17 Nov 2020 21:19:09 +1100 Subject: [PATCH] Runtime updates --- .vscode/settings.json | 6 ++- v2/internal/runtime/js/runtime/package.json | 2 +- v2/internal/runtime/js/runtime/runtime.d.ts | 45 +++++++++++++++++-- .../kitchensink/frontend/package-lock.json | 6 +-- v2/test/kitchensink/frontend/package.json | 2 +- 5 files changed, 52 insertions(+), 9 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index dde13a901..da2d84ba6 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,4 +1,8 @@ { "go.formatTool": "goimports", - "eslint.alwaysShowStatus": true + "eslint.alwaysShowStatus": true, + "files.associations": { + "__locale": "c", + "ios": "c" + } } \ No newline at end of file diff --git a/v2/internal/runtime/js/runtime/package.json b/v2/internal/runtime/js/runtime/package.json index 10ba81aa7..acd4898f4 100644 --- a/v2/internal/runtime/js/runtime/package.json +++ b/v2/internal/runtime/js/runtime/package.json @@ -1,6 +1,6 @@ { "name": "@wails/runtime", - "version": "1.2.4", + "version": "1.2.11", "description": "Wails V2 Javascript runtime library", "main": "main.js", "types": "runtime.d.ts", diff --git a/v2/internal/runtime/js/runtime/runtime.d.ts b/v2/internal/runtime/js/runtime/runtime.d.ts index 525558393..64699cf00 100644 --- a/v2/internal/runtime/js/runtime/runtime.d.ts +++ b/v2/internal/runtime/js/runtime/runtime.d.ts @@ -7,13 +7,51 @@ interface Store { update(callback: (currentvalue: any) => any): void; } -interface Level { +interface MacTitleBar { + TitleBarAppearsTransparent: boolean; // NSWindow.titleBarAppearsTransparent + HideTitle: boolean; // NSWindow.hideTitle + HideTitleBar: boolean; // NSWindow.hideTitleBar + FullSizeContent: boolean; // Makes the webview portion of the window the full size of the window, even over the titlebar + UseToolbar: boolean; // Set true to add a blank toolbar to the window (makes the title bar larger) + HideToolbarSeparator: boolean; // Set true to remove the separator between the toolbar and the main content area +} + +interface MacAppConfig { + TitleBar: MacTitleBar; +} +interface LinuxAppConfig { +} +interface WindowsAppConfig { +} + +interface AppConfig { + Title: string; // Application Title + Width: number; // Window Width + Height: number; // Window Height + DisableResize: boolean; // True if resize is disabled + Fullscreen: boolean; // App started in fullscreen + MinWidth: number; // Window Minimum Width + MinHeight: number; // Window Minimum Height + MaxWidth: number; // Window Maximum Width + MaxHeight: number; // Window Maximum Height + StartHidden: boolean; // Start with window hidden + DevTools: boolean; // Enables the window devtools + RBGA: number; // The initial window colour. Convert to hex then it'll mean 0xRRGGBBAA + Mac?: MacAppConfig; // - Configuration when running on Mac + Linux?: LinuxAppConfig; // - Configuration when running on Linux + Windows?: WindowsAppConfig; // - Configuration when running on Windows + Appearance: string; // The default application appearance. Use the values listed here: https://developer.apple.com/documentation/appkit/nsappearance?language=objc + WebviewIsTransparent: number; // Makes the background of the webview content transparent. Use this with the Alpha part of the window colour to make parts of your application transparent. + WindowBackgroundIsTranslucent: number; // Makes the transparent parts of the application window translucent. Example: https://en.wikipedia.org/wiki/MacOS_Big_Sur#/media/File:MacOS_Big_Sur_-_Safari_Extensions_category_in_App_Store.jpg + LogLevel: number; // The initial log level (lower is more verbose) +} +interface Level { TRACE: 1, DEBUG: 2, INFO: 3, WARNING: 4, ERROR: 5, -}; +} declare const wailsapp__runtime: { Browser: { @@ -39,7 +77,8 @@ declare const wailsapp__runtime: { OnThemeChange(callback: (darkModeEnabled: boolean) => void): void; LogLevel(): Store; Platform(): string; - AppType(): string + AppType(): string; + AppConfig(): AppConfig; }; Store: { New(name: string, defaultValue?: any): Store; diff --git a/v2/test/kitchensink/frontend/package-lock.json b/v2/test/kitchensink/frontend/package-lock.json index 1147817ec..73edb8033 100644 --- a/v2/test/kitchensink/frontend/package-lock.json +++ b/v2/test/kitchensink/frontend/package-lock.json @@ -135,9 +135,9 @@ } }, "@wails/runtime": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@wails/runtime/-/runtime-1.2.2.tgz", - "integrity": "sha512-sZlW83ZXldcb4Kbkcl1MZ/iPdSbMQtlCM60b3VcCehwYqR/aM/cKZPLm/HbOwvyRhkv4/Uo6QPlwlB13UUFhSA==", + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/@wails/runtime/-/runtime-1.2.11.tgz", + "integrity": "sha512-IhCsu8bvCb8Vjv3T0Ob+yLFYlpzFwox073LD55khsVJc7/1jB3aMcqt4y7Jnnomn6SUcitImLHpw8bytKsHjLA==", "dev": true }, "alphanum-sort": { diff --git a/v2/test/kitchensink/frontend/package.json b/v2/test/kitchensink/frontend/package.json index 874cd0878..8b8aabafd 100644 --- a/v2/test/kitchensink/frontend/package.json +++ b/v2/test/kitchensink/frontend/package.json @@ -11,7 +11,7 @@ "@rollup/plugin-commonjs": "^11.0.0", "@rollup/plugin-node-resolve": "^7.0.0", "@rollup/plugin-url": "^5.0.1", - "@wails/runtime": "^1.2.2", + "@wails/runtime": "^1.2.11", "focus-visible": "^5.2.0", "halfmoon": "^1.1.1", "postcss": "^8.1.7",