diff --git a/v2/cmd/wails/internal/commands/initialise/templates/templates/vue-ts/frontend/.vscode/extensions.json b/v2/cmd/wails/internal/commands/initialise/templates/templates/vue-ts/frontend/.vscode/extensions.json deleted file mode 100644 index 57011895d25..00000000000 --- a/v2/cmd/wails/internal/commands/initialise/templates/templates/vue-ts/frontend/.vscode/extensions.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "recommendations": [ - "Vue.volar" - ] -} diff --git a/v2/cmd/wails/internal/commands/initialise/templates/templates/vue-ts/frontend/package.json b/v2/cmd/wails/internal/commands/initialise/templates/templates/vue-ts/frontend/package.json index 2cfff6a4737..c06165c24e2 100644 --- a/v2/cmd/wails/internal/commands/initialise/templates/templates/vue-ts/frontend/package.json +++ b/v2/cmd/wails/internal/commands/initialise/templates/templates/vue-ts/frontend/package.json @@ -2,19 +2,20 @@ "name": "frontend", "private": true, "version": "0.0.0", + "type": "module", "scripts": { "dev": "vite", "build": "vue-tsc --noEmit && vite build", "preview": "vite preview" }, "dependencies": { - "vue": "^3.2.25" + "vue": "^3.2.37" }, "devDependencies": { - "@vitejs/plugin-vue": "^2.3.3", - "typescript": "^4.5.4", - "vite": "^2.9.9", - "vue-tsc": "^0.34.7", - "@babel/types": "^7.17.10" + "@vitejs/plugin-vue": "^3.0.3", + "typescript": "^4.6.4", + "vite": "^3.0.7", + "vue-tsc": "^0.39.5", + "@babel/types": "^7.18.10" } } \ No newline at end of file diff --git a/v2/cmd/wails/internal/commands/initialise/templates/templates/vue-ts/frontend/src/env.d.ts b/v2/cmd/wails/internal/commands/initialise/templates/templates/vue-ts/frontend/src/vite-env.d.ts similarity index 66% rename from v2/cmd/wails/internal/commands/initialise/templates/templates/vue-ts/frontend/src/env.d.ts rename to v2/cmd/wails/internal/commands/initialise/templates/templates/vue-ts/frontend/src/vite-env.d.ts index d0c7971d721..dcfaef43646 100644 --- a/v2/cmd/wails/internal/commands/initialise/templates/templates/vue-ts/frontend/src/env.d.ts +++ b/v2/cmd/wails/internal/commands/initialise/templates/templates/vue-ts/frontend/src/vite-env.d.ts @@ -2,7 +2,6 @@ declare module '*.vue' { import type {DefineComponent} from 'vue' - // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types const component: DefineComponent<{}, {}, any> export default component } diff --git a/v2/cmd/wails/internal/commands/initialise/templates/templates/vue-ts/frontend/tsconfig.node.json b/v2/cmd/wails/internal/commands/initialise/templates/templates/vue-ts/frontend/tsconfig.node.json index e993792cb12..9d31e2aed93 100644 --- a/v2/cmd/wails/internal/commands/initialise/templates/templates/vue-ts/frontend/tsconfig.node.json +++ b/v2/cmd/wails/internal/commands/initialise/templates/templates/vue-ts/frontend/tsconfig.node.json @@ -1,8 +1,9 @@ { "compilerOptions": { "composite": true, - "module": "esnext", - "moduleResolution": "node" + "module": "ESNext", + "moduleResolution": "Node", + "allowSyntheticDefaultImports": true }, "include": ["vite.config.ts"] } diff --git a/v2/cmd/wails/internal/commands/initialise/templates/templates/vue-ts/frontend/wailsjs/runtime/runtime.d.ts b/v2/cmd/wails/internal/commands/initialise/templates/templates/vue-ts/frontend/wailsjs/runtime/runtime.d.ts index 8d816307f07..14f322e4c01 100644 --- a/v2/cmd/wails/internal/commands/initialise/templates/templates/vue-ts/frontend/wailsjs/runtime/runtime.d.ts +++ b/v2/cmd/wails/internal/commands/initialise/templates/templates/vue-ts/frontend/wailsjs/runtime/runtime.d.ts @@ -18,6 +18,13 @@ export interface Size { h: number; } +export interface Screen { + isCurrent: boolean; + isPrimary: boolean; + width: number + height: number +} + // Environment information such as platform, buildtype, ... export interface EnvironmentInfo { buildType: string; @@ -171,6 +178,10 @@ export function WindowUnminimise(): void; // Sets the background colour of the window to the given RGBA colour definition. This colour will show through for all transparent pixels. export function WindowSetBackgroundColour(R: number, G: number, B: number, A: number): void; +// [ScreenGetAll](https://wails.io/docs/reference/runtime/window#screengetall) +// Gets the all screens. Call this anew each time you want to refresh data from the underlying windowing system. +export function ScreenGetAll(): Promise; + // [BrowserOpenURL](https://wails.io/docs/reference/runtime/browser#browseropenurl) // Opens the given URL in the system browser. export function BrowserOpenURL(url: string): void; @@ -182,3 +193,11 @@ export function Environment(): Promise; // [Quit](https://wails.io/docs/reference/runtime/intro#quit) // Quits the application. export function Quit(): void; + +// [Hide](https://wails.io/docs/reference/runtime/intro#hide) +// Hides the application. +export function Hide(): void; + +// [Show](https://wails.io/docs/reference/runtime/intro#show) +// Shows the application. +export function Show(): void; diff --git a/v2/cmd/wails/internal/commands/initialise/templates/templates/vue-ts/frontend/wailsjs/runtime/runtime.js b/v2/cmd/wails/internal/commands/initialise/templates/templates/vue-ts/frontend/wailsjs/runtime/runtime.js index 8e8531a5f2f..26dbb224c1d 100644 --- a/v2/cmd/wails/internal/commands/initialise/templates/templates/vue-ts/frontend/wailsjs/runtime/runtime.js +++ b/v2/cmd/wails/internal/commands/initialise/templates/templates/vue-ts/frontend/wailsjs/runtime/runtime.js @@ -149,6 +149,10 @@ export function WindowSetBackgroundColour(R, G, B, A) { window.runtime.WindowSetBackgroundColour(R, G, B, A); } +export function ScreenGetAll() { + return window.runtime.ScreenGetAll(); +} + export function BrowserOpenURL(url) { window.runtime.BrowserOpenURL(url); } @@ -161,6 +165,10 @@ export function Quit() { window.runtime.Quit(); } -export function ScreenGetAll() { - return window.runtime.ScreenGetAll(); -} \ No newline at end of file +export function Hide() { + window.runtime.Hide(); +} + +export function Show() { + window.runtime.Show(); +} diff --git a/v2/cmd/wails/internal/commands/initialise/templates/templates/vue/frontend/.vscode/extensions.json b/v2/cmd/wails/internal/commands/initialise/templates/templates/vue/frontend/.vscode/extensions.json deleted file mode 100644 index 57011895d25..00000000000 --- a/v2/cmd/wails/internal/commands/initialise/templates/templates/vue/frontend/.vscode/extensions.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "recommendations": [ - "Vue.volar" - ] -} diff --git a/v2/cmd/wails/internal/commands/initialise/templates/templates/vue/frontend/package.json b/v2/cmd/wails/internal/commands/initialise/templates/templates/vue/frontend/package.json index d171757c8fc..43da9cbd8f7 100644 --- a/v2/cmd/wails/internal/commands/initialise/templates/templates/vue/frontend/package.json +++ b/v2/cmd/wails/internal/commands/initialise/templates/templates/vue/frontend/package.json @@ -2,16 +2,17 @@ "name": "frontend", "private": true, "version": "0.0.0", + "type": "module", "scripts": { "dev": "vite", "build": "vite build", "preview": "vite preview" }, "dependencies": { - "vue": "^3.2.25" + "vue": "^3.2.37" }, "devDependencies": { - "@vitejs/plugin-vue": "^2.3.3", - "vite": "^2.9.9" + "@vitejs/plugin-vue": "^3.0.3", + "vite": "^3.0.7" } } \ No newline at end of file diff --git a/v2/cmd/wails/internal/commands/initialise/templates/templates/vue/frontend/wailsjs/runtime/runtime.d.ts b/v2/cmd/wails/internal/commands/initialise/templates/templates/vue/frontend/wailsjs/runtime/runtime.d.ts index 8d816307f07..14f322e4c01 100644 --- a/v2/cmd/wails/internal/commands/initialise/templates/templates/vue/frontend/wailsjs/runtime/runtime.d.ts +++ b/v2/cmd/wails/internal/commands/initialise/templates/templates/vue/frontend/wailsjs/runtime/runtime.d.ts @@ -18,6 +18,13 @@ export interface Size { h: number; } +export interface Screen { + isCurrent: boolean; + isPrimary: boolean; + width: number + height: number +} + // Environment information such as platform, buildtype, ... export interface EnvironmentInfo { buildType: string; @@ -171,6 +178,10 @@ export function WindowUnminimise(): void; // Sets the background colour of the window to the given RGBA colour definition. This colour will show through for all transparent pixels. export function WindowSetBackgroundColour(R: number, G: number, B: number, A: number): void; +// [ScreenGetAll](https://wails.io/docs/reference/runtime/window#screengetall) +// Gets the all screens. Call this anew each time you want to refresh data from the underlying windowing system. +export function ScreenGetAll(): Promise; + // [BrowserOpenURL](https://wails.io/docs/reference/runtime/browser#browseropenurl) // Opens the given URL in the system browser. export function BrowserOpenURL(url: string): void; @@ -182,3 +193,11 @@ export function Environment(): Promise; // [Quit](https://wails.io/docs/reference/runtime/intro#quit) // Quits the application. export function Quit(): void; + +// [Hide](https://wails.io/docs/reference/runtime/intro#hide) +// Hides the application. +export function Hide(): void; + +// [Show](https://wails.io/docs/reference/runtime/intro#show) +// Shows the application. +export function Show(): void; diff --git a/v2/cmd/wails/internal/commands/initialise/templates/templates/vue/frontend/wailsjs/runtime/runtime.js b/v2/cmd/wails/internal/commands/initialise/templates/templates/vue/frontend/wailsjs/runtime/runtime.js index 8e8531a5f2f..26dbb224c1d 100644 --- a/v2/cmd/wails/internal/commands/initialise/templates/templates/vue/frontend/wailsjs/runtime/runtime.js +++ b/v2/cmd/wails/internal/commands/initialise/templates/templates/vue/frontend/wailsjs/runtime/runtime.js @@ -149,6 +149,10 @@ export function WindowSetBackgroundColour(R, G, B, A) { window.runtime.WindowSetBackgroundColour(R, G, B, A); } +export function ScreenGetAll() { + return window.runtime.ScreenGetAll(); +} + export function BrowserOpenURL(url) { window.runtime.BrowserOpenURL(url); } @@ -161,6 +165,10 @@ export function Quit() { window.runtime.Quit(); } -export function ScreenGetAll() { - return window.runtime.ScreenGetAll(); -} \ No newline at end of file +export function Hide() { + window.runtime.Hide(); +} + +export function Show() { + window.runtime.Show(); +}