diff --git a/v2/cmd/wails/internal/commands/initialise/templates/generate/assets/common/frontend/wailsjs/runtime/runtime.d.ts b/v2/cmd/wails/internal/commands/initialise/templates/generate/assets/common/frontend/wailsjs/runtime/runtime.d.ts index 462cfab3..ed6cf378 100644 --- a/v2/cmd/wails/internal/commands/initialise/templates/generate/assets/common/frontend/wailsjs/runtime/runtime.d.ts +++ b/v2/cmd/wails/internal/commands/initialise/templates/generate/assets/common/frontend/wailsjs/runtime/runtime.d.ts @@ -1,3 +1,13 @@ +/* + _ __ _ __ +| | / /___ _(_) /____ +| | /| / / __ `/ / / ___/ +| |/ |/ / /_/ / / (__ ) +|__/|__/\__,_/_/_/____/ +The electron alternative for Go +(c) Lea Anthony 2019-present +*/ + export interface Position { x: number; y: number; @@ -9,72 +19,152 @@ export interface Size { } +// [EventsEmit](https://wails.io/docs/reference/runtime/events#eventsemit) +// emits the given event. Optional data may be passed with the event. +// This will trigger any event listeners. export function EventsEmit(eventName: string, data?: any): void; +// [EventsOn](https://wails.io/docs/reference/runtime/events#eventson) sets up a listener for the given event name. export function EventsOn(eventName: string, callback: (data?: any) => void): void; +// [EventsOnMultiple](https://wails.io/docs/reference/runtime/events#eventsonmultiple) +// sets up a listener for the given event name, but will only trigger a given number times. export function EventsOnMultiple(eventName: string, callback: (data?: any) => void, maxCallbacks: number): void; +// [EventsOnce](https://wails.io/docs/reference/runtime/events#eventsonce) +// sets up a listener for the given event name, but will only trigger once. export function EventsOnce(eventName: string, callback: (data?: any) => void): void; +// [EventsOff](https://wails.io/docs/reference/runtime/events#eventsff) +// unregisters the listener for the given event name. export function EventsOff(eventName: string): void; +// [LogPrint](https://wails.io/docs/reference/runtime/log#logprint) +// logs the given message as a raw message +export function LogPrint(message: string): void; + +// [LogTrace](https://wails.io/docs/reference/runtime/log#logtrace) +// logs the given message at the `trace` log level. export function LogTrace(message: string): void; +// [LogDebug](https://wails.io/docs/reference/runtime/log#logdebug) +// logs the given message at the `debug` log level. export function LogDebug(message: string): void; +// [LogError](https://wails.io/docs/reference/runtime/log#logerror) +// logs the given message at the `error` log level. export function LogError(message: string): void; +// [LogFatal](https://wails.io/docs/reference/runtime/log#logfatal) +// logs the given message at the `fatal` log level. +// The application will quit after calling this method. export function LogFatal(message: string): void; +// [LogInfo](https://wails.io/docs/reference/runtime/log#loginfo) +// logs the given message at the `info` log level. export function LogInfo(message: string): void; +// [LogWarning](https://wails.io/docs/reference/runtime/log#logwarning) +// logs the given message at the `warning` log level. export function LogWarning(message: string): void; +// [WindowReload](https://wails.io/docs/reference/runtime/window#windowreload) +// Forces a reload by the main application as well as connected browsers. export function WindowReload(): void; +// [WindowSetSystemDefaultTheme](https://wails.io/docs/next/reference/runtime/window#windowsetsystemdefaulttheme) +// *Windows only* +// Sets window theme to system default (dark/light). export function WindowSetSystemDefaultTheme(): void; +// [WindowSetLightTheme](https://wails.io/docs/next/reference/runtime/window#windowsetlighttheme) +// *Windows only* +// Sets window to light theme. export function WindowSetLightTheme(): void; +// [WindowSetDarkTheme](https://wails.io/docs/next/reference/runtime/window#windowsetdarktheme) +// *Windows only* +// Sets window to dark theme. export function WindowSetDarkTheme(): void; +// [WindowCenter](https://wails.io/docs/reference/runtime/window#windowcenter) +// Centers the window on the monitor the window is currently on. export function WindowCenter(): void; +// [WindowSetTitle](https://wails.io/docs/reference/runtime/window#windowsettitle) +// Sets the text in the window title bar. export function WindowSetTitle(title: string): void; +// [WindowFullscreen](https://wails.io/docs/reference/runtime/window#windowfullscreen) +// Makes the window full screen. export function WindowFullscreen(): void; +// [WindowUnfullscreen](https://wails.io/docs/reference/runtime/window#windowunfullscreen) +// Restores the previous window dimensions and position prior to full screen. export function WindowUnfullscreen(): void; +// [WindowSetSize](https://wails.io/docs/reference/runtime/window#windowsetsize) +// Sets the width and height of the window. export function WindowSetSize(width: number, height: number): Promise; +// [WindowGetSize](https://wails.io/docs/reference/runtime/window#windowgetsize) +// Gets the width and height of the window. export function WindowGetSize(): Promise; +// [WindowSetMaxSize](https://wails.io/docs/reference/runtime/window#windowsetmaxsize) +// Sets the maximum window size. Will resize the window if the window is currently larger than the given dimensions. +// Setting a size of 0,0 will disable this constraint. export function WindowSetMaxSize(width: number, height: number): void; +// [WindowSetMinSize](https://wails.io/docs/reference/runtime/window#windowsetminsize) +// Sets the minimum window size. Will resize the window if the window is currently smaller than the given dimensions. +// Setting a size of 0,0 will disable this constraint. export function WindowSetMinSize(width: number, height: number): void; +// [WindowSetPosition](https://wails.io/docs/reference/runtime/window#windowsetposition) +// Sets the window position relative to the monitor the window is currently on. export function WindowSetPosition(x: number, y: number): void; +// [WindowGetPosition](https://wails.io/docs/reference/runtime/window#windowgetposition) +// Gets the window position relative to the monitor the window is currently on. export function WindowGetPosition(): Promise; +// [WindowHide](https://wails.io/docs/reference/runtime/window#windowhide) +// Hides the window. export function WindowHide(): void; +// [WindowShow](https://wails.io/docs/reference/runtime/window#windowshow) +// Shows the window, if it is currently hidden. export function WindowShow(): void; +// [WindowMaximise](https://wails.io/docs/reference/runtime/window#windowmaximise) +// Maximises the window to fill the screen. export function WindowMaximise(): void; +// [WindowToggleMaximise](https://wails.io/docs/reference/runtime/window#windowtogglemaximise) +// Toggles between Maximised and UnMaximised. export function WindowToggleMaximise(): void; +// [WindowUnmaximise](https://wails.io/docs/reference/runtime/window#windowunmaximise) +// Restores the window to the dimensions and position prior to maximising. export function WindowUnmaximise(): void; +// [WindowMinimise](https://wails.io/docs/reference/runtime/window#windowminimise) +// Minimises the window. export function WindowMinimise(): void; +// [WindowUnminimise](https://wails.io/docs/reference/runtime/window#windowunminimise) +// Restores the window to the dimensions and position prior to minimising. export function WindowUnminimise(): void; +// [WindowSetRGBA](https://wails.io/docs/reference/runtime/window#windowsetrgba) +// Sets the background colour of the window to the given RGBA colour definition. This colour will show through for all transparent pixels. export function WindowSetRGBA(R: number, G: number, B: number, A: number): void; +// [BrowserOpenURL](https://wails.io/docs/next/reference/runtime/browser#browseropenurl) +// Opens the given URL in the system browser. export function BrowserOpenURL(url: string): void; +// [Quit](https://wails.io/docs/next/reference/runtime/intro#quit) +// Quits the application. export function Quit(): void; diff --git a/v2/cmd/wails/internal/commands/initialise/templates/generate/assets/common/frontend/wailsjs/runtime/runtime.js b/v2/cmd/wails/internal/commands/initialise/templates/generate/assets/common/frontend/wailsjs/runtime/runtime.js index 0105feeb..9e602219 100644 --- a/v2/cmd/wails/internal/commands/initialise/templates/generate/assets/common/frontend/wailsjs/runtime/runtime.js +++ b/v2/cmd/wails/internal/commands/initialise/templates/generate/assets/common/frontend/wailsjs/runtime/runtime.js @@ -1,3 +1,17 @@ +/* + _ __ _ __ +| | / /___ _(_) /____ +| | /| / / __ `/ / / ___/ +| |/ |/ / /_/ / / (__ ) +|__/|__/\__,_/_/_/____/ +The electron alternative for Go +(c) Lea Anthony 2019-present +*/ + +export function LogPrint(message) { + window.runtime.LogPrint(message); +} + export function LogTrace(message) { window.runtime.LogTrace(message); } diff --git a/v2/cmd/wails/internal/commands/initialise/templates/templates/lit-ts/frontend/package.json b/v2/cmd/wails/internal/commands/initialise/templates/templates/lit-ts/frontend/package.json index 4e27c9ee..f51a554c 100644 --- a/v2/cmd/wails/internal/commands/initialise/templates/templates/lit-ts/frontend/package.json +++ b/v2/cmd/wails/internal/commands/initialise/templates/templates/lit-ts/frontend/package.json @@ -19,7 +19,7 @@ "lit": "^2.0.2" }, "devDependencies": { - "vite": "^2.9.2", + "vite": "^2.9.5", "typescript": "^4.5.4" } } \ No newline at end of file diff --git a/v2/cmd/wails/internal/commands/initialise/templates/templates/lit-ts/frontend/tsconfig.json b/v2/cmd/wails/internal/commands/initialise/templates/templates/lit-ts/frontend/tsconfig.json index 2c98da9c..342653e1 100644 --- a/v2/cmd/wails/internal/commands/initialise/templates/templates/lit-ts/frontend/tsconfig.json +++ b/v2/cmd/wails/internal/commands/initialise/templates/templates/lit-ts/frontend/tsconfig.json @@ -19,7 +19,8 @@ "allowSyntheticDefaultImports": true, "experimentalDecorators": true, "forceConsistentCasingInFileNames": true, - "useDefineForClassFields": false + "useDefineForClassFields": false, + "skipLibCheck": true }, "include": [ "src/**/*.ts" diff --git a/v2/cmd/wails/internal/commands/initialise/templates/templates/lit/frontend/package.json b/v2/cmd/wails/internal/commands/initialise/templates/templates/lit/frontend/package.json index 9feac19d..9ddc2e9f 100644 --- a/v2/cmd/wails/internal/commands/initialise/templates/templates/lit/frontend/package.json +++ b/v2/cmd/wails/internal/commands/initialise/templates/templates/lit/frontend/package.json @@ -17,6 +17,6 @@ "lit": "^2.0.2" }, "devDependencies": { - "vite": "^2.9.2" + "vite": "^2.9.5" } } \ No newline at end of file diff --git a/v2/cmd/wails/internal/commands/initialise/templates/templates/preact-ts/frontend/package.json b/v2/cmd/wails/internal/commands/initialise/templates/templates/preact-ts/frontend/package.json index f54f6f95..10ea6e6d 100644 --- a/v2/cmd/wails/internal/commands/initialise/templates/templates/preact-ts/frontend/package.json +++ b/v2/cmd/wails/internal/commands/initialise/templates/templates/preact-ts/frontend/package.json @@ -13,6 +13,6 @@ "devDependencies": { "@preact/preset-vite": "^2.1.5", "typescript": "^4.5.4", - "vite": "^2.9.2" + "vite": "^2.9.5" } } \ No newline at end of file diff --git a/v2/cmd/wails/internal/commands/initialise/templates/templates/preact-ts/frontend/tsconfig.json b/v2/cmd/wails/internal/commands/initialise/templates/templates/preact-ts/frontend/tsconfig.json index 56a96704..d6f1807e 100644 --- a/v2/cmd/wails/internal/commands/initialise/templates/templates/preact-ts/frontend/tsconfig.json +++ b/v2/cmd/wails/internal/commands/initialise/templates/templates/preact-ts/frontend/tsconfig.json @@ -8,7 +8,7 @@ "ESNext" ], "allowJs": false, - "skipLibCheck": false, + "skipLibCheck": true, "esModuleInterop": false, "allowSyntheticDefaultImports": true, "strict": true, diff --git a/v2/cmd/wails/internal/commands/initialise/templates/templates/preact-ts/frontend/wailsjs/runtime/runtime.d.ts b/v2/cmd/wails/internal/commands/initialise/templates/templates/preact-ts/frontend/wailsjs/runtime/runtime.d.ts index 462cfab3..ed6cf378 100644 --- a/v2/cmd/wails/internal/commands/initialise/templates/templates/preact-ts/frontend/wailsjs/runtime/runtime.d.ts +++ b/v2/cmd/wails/internal/commands/initialise/templates/templates/preact-ts/frontend/wailsjs/runtime/runtime.d.ts @@ -1,3 +1,13 @@ +/* + _ __ _ __ +| | / /___ _(_) /____ +| | /| / / __ `/ / / ___/ +| |/ |/ / /_/ / / (__ ) +|__/|__/\__,_/_/_/____/ +The electron alternative for Go +(c) Lea Anthony 2019-present +*/ + export interface Position { x: number; y: number; @@ -9,72 +19,152 @@ export interface Size { } +// [EventsEmit](https://wails.io/docs/reference/runtime/events#eventsemit) +// emits the given event. Optional data may be passed with the event. +// This will trigger any event listeners. export function EventsEmit(eventName: string, data?: any): void; +// [EventsOn](https://wails.io/docs/reference/runtime/events#eventson) sets up a listener for the given event name. export function EventsOn(eventName: string, callback: (data?: any) => void): void; +// [EventsOnMultiple](https://wails.io/docs/reference/runtime/events#eventsonmultiple) +// sets up a listener for the given event name, but will only trigger a given number times. export function EventsOnMultiple(eventName: string, callback: (data?: any) => void, maxCallbacks: number): void; +// [EventsOnce](https://wails.io/docs/reference/runtime/events#eventsonce) +// sets up a listener for the given event name, but will only trigger once. export function EventsOnce(eventName: string, callback: (data?: any) => void): void; +// [EventsOff](https://wails.io/docs/reference/runtime/events#eventsff) +// unregisters the listener for the given event name. export function EventsOff(eventName: string): void; +// [LogPrint](https://wails.io/docs/reference/runtime/log#logprint) +// logs the given message as a raw message +export function LogPrint(message: string): void; + +// [LogTrace](https://wails.io/docs/reference/runtime/log#logtrace) +// logs the given message at the `trace` log level. export function LogTrace(message: string): void; +// [LogDebug](https://wails.io/docs/reference/runtime/log#logdebug) +// logs the given message at the `debug` log level. export function LogDebug(message: string): void; +// [LogError](https://wails.io/docs/reference/runtime/log#logerror) +// logs the given message at the `error` log level. export function LogError(message: string): void; +// [LogFatal](https://wails.io/docs/reference/runtime/log#logfatal) +// logs the given message at the `fatal` log level. +// The application will quit after calling this method. export function LogFatal(message: string): void; +// [LogInfo](https://wails.io/docs/reference/runtime/log#loginfo) +// logs the given message at the `info` log level. export function LogInfo(message: string): void; +// [LogWarning](https://wails.io/docs/reference/runtime/log#logwarning) +// logs the given message at the `warning` log level. export function LogWarning(message: string): void; +// [WindowReload](https://wails.io/docs/reference/runtime/window#windowreload) +// Forces a reload by the main application as well as connected browsers. export function WindowReload(): void; +// [WindowSetSystemDefaultTheme](https://wails.io/docs/next/reference/runtime/window#windowsetsystemdefaulttheme) +// *Windows only* +// Sets window theme to system default (dark/light). export function WindowSetSystemDefaultTheme(): void; +// [WindowSetLightTheme](https://wails.io/docs/next/reference/runtime/window#windowsetlighttheme) +// *Windows only* +// Sets window to light theme. export function WindowSetLightTheme(): void; +// [WindowSetDarkTheme](https://wails.io/docs/next/reference/runtime/window#windowsetdarktheme) +// *Windows only* +// Sets window to dark theme. export function WindowSetDarkTheme(): void; +// [WindowCenter](https://wails.io/docs/reference/runtime/window#windowcenter) +// Centers the window on the monitor the window is currently on. export function WindowCenter(): void; +// [WindowSetTitle](https://wails.io/docs/reference/runtime/window#windowsettitle) +// Sets the text in the window title bar. export function WindowSetTitle(title: string): void; +// [WindowFullscreen](https://wails.io/docs/reference/runtime/window#windowfullscreen) +// Makes the window full screen. export function WindowFullscreen(): void; +// [WindowUnfullscreen](https://wails.io/docs/reference/runtime/window#windowunfullscreen) +// Restores the previous window dimensions and position prior to full screen. export function WindowUnfullscreen(): void; +// [WindowSetSize](https://wails.io/docs/reference/runtime/window#windowsetsize) +// Sets the width and height of the window. export function WindowSetSize(width: number, height: number): Promise; +// [WindowGetSize](https://wails.io/docs/reference/runtime/window#windowgetsize) +// Gets the width and height of the window. export function WindowGetSize(): Promise; +// [WindowSetMaxSize](https://wails.io/docs/reference/runtime/window#windowsetmaxsize) +// Sets the maximum window size. Will resize the window if the window is currently larger than the given dimensions. +// Setting a size of 0,0 will disable this constraint. export function WindowSetMaxSize(width: number, height: number): void; +// [WindowSetMinSize](https://wails.io/docs/reference/runtime/window#windowsetminsize) +// Sets the minimum window size. Will resize the window if the window is currently smaller than the given dimensions. +// Setting a size of 0,0 will disable this constraint. export function WindowSetMinSize(width: number, height: number): void; +// [WindowSetPosition](https://wails.io/docs/reference/runtime/window#windowsetposition) +// Sets the window position relative to the monitor the window is currently on. export function WindowSetPosition(x: number, y: number): void; +// [WindowGetPosition](https://wails.io/docs/reference/runtime/window#windowgetposition) +// Gets the window position relative to the monitor the window is currently on. export function WindowGetPosition(): Promise; +// [WindowHide](https://wails.io/docs/reference/runtime/window#windowhide) +// Hides the window. export function WindowHide(): void; +// [WindowShow](https://wails.io/docs/reference/runtime/window#windowshow) +// Shows the window, if it is currently hidden. export function WindowShow(): void; +// [WindowMaximise](https://wails.io/docs/reference/runtime/window#windowmaximise) +// Maximises the window to fill the screen. export function WindowMaximise(): void; +// [WindowToggleMaximise](https://wails.io/docs/reference/runtime/window#windowtogglemaximise) +// Toggles between Maximised and UnMaximised. export function WindowToggleMaximise(): void; +// [WindowUnmaximise](https://wails.io/docs/reference/runtime/window#windowunmaximise) +// Restores the window to the dimensions and position prior to maximising. export function WindowUnmaximise(): void; +// [WindowMinimise](https://wails.io/docs/reference/runtime/window#windowminimise) +// Minimises the window. export function WindowMinimise(): void; +// [WindowUnminimise](https://wails.io/docs/reference/runtime/window#windowunminimise) +// Restores the window to the dimensions and position prior to minimising. export function WindowUnminimise(): void; +// [WindowSetRGBA](https://wails.io/docs/reference/runtime/window#windowsetrgba) +// Sets the background colour of the window to the given RGBA colour definition. This colour will show through for all transparent pixels. export function WindowSetRGBA(R: number, G: number, B: number, A: number): void; +// [BrowserOpenURL](https://wails.io/docs/next/reference/runtime/browser#browseropenurl) +// Opens the given URL in the system browser. export function BrowserOpenURL(url: string): void; +// [Quit](https://wails.io/docs/next/reference/runtime/intro#quit) +// Quits the application. export function Quit(): void; diff --git a/v2/cmd/wails/internal/commands/initialise/templates/templates/preact-ts/frontend/wailsjs/runtime/runtime.js b/v2/cmd/wails/internal/commands/initialise/templates/templates/preact-ts/frontend/wailsjs/runtime/runtime.js index 0105feeb..9e602219 100644 --- a/v2/cmd/wails/internal/commands/initialise/templates/templates/preact-ts/frontend/wailsjs/runtime/runtime.js +++ b/v2/cmd/wails/internal/commands/initialise/templates/templates/preact-ts/frontend/wailsjs/runtime/runtime.js @@ -1,3 +1,17 @@ +/* + _ __ _ __ +| | / /___ _(_) /____ +| | /| / / __ `/ / / ___/ +| |/ |/ / /_/ / / (__ ) +|__/|__/\__,_/_/_/____/ +The electron alternative for Go +(c) Lea Anthony 2019-present +*/ + +export function LogPrint(message) { + window.runtime.LogPrint(message); +} + export function LogTrace(message) { window.runtime.LogTrace(message); } diff --git a/v2/cmd/wails/internal/commands/initialise/templates/templates/preact/frontend/package.json b/v2/cmd/wails/internal/commands/initialise/templates/templates/preact/frontend/package.json index ee21d5c9..9c4bd75c 100644 --- a/v2/cmd/wails/internal/commands/initialise/templates/templates/preact/frontend/package.json +++ b/v2/cmd/wails/internal/commands/initialise/templates/templates/preact/frontend/package.json @@ -12,6 +12,6 @@ }, "devDependencies": { "@preact/preset-vite": "^2.1.5", - "vite": "^2.9.2" + "vite": "^2.9.5" } } \ No newline at end of file diff --git a/v2/cmd/wails/internal/commands/initialise/templates/templates/preact/frontend/wailsjs/runtime/runtime.d.ts b/v2/cmd/wails/internal/commands/initialise/templates/templates/preact/frontend/wailsjs/runtime/runtime.d.ts index 462cfab3..ed6cf378 100644 --- a/v2/cmd/wails/internal/commands/initialise/templates/templates/preact/frontend/wailsjs/runtime/runtime.d.ts +++ b/v2/cmd/wails/internal/commands/initialise/templates/templates/preact/frontend/wailsjs/runtime/runtime.d.ts @@ -1,3 +1,13 @@ +/* + _ __ _ __ +| | / /___ _(_) /____ +| | /| / / __ `/ / / ___/ +| |/ |/ / /_/ / / (__ ) +|__/|__/\__,_/_/_/____/ +The electron alternative for Go +(c) Lea Anthony 2019-present +*/ + export interface Position { x: number; y: number; @@ -9,72 +19,152 @@ export interface Size { } +// [EventsEmit](https://wails.io/docs/reference/runtime/events#eventsemit) +// emits the given event. Optional data may be passed with the event. +// This will trigger any event listeners. export function EventsEmit(eventName: string, data?: any): void; +// [EventsOn](https://wails.io/docs/reference/runtime/events#eventson) sets up a listener for the given event name. export function EventsOn(eventName: string, callback: (data?: any) => void): void; +// [EventsOnMultiple](https://wails.io/docs/reference/runtime/events#eventsonmultiple) +// sets up a listener for the given event name, but will only trigger a given number times. export function EventsOnMultiple(eventName: string, callback: (data?: any) => void, maxCallbacks: number): void; +// [EventsOnce](https://wails.io/docs/reference/runtime/events#eventsonce) +// sets up a listener for the given event name, but will only trigger once. export function EventsOnce(eventName: string, callback: (data?: any) => void): void; +// [EventsOff](https://wails.io/docs/reference/runtime/events#eventsff) +// unregisters the listener for the given event name. export function EventsOff(eventName: string): void; +// [LogPrint](https://wails.io/docs/reference/runtime/log#logprint) +// logs the given message as a raw message +export function LogPrint(message: string): void; + +// [LogTrace](https://wails.io/docs/reference/runtime/log#logtrace) +// logs the given message at the `trace` log level. export function LogTrace(message: string): void; +// [LogDebug](https://wails.io/docs/reference/runtime/log#logdebug) +// logs the given message at the `debug` log level. export function LogDebug(message: string): void; +// [LogError](https://wails.io/docs/reference/runtime/log#logerror) +// logs the given message at the `error` log level. export function LogError(message: string): void; +// [LogFatal](https://wails.io/docs/reference/runtime/log#logfatal) +// logs the given message at the `fatal` log level. +// The application will quit after calling this method. export function LogFatal(message: string): void; +// [LogInfo](https://wails.io/docs/reference/runtime/log#loginfo) +// logs the given message at the `info` log level. export function LogInfo(message: string): void; +// [LogWarning](https://wails.io/docs/reference/runtime/log#logwarning) +// logs the given message at the `warning` log level. export function LogWarning(message: string): void; +// [WindowReload](https://wails.io/docs/reference/runtime/window#windowreload) +// Forces a reload by the main application as well as connected browsers. export function WindowReload(): void; +// [WindowSetSystemDefaultTheme](https://wails.io/docs/next/reference/runtime/window#windowsetsystemdefaulttheme) +// *Windows only* +// Sets window theme to system default (dark/light). export function WindowSetSystemDefaultTheme(): void; +// [WindowSetLightTheme](https://wails.io/docs/next/reference/runtime/window#windowsetlighttheme) +// *Windows only* +// Sets window to light theme. export function WindowSetLightTheme(): void; +// [WindowSetDarkTheme](https://wails.io/docs/next/reference/runtime/window#windowsetdarktheme) +// *Windows only* +// Sets window to dark theme. export function WindowSetDarkTheme(): void; +// [WindowCenter](https://wails.io/docs/reference/runtime/window#windowcenter) +// Centers the window on the monitor the window is currently on. export function WindowCenter(): void; +// [WindowSetTitle](https://wails.io/docs/reference/runtime/window#windowsettitle) +// Sets the text in the window title bar. export function WindowSetTitle(title: string): void; +// [WindowFullscreen](https://wails.io/docs/reference/runtime/window#windowfullscreen) +// Makes the window full screen. export function WindowFullscreen(): void; +// [WindowUnfullscreen](https://wails.io/docs/reference/runtime/window#windowunfullscreen) +// Restores the previous window dimensions and position prior to full screen. export function WindowUnfullscreen(): void; +// [WindowSetSize](https://wails.io/docs/reference/runtime/window#windowsetsize) +// Sets the width and height of the window. export function WindowSetSize(width: number, height: number): Promise; +// [WindowGetSize](https://wails.io/docs/reference/runtime/window#windowgetsize) +// Gets the width and height of the window. export function WindowGetSize(): Promise; +// [WindowSetMaxSize](https://wails.io/docs/reference/runtime/window#windowsetmaxsize) +// Sets the maximum window size. Will resize the window if the window is currently larger than the given dimensions. +// Setting a size of 0,0 will disable this constraint. export function WindowSetMaxSize(width: number, height: number): void; +// [WindowSetMinSize](https://wails.io/docs/reference/runtime/window#windowsetminsize) +// Sets the minimum window size. Will resize the window if the window is currently smaller than the given dimensions. +// Setting a size of 0,0 will disable this constraint. export function WindowSetMinSize(width: number, height: number): void; +// [WindowSetPosition](https://wails.io/docs/reference/runtime/window#windowsetposition) +// Sets the window position relative to the monitor the window is currently on. export function WindowSetPosition(x: number, y: number): void; +// [WindowGetPosition](https://wails.io/docs/reference/runtime/window#windowgetposition) +// Gets the window position relative to the monitor the window is currently on. export function WindowGetPosition(): Promise; +// [WindowHide](https://wails.io/docs/reference/runtime/window#windowhide) +// Hides the window. export function WindowHide(): void; +// [WindowShow](https://wails.io/docs/reference/runtime/window#windowshow) +// Shows the window, if it is currently hidden. export function WindowShow(): void; +// [WindowMaximise](https://wails.io/docs/reference/runtime/window#windowmaximise) +// Maximises the window to fill the screen. export function WindowMaximise(): void; +// [WindowToggleMaximise](https://wails.io/docs/reference/runtime/window#windowtogglemaximise) +// Toggles between Maximised and UnMaximised. export function WindowToggleMaximise(): void; +// [WindowUnmaximise](https://wails.io/docs/reference/runtime/window#windowunmaximise) +// Restores the window to the dimensions and position prior to maximising. export function WindowUnmaximise(): void; +// [WindowMinimise](https://wails.io/docs/reference/runtime/window#windowminimise) +// Minimises the window. export function WindowMinimise(): void; +// [WindowUnminimise](https://wails.io/docs/reference/runtime/window#windowunminimise) +// Restores the window to the dimensions and position prior to minimising. export function WindowUnminimise(): void; +// [WindowSetRGBA](https://wails.io/docs/reference/runtime/window#windowsetrgba) +// Sets the background colour of the window to the given RGBA colour definition. This colour will show through for all transparent pixels. export function WindowSetRGBA(R: number, G: number, B: number, A: number): void; +// [BrowserOpenURL](https://wails.io/docs/next/reference/runtime/browser#browseropenurl) +// Opens the given URL in the system browser. export function BrowserOpenURL(url: string): void; +// [Quit](https://wails.io/docs/next/reference/runtime/intro#quit) +// Quits the application. export function Quit(): void; diff --git a/v2/cmd/wails/internal/commands/initialise/templates/templates/preact/frontend/wailsjs/runtime/runtime.js b/v2/cmd/wails/internal/commands/initialise/templates/templates/preact/frontend/wailsjs/runtime/runtime.js index 0105feeb..9e602219 100644 --- a/v2/cmd/wails/internal/commands/initialise/templates/templates/preact/frontend/wailsjs/runtime/runtime.js +++ b/v2/cmd/wails/internal/commands/initialise/templates/templates/preact/frontend/wailsjs/runtime/runtime.js @@ -1,3 +1,17 @@ +/* + _ __ _ __ +| | / /___ _(_) /____ +| | /| / / __ `/ / / ___/ +| |/ |/ / /_/ / / (__ ) +|__/|__/\__,_/_/_/____/ +The electron alternative for Go +(c) Lea Anthony 2019-present +*/ + +export function LogPrint(message) { + window.runtime.LogPrint(message); +} + export function LogTrace(message) { window.runtime.LogTrace(message); } diff --git a/v2/cmd/wails/internal/commands/initialise/templates/templates/react-ts/frontend/package.json b/v2/cmd/wails/internal/commands/initialise/templates/templates/react-ts/frontend/package.json index 431f9e46..8be3b809 100644 --- a/v2/cmd/wails/internal/commands/initialise/templates/templates/react-ts/frontend/package.json +++ b/v2/cmd/wails/internal/commands/initialise/templates/templates/react-ts/frontend/package.json @@ -16,6 +16,6 @@ "@types/react-dom": "^18.0.0", "@vitejs/plugin-react": "^1.3.0", "typescript": "^4.6.3", - "vite": "^2.9.2" + "vite": "^2.9.5" } } \ No newline at end of file diff --git a/v2/cmd/wails/internal/commands/initialise/templates/templates/react-ts/frontend/tsconfig.json b/v2/cmd/wails/internal/commands/initialise/templates/templates/react-ts/frontend/tsconfig.json index 5d012d31..823e83d1 100644 --- a/v2/cmd/wails/internal/commands/initialise/templates/templates/react-ts/frontend/tsconfig.json +++ b/v2/cmd/wails/internal/commands/initialise/templates/templates/react-ts/frontend/tsconfig.json @@ -8,7 +8,7 @@ "ESNext" ], "allowJs": false, - "skipLibCheck": false, + "skipLibCheck": true, "esModuleInterop": false, "allowSyntheticDefaultImports": true, "strict": true, diff --git a/v2/cmd/wails/internal/commands/initialise/templates/templates/react-ts/frontend/wailsjs/runtime/runtime.d.ts b/v2/cmd/wails/internal/commands/initialise/templates/templates/react-ts/frontend/wailsjs/runtime/runtime.d.ts index 462cfab3..ed6cf378 100644 --- a/v2/cmd/wails/internal/commands/initialise/templates/templates/react-ts/frontend/wailsjs/runtime/runtime.d.ts +++ b/v2/cmd/wails/internal/commands/initialise/templates/templates/react-ts/frontend/wailsjs/runtime/runtime.d.ts @@ -1,3 +1,13 @@ +/* + _ __ _ __ +| | / /___ _(_) /____ +| | /| / / __ `/ / / ___/ +| |/ |/ / /_/ / / (__ ) +|__/|__/\__,_/_/_/____/ +The electron alternative for Go +(c) Lea Anthony 2019-present +*/ + export interface Position { x: number; y: number; @@ -9,72 +19,152 @@ export interface Size { } +// [EventsEmit](https://wails.io/docs/reference/runtime/events#eventsemit) +// emits the given event. Optional data may be passed with the event. +// This will trigger any event listeners. export function EventsEmit(eventName: string, data?: any): void; +// [EventsOn](https://wails.io/docs/reference/runtime/events#eventson) sets up a listener for the given event name. export function EventsOn(eventName: string, callback: (data?: any) => void): void; +// [EventsOnMultiple](https://wails.io/docs/reference/runtime/events#eventsonmultiple) +// sets up a listener for the given event name, but will only trigger a given number times. export function EventsOnMultiple(eventName: string, callback: (data?: any) => void, maxCallbacks: number): void; +// [EventsOnce](https://wails.io/docs/reference/runtime/events#eventsonce) +// sets up a listener for the given event name, but will only trigger once. export function EventsOnce(eventName: string, callback: (data?: any) => void): void; +// [EventsOff](https://wails.io/docs/reference/runtime/events#eventsff) +// unregisters the listener for the given event name. export function EventsOff(eventName: string): void; +// [LogPrint](https://wails.io/docs/reference/runtime/log#logprint) +// logs the given message as a raw message +export function LogPrint(message: string): void; + +// [LogTrace](https://wails.io/docs/reference/runtime/log#logtrace) +// logs the given message at the `trace` log level. export function LogTrace(message: string): void; +// [LogDebug](https://wails.io/docs/reference/runtime/log#logdebug) +// logs the given message at the `debug` log level. export function LogDebug(message: string): void; +// [LogError](https://wails.io/docs/reference/runtime/log#logerror) +// logs the given message at the `error` log level. export function LogError(message: string): void; +// [LogFatal](https://wails.io/docs/reference/runtime/log#logfatal) +// logs the given message at the `fatal` log level. +// The application will quit after calling this method. export function LogFatal(message: string): void; +// [LogInfo](https://wails.io/docs/reference/runtime/log#loginfo) +// logs the given message at the `info` log level. export function LogInfo(message: string): void; +// [LogWarning](https://wails.io/docs/reference/runtime/log#logwarning) +// logs the given message at the `warning` log level. export function LogWarning(message: string): void; +// [WindowReload](https://wails.io/docs/reference/runtime/window#windowreload) +// Forces a reload by the main application as well as connected browsers. export function WindowReload(): void; +// [WindowSetSystemDefaultTheme](https://wails.io/docs/next/reference/runtime/window#windowsetsystemdefaulttheme) +// *Windows only* +// Sets window theme to system default (dark/light). export function WindowSetSystemDefaultTheme(): void; +// [WindowSetLightTheme](https://wails.io/docs/next/reference/runtime/window#windowsetlighttheme) +// *Windows only* +// Sets window to light theme. export function WindowSetLightTheme(): void; +// [WindowSetDarkTheme](https://wails.io/docs/next/reference/runtime/window#windowsetdarktheme) +// *Windows only* +// Sets window to dark theme. export function WindowSetDarkTheme(): void; +// [WindowCenter](https://wails.io/docs/reference/runtime/window#windowcenter) +// Centers the window on the monitor the window is currently on. export function WindowCenter(): void; +// [WindowSetTitle](https://wails.io/docs/reference/runtime/window#windowsettitle) +// Sets the text in the window title bar. export function WindowSetTitle(title: string): void; +// [WindowFullscreen](https://wails.io/docs/reference/runtime/window#windowfullscreen) +// Makes the window full screen. export function WindowFullscreen(): void; +// [WindowUnfullscreen](https://wails.io/docs/reference/runtime/window#windowunfullscreen) +// Restores the previous window dimensions and position prior to full screen. export function WindowUnfullscreen(): void; +// [WindowSetSize](https://wails.io/docs/reference/runtime/window#windowsetsize) +// Sets the width and height of the window. export function WindowSetSize(width: number, height: number): Promise; +// [WindowGetSize](https://wails.io/docs/reference/runtime/window#windowgetsize) +// Gets the width and height of the window. export function WindowGetSize(): Promise; +// [WindowSetMaxSize](https://wails.io/docs/reference/runtime/window#windowsetmaxsize) +// Sets the maximum window size. Will resize the window if the window is currently larger than the given dimensions. +// Setting a size of 0,0 will disable this constraint. export function WindowSetMaxSize(width: number, height: number): void; +// [WindowSetMinSize](https://wails.io/docs/reference/runtime/window#windowsetminsize) +// Sets the minimum window size. Will resize the window if the window is currently smaller than the given dimensions. +// Setting a size of 0,0 will disable this constraint. export function WindowSetMinSize(width: number, height: number): void; +// [WindowSetPosition](https://wails.io/docs/reference/runtime/window#windowsetposition) +// Sets the window position relative to the monitor the window is currently on. export function WindowSetPosition(x: number, y: number): void; +// [WindowGetPosition](https://wails.io/docs/reference/runtime/window#windowgetposition) +// Gets the window position relative to the monitor the window is currently on. export function WindowGetPosition(): Promise; +// [WindowHide](https://wails.io/docs/reference/runtime/window#windowhide) +// Hides the window. export function WindowHide(): void; +// [WindowShow](https://wails.io/docs/reference/runtime/window#windowshow) +// Shows the window, if it is currently hidden. export function WindowShow(): void; +// [WindowMaximise](https://wails.io/docs/reference/runtime/window#windowmaximise) +// Maximises the window to fill the screen. export function WindowMaximise(): void; +// [WindowToggleMaximise](https://wails.io/docs/reference/runtime/window#windowtogglemaximise) +// Toggles between Maximised and UnMaximised. export function WindowToggleMaximise(): void; +// [WindowUnmaximise](https://wails.io/docs/reference/runtime/window#windowunmaximise) +// Restores the window to the dimensions and position prior to maximising. export function WindowUnmaximise(): void; +// [WindowMinimise](https://wails.io/docs/reference/runtime/window#windowminimise) +// Minimises the window. export function WindowMinimise(): void; +// [WindowUnminimise](https://wails.io/docs/reference/runtime/window#windowunminimise) +// Restores the window to the dimensions and position prior to minimising. export function WindowUnminimise(): void; +// [WindowSetRGBA](https://wails.io/docs/reference/runtime/window#windowsetrgba) +// Sets the background colour of the window to the given RGBA colour definition. This colour will show through for all transparent pixels. export function WindowSetRGBA(R: number, G: number, B: number, A: number): void; +// [BrowserOpenURL](https://wails.io/docs/next/reference/runtime/browser#browseropenurl) +// Opens the given URL in the system browser. export function BrowserOpenURL(url: string): void; +// [Quit](https://wails.io/docs/next/reference/runtime/intro#quit) +// Quits the application. export function Quit(): void; diff --git a/v2/cmd/wails/internal/commands/initialise/templates/templates/react-ts/frontend/wailsjs/runtime/runtime.js b/v2/cmd/wails/internal/commands/initialise/templates/templates/react-ts/frontend/wailsjs/runtime/runtime.js index 0105feeb..9e602219 100644 --- a/v2/cmd/wails/internal/commands/initialise/templates/templates/react-ts/frontend/wailsjs/runtime/runtime.js +++ b/v2/cmd/wails/internal/commands/initialise/templates/templates/react-ts/frontend/wailsjs/runtime/runtime.js @@ -1,3 +1,17 @@ +/* + _ __ _ __ +| | / /___ _(_) /____ +| | /| / / __ `/ / / ___/ +| |/ |/ / /_/ / / (__ ) +|__/|__/\__,_/_/_/____/ +The electron alternative for Go +(c) Lea Anthony 2019-present +*/ + +export function LogPrint(message) { + window.runtime.LogPrint(message); +} + export function LogTrace(message) { window.runtime.LogTrace(message); } diff --git a/v2/cmd/wails/internal/commands/initialise/templates/templates/react/frontend/package.json b/v2/cmd/wails/internal/commands/initialise/templates/templates/react/frontend/package.json index dd9af35a..6ccd4766 100644 --- a/v2/cmd/wails/internal/commands/initialise/templates/templates/react/frontend/package.json +++ b/v2/cmd/wails/internal/commands/initialise/templates/templates/react/frontend/package.json @@ -15,6 +15,6 @@ "@types/react": "^18.0.0", "@types/react-dom": "^18.0.0", "@vitejs/plugin-react": "^1.3.0", - "vite": "^2.9.2" + "vite": "^2.9.5" } } \ No newline at end of file diff --git a/v2/cmd/wails/internal/commands/initialise/templates/templates/react/frontend/wailsjs/runtime/runtime.d.ts b/v2/cmd/wails/internal/commands/initialise/templates/templates/react/frontend/wailsjs/runtime/runtime.d.ts index 462cfab3..ed6cf378 100644 --- a/v2/cmd/wails/internal/commands/initialise/templates/templates/react/frontend/wailsjs/runtime/runtime.d.ts +++ b/v2/cmd/wails/internal/commands/initialise/templates/templates/react/frontend/wailsjs/runtime/runtime.d.ts @@ -1,3 +1,13 @@ +/* + _ __ _ __ +| | / /___ _(_) /____ +| | /| / / __ `/ / / ___/ +| |/ |/ / /_/ / / (__ ) +|__/|__/\__,_/_/_/____/ +The electron alternative for Go +(c) Lea Anthony 2019-present +*/ + export interface Position { x: number; y: number; @@ -9,72 +19,152 @@ export interface Size { } +// [EventsEmit](https://wails.io/docs/reference/runtime/events#eventsemit) +// emits the given event. Optional data may be passed with the event. +// This will trigger any event listeners. export function EventsEmit(eventName: string, data?: any): void; +// [EventsOn](https://wails.io/docs/reference/runtime/events#eventson) sets up a listener for the given event name. export function EventsOn(eventName: string, callback: (data?: any) => void): void; +// [EventsOnMultiple](https://wails.io/docs/reference/runtime/events#eventsonmultiple) +// sets up a listener for the given event name, but will only trigger a given number times. export function EventsOnMultiple(eventName: string, callback: (data?: any) => void, maxCallbacks: number): void; +// [EventsOnce](https://wails.io/docs/reference/runtime/events#eventsonce) +// sets up a listener for the given event name, but will only trigger once. export function EventsOnce(eventName: string, callback: (data?: any) => void): void; +// [EventsOff](https://wails.io/docs/reference/runtime/events#eventsff) +// unregisters the listener for the given event name. export function EventsOff(eventName: string): void; +// [LogPrint](https://wails.io/docs/reference/runtime/log#logprint) +// logs the given message as a raw message +export function LogPrint(message: string): void; + +// [LogTrace](https://wails.io/docs/reference/runtime/log#logtrace) +// logs the given message at the `trace` log level. export function LogTrace(message: string): void; +// [LogDebug](https://wails.io/docs/reference/runtime/log#logdebug) +// logs the given message at the `debug` log level. export function LogDebug(message: string): void; +// [LogError](https://wails.io/docs/reference/runtime/log#logerror) +// logs the given message at the `error` log level. export function LogError(message: string): void; +// [LogFatal](https://wails.io/docs/reference/runtime/log#logfatal) +// logs the given message at the `fatal` log level. +// The application will quit after calling this method. export function LogFatal(message: string): void; +// [LogInfo](https://wails.io/docs/reference/runtime/log#loginfo) +// logs the given message at the `info` log level. export function LogInfo(message: string): void; +// [LogWarning](https://wails.io/docs/reference/runtime/log#logwarning) +// logs the given message at the `warning` log level. export function LogWarning(message: string): void; +// [WindowReload](https://wails.io/docs/reference/runtime/window#windowreload) +// Forces a reload by the main application as well as connected browsers. export function WindowReload(): void; +// [WindowSetSystemDefaultTheme](https://wails.io/docs/next/reference/runtime/window#windowsetsystemdefaulttheme) +// *Windows only* +// Sets window theme to system default (dark/light). export function WindowSetSystemDefaultTheme(): void; +// [WindowSetLightTheme](https://wails.io/docs/next/reference/runtime/window#windowsetlighttheme) +// *Windows only* +// Sets window to light theme. export function WindowSetLightTheme(): void; +// [WindowSetDarkTheme](https://wails.io/docs/next/reference/runtime/window#windowsetdarktheme) +// *Windows only* +// Sets window to dark theme. export function WindowSetDarkTheme(): void; +// [WindowCenter](https://wails.io/docs/reference/runtime/window#windowcenter) +// Centers the window on the monitor the window is currently on. export function WindowCenter(): void; +// [WindowSetTitle](https://wails.io/docs/reference/runtime/window#windowsettitle) +// Sets the text in the window title bar. export function WindowSetTitle(title: string): void; +// [WindowFullscreen](https://wails.io/docs/reference/runtime/window#windowfullscreen) +// Makes the window full screen. export function WindowFullscreen(): void; +// [WindowUnfullscreen](https://wails.io/docs/reference/runtime/window#windowunfullscreen) +// Restores the previous window dimensions and position prior to full screen. export function WindowUnfullscreen(): void; +// [WindowSetSize](https://wails.io/docs/reference/runtime/window#windowsetsize) +// Sets the width and height of the window. export function WindowSetSize(width: number, height: number): Promise; +// [WindowGetSize](https://wails.io/docs/reference/runtime/window#windowgetsize) +// Gets the width and height of the window. export function WindowGetSize(): Promise; +// [WindowSetMaxSize](https://wails.io/docs/reference/runtime/window#windowsetmaxsize) +// Sets the maximum window size. Will resize the window if the window is currently larger than the given dimensions. +// Setting a size of 0,0 will disable this constraint. export function WindowSetMaxSize(width: number, height: number): void; +// [WindowSetMinSize](https://wails.io/docs/reference/runtime/window#windowsetminsize) +// Sets the minimum window size. Will resize the window if the window is currently smaller than the given dimensions. +// Setting a size of 0,0 will disable this constraint. export function WindowSetMinSize(width: number, height: number): void; +// [WindowSetPosition](https://wails.io/docs/reference/runtime/window#windowsetposition) +// Sets the window position relative to the monitor the window is currently on. export function WindowSetPosition(x: number, y: number): void; +// [WindowGetPosition](https://wails.io/docs/reference/runtime/window#windowgetposition) +// Gets the window position relative to the monitor the window is currently on. export function WindowGetPosition(): Promise; +// [WindowHide](https://wails.io/docs/reference/runtime/window#windowhide) +// Hides the window. export function WindowHide(): void; +// [WindowShow](https://wails.io/docs/reference/runtime/window#windowshow) +// Shows the window, if it is currently hidden. export function WindowShow(): void; +// [WindowMaximise](https://wails.io/docs/reference/runtime/window#windowmaximise) +// Maximises the window to fill the screen. export function WindowMaximise(): void; +// [WindowToggleMaximise](https://wails.io/docs/reference/runtime/window#windowtogglemaximise) +// Toggles between Maximised and UnMaximised. export function WindowToggleMaximise(): void; +// [WindowUnmaximise](https://wails.io/docs/reference/runtime/window#windowunmaximise) +// Restores the window to the dimensions and position prior to maximising. export function WindowUnmaximise(): void; +// [WindowMinimise](https://wails.io/docs/reference/runtime/window#windowminimise) +// Minimises the window. export function WindowMinimise(): void; +// [WindowUnminimise](https://wails.io/docs/reference/runtime/window#windowunminimise) +// Restores the window to the dimensions and position prior to minimising. export function WindowUnminimise(): void; +// [WindowSetRGBA](https://wails.io/docs/reference/runtime/window#windowsetrgba) +// Sets the background colour of the window to the given RGBA colour definition. This colour will show through for all transparent pixels. export function WindowSetRGBA(R: number, G: number, B: number, A: number): void; +// [BrowserOpenURL](https://wails.io/docs/next/reference/runtime/browser#browseropenurl) +// Opens the given URL in the system browser. export function BrowserOpenURL(url: string): void; +// [Quit](https://wails.io/docs/next/reference/runtime/intro#quit) +// Quits the application. export function Quit(): void; diff --git a/v2/cmd/wails/internal/commands/initialise/templates/templates/react/frontend/wailsjs/runtime/runtime.js b/v2/cmd/wails/internal/commands/initialise/templates/templates/react/frontend/wailsjs/runtime/runtime.js index 0105feeb..9e602219 100644 --- a/v2/cmd/wails/internal/commands/initialise/templates/templates/react/frontend/wailsjs/runtime/runtime.js +++ b/v2/cmd/wails/internal/commands/initialise/templates/templates/react/frontend/wailsjs/runtime/runtime.js @@ -1,3 +1,17 @@ +/* + _ __ _ __ +| | / /___ _(_) /____ +| | /| / / __ `/ / / ___/ +| |/ |/ / /_/ / / (__ ) +|__/|__/\__,_/_/_/____/ +The electron alternative for Go +(c) Lea Anthony 2019-present +*/ + +export function LogPrint(message) { + window.runtime.LogPrint(message); +} + export function LogTrace(message) { window.runtime.LogTrace(message); } diff --git a/v2/cmd/wails/internal/commands/initialise/templates/templates/svelte-ts/frontend/package.json b/v2/cmd/wails/internal/commands/initialise/templates/templates/svelte-ts/frontend/package.json index 125a0dcc..7fb9aecd 100644 --- a/v2/cmd/wails/internal/commands/initialise/templates/templates/svelte-ts/frontend/package.json +++ b/v2/cmd/wails/internal/commands/initialise/templates/templates/svelte-ts/frontend/package.json @@ -17,6 +17,6 @@ "svelte-preprocess": "^4.9.8", "tslib": "^2.3.1", "typescript": "^4.5.4", - "vite": "^2.9.2" + "vite": "^2.9.5" } } \ No newline at end of file diff --git a/v2/cmd/wails/internal/commands/initialise/templates/templates/svelte-ts/frontend/wailsjs/runtime/runtime.d.ts b/v2/cmd/wails/internal/commands/initialise/templates/templates/svelte-ts/frontend/wailsjs/runtime/runtime.d.ts index 462cfab3..ed6cf378 100644 --- a/v2/cmd/wails/internal/commands/initialise/templates/templates/svelte-ts/frontend/wailsjs/runtime/runtime.d.ts +++ b/v2/cmd/wails/internal/commands/initialise/templates/templates/svelte-ts/frontend/wailsjs/runtime/runtime.d.ts @@ -1,3 +1,13 @@ +/* + _ __ _ __ +| | / /___ _(_) /____ +| | /| / / __ `/ / / ___/ +| |/ |/ / /_/ / / (__ ) +|__/|__/\__,_/_/_/____/ +The electron alternative for Go +(c) Lea Anthony 2019-present +*/ + export interface Position { x: number; y: number; @@ -9,72 +19,152 @@ export interface Size { } +// [EventsEmit](https://wails.io/docs/reference/runtime/events#eventsemit) +// emits the given event. Optional data may be passed with the event. +// This will trigger any event listeners. export function EventsEmit(eventName: string, data?: any): void; +// [EventsOn](https://wails.io/docs/reference/runtime/events#eventson) sets up a listener for the given event name. export function EventsOn(eventName: string, callback: (data?: any) => void): void; +// [EventsOnMultiple](https://wails.io/docs/reference/runtime/events#eventsonmultiple) +// sets up a listener for the given event name, but will only trigger a given number times. export function EventsOnMultiple(eventName: string, callback: (data?: any) => void, maxCallbacks: number): void; +// [EventsOnce](https://wails.io/docs/reference/runtime/events#eventsonce) +// sets up a listener for the given event name, but will only trigger once. export function EventsOnce(eventName: string, callback: (data?: any) => void): void; +// [EventsOff](https://wails.io/docs/reference/runtime/events#eventsff) +// unregisters the listener for the given event name. export function EventsOff(eventName: string): void; +// [LogPrint](https://wails.io/docs/reference/runtime/log#logprint) +// logs the given message as a raw message +export function LogPrint(message: string): void; + +// [LogTrace](https://wails.io/docs/reference/runtime/log#logtrace) +// logs the given message at the `trace` log level. export function LogTrace(message: string): void; +// [LogDebug](https://wails.io/docs/reference/runtime/log#logdebug) +// logs the given message at the `debug` log level. export function LogDebug(message: string): void; +// [LogError](https://wails.io/docs/reference/runtime/log#logerror) +// logs the given message at the `error` log level. export function LogError(message: string): void; +// [LogFatal](https://wails.io/docs/reference/runtime/log#logfatal) +// logs the given message at the `fatal` log level. +// The application will quit after calling this method. export function LogFatal(message: string): void; +// [LogInfo](https://wails.io/docs/reference/runtime/log#loginfo) +// logs the given message at the `info` log level. export function LogInfo(message: string): void; +// [LogWarning](https://wails.io/docs/reference/runtime/log#logwarning) +// logs the given message at the `warning` log level. export function LogWarning(message: string): void; +// [WindowReload](https://wails.io/docs/reference/runtime/window#windowreload) +// Forces a reload by the main application as well as connected browsers. export function WindowReload(): void; +// [WindowSetSystemDefaultTheme](https://wails.io/docs/next/reference/runtime/window#windowsetsystemdefaulttheme) +// *Windows only* +// Sets window theme to system default (dark/light). export function WindowSetSystemDefaultTheme(): void; +// [WindowSetLightTheme](https://wails.io/docs/next/reference/runtime/window#windowsetlighttheme) +// *Windows only* +// Sets window to light theme. export function WindowSetLightTheme(): void; +// [WindowSetDarkTheme](https://wails.io/docs/next/reference/runtime/window#windowsetdarktheme) +// *Windows only* +// Sets window to dark theme. export function WindowSetDarkTheme(): void; +// [WindowCenter](https://wails.io/docs/reference/runtime/window#windowcenter) +// Centers the window on the monitor the window is currently on. export function WindowCenter(): void; +// [WindowSetTitle](https://wails.io/docs/reference/runtime/window#windowsettitle) +// Sets the text in the window title bar. export function WindowSetTitle(title: string): void; +// [WindowFullscreen](https://wails.io/docs/reference/runtime/window#windowfullscreen) +// Makes the window full screen. export function WindowFullscreen(): void; +// [WindowUnfullscreen](https://wails.io/docs/reference/runtime/window#windowunfullscreen) +// Restores the previous window dimensions and position prior to full screen. export function WindowUnfullscreen(): void; +// [WindowSetSize](https://wails.io/docs/reference/runtime/window#windowsetsize) +// Sets the width and height of the window. export function WindowSetSize(width: number, height: number): Promise; +// [WindowGetSize](https://wails.io/docs/reference/runtime/window#windowgetsize) +// Gets the width and height of the window. export function WindowGetSize(): Promise; +// [WindowSetMaxSize](https://wails.io/docs/reference/runtime/window#windowsetmaxsize) +// Sets the maximum window size. Will resize the window if the window is currently larger than the given dimensions. +// Setting a size of 0,0 will disable this constraint. export function WindowSetMaxSize(width: number, height: number): void; +// [WindowSetMinSize](https://wails.io/docs/reference/runtime/window#windowsetminsize) +// Sets the minimum window size. Will resize the window if the window is currently smaller than the given dimensions. +// Setting a size of 0,0 will disable this constraint. export function WindowSetMinSize(width: number, height: number): void; +// [WindowSetPosition](https://wails.io/docs/reference/runtime/window#windowsetposition) +// Sets the window position relative to the monitor the window is currently on. export function WindowSetPosition(x: number, y: number): void; +// [WindowGetPosition](https://wails.io/docs/reference/runtime/window#windowgetposition) +// Gets the window position relative to the monitor the window is currently on. export function WindowGetPosition(): Promise; +// [WindowHide](https://wails.io/docs/reference/runtime/window#windowhide) +// Hides the window. export function WindowHide(): void; +// [WindowShow](https://wails.io/docs/reference/runtime/window#windowshow) +// Shows the window, if it is currently hidden. export function WindowShow(): void; +// [WindowMaximise](https://wails.io/docs/reference/runtime/window#windowmaximise) +// Maximises the window to fill the screen. export function WindowMaximise(): void; +// [WindowToggleMaximise](https://wails.io/docs/reference/runtime/window#windowtogglemaximise) +// Toggles between Maximised and UnMaximised. export function WindowToggleMaximise(): void; +// [WindowUnmaximise](https://wails.io/docs/reference/runtime/window#windowunmaximise) +// Restores the window to the dimensions and position prior to maximising. export function WindowUnmaximise(): void; +// [WindowMinimise](https://wails.io/docs/reference/runtime/window#windowminimise) +// Minimises the window. export function WindowMinimise(): void; +// [WindowUnminimise](https://wails.io/docs/reference/runtime/window#windowunminimise) +// Restores the window to the dimensions and position prior to minimising. export function WindowUnminimise(): void; +// [WindowSetRGBA](https://wails.io/docs/reference/runtime/window#windowsetrgba) +// Sets the background colour of the window to the given RGBA colour definition. This colour will show through for all transparent pixels. export function WindowSetRGBA(R: number, G: number, B: number, A: number): void; +// [BrowserOpenURL](https://wails.io/docs/next/reference/runtime/browser#browseropenurl) +// Opens the given URL in the system browser. export function BrowserOpenURL(url: string): void; +// [Quit](https://wails.io/docs/next/reference/runtime/intro#quit) +// Quits the application. export function Quit(): void; diff --git a/v2/cmd/wails/internal/commands/initialise/templates/templates/svelte-ts/frontend/wailsjs/runtime/runtime.js b/v2/cmd/wails/internal/commands/initialise/templates/templates/svelte-ts/frontend/wailsjs/runtime/runtime.js index 0105feeb..9e602219 100644 --- a/v2/cmd/wails/internal/commands/initialise/templates/templates/svelte-ts/frontend/wailsjs/runtime/runtime.js +++ b/v2/cmd/wails/internal/commands/initialise/templates/templates/svelte-ts/frontend/wailsjs/runtime/runtime.js @@ -1,3 +1,17 @@ +/* + _ __ _ __ +| | / /___ _(_) /____ +| | /| / / __ `/ / / ___/ +| |/ |/ / /_/ / / (__ ) +|__/|__/\__,_/_/_/____/ +The electron alternative for Go +(c) Lea Anthony 2019-present +*/ + +export function LogPrint(message) { + window.runtime.LogPrint(message); +} + export function LogTrace(message) { window.runtime.LogTrace(message); } diff --git a/v2/cmd/wails/internal/commands/initialise/templates/templates/svelte/frontend/package.json b/v2/cmd/wails/internal/commands/initialise/templates/templates/svelte/frontend/package.json index 0baf72a1..c14404ab 100644 --- a/v2/cmd/wails/internal/commands/initialise/templates/templates/svelte/frontend/package.json +++ b/v2/cmd/wails/internal/commands/initialise/templates/templates/svelte/frontend/package.json @@ -11,6 +11,6 @@ "devDependencies": { "@sveltejs/vite-plugin-svelte": "^1.0.0-next.30", "svelte": "^3.44.0", - "vite": "^2.9.2" + "vite": "^2.9.5" } } \ No newline at end of file diff --git a/v2/cmd/wails/internal/commands/initialise/templates/templates/svelte/frontend/wailsjs/runtime/runtime.d.ts b/v2/cmd/wails/internal/commands/initialise/templates/templates/svelte/frontend/wailsjs/runtime/runtime.d.ts index 462cfab3..ed6cf378 100644 --- a/v2/cmd/wails/internal/commands/initialise/templates/templates/svelte/frontend/wailsjs/runtime/runtime.d.ts +++ b/v2/cmd/wails/internal/commands/initialise/templates/templates/svelte/frontend/wailsjs/runtime/runtime.d.ts @@ -1,3 +1,13 @@ +/* + _ __ _ __ +| | / /___ _(_) /____ +| | /| / / __ `/ / / ___/ +| |/ |/ / /_/ / / (__ ) +|__/|__/\__,_/_/_/____/ +The electron alternative for Go +(c) Lea Anthony 2019-present +*/ + export interface Position { x: number; y: number; @@ -9,72 +19,152 @@ export interface Size { } +// [EventsEmit](https://wails.io/docs/reference/runtime/events#eventsemit) +// emits the given event. Optional data may be passed with the event. +// This will trigger any event listeners. export function EventsEmit(eventName: string, data?: any): void; +// [EventsOn](https://wails.io/docs/reference/runtime/events#eventson) sets up a listener for the given event name. export function EventsOn(eventName: string, callback: (data?: any) => void): void; +// [EventsOnMultiple](https://wails.io/docs/reference/runtime/events#eventsonmultiple) +// sets up a listener for the given event name, but will only trigger a given number times. export function EventsOnMultiple(eventName: string, callback: (data?: any) => void, maxCallbacks: number): void; +// [EventsOnce](https://wails.io/docs/reference/runtime/events#eventsonce) +// sets up a listener for the given event name, but will only trigger once. export function EventsOnce(eventName: string, callback: (data?: any) => void): void; +// [EventsOff](https://wails.io/docs/reference/runtime/events#eventsff) +// unregisters the listener for the given event name. export function EventsOff(eventName: string): void; +// [LogPrint](https://wails.io/docs/reference/runtime/log#logprint) +// logs the given message as a raw message +export function LogPrint(message: string): void; + +// [LogTrace](https://wails.io/docs/reference/runtime/log#logtrace) +// logs the given message at the `trace` log level. export function LogTrace(message: string): void; +// [LogDebug](https://wails.io/docs/reference/runtime/log#logdebug) +// logs the given message at the `debug` log level. export function LogDebug(message: string): void; +// [LogError](https://wails.io/docs/reference/runtime/log#logerror) +// logs the given message at the `error` log level. export function LogError(message: string): void; +// [LogFatal](https://wails.io/docs/reference/runtime/log#logfatal) +// logs the given message at the `fatal` log level. +// The application will quit after calling this method. export function LogFatal(message: string): void; +// [LogInfo](https://wails.io/docs/reference/runtime/log#loginfo) +// logs the given message at the `info` log level. export function LogInfo(message: string): void; +// [LogWarning](https://wails.io/docs/reference/runtime/log#logwarning) +// logs the given message at the `warning` log level. export function LogWarning(message: string): void; +// [WindowReload](https://wails.io/docs/reference/runtime/window#windowreload) +// Forces a reload by the main application as well as connected browsers. export function WindowReload(): void; +// [WindowSetSystemDefaultTheme](https://wails.io/docs/next/reference/runtime/window#windowsetsystemdefaulttheme) +// *Windows only* +// Sets window theme to system default (dark/light). export function WindowSetSystemDefaultTheme(): void; +// [WindowSetLightTheme](https://wails.io/docs/next/reference/runtime/window#windowsetlighttheme) +// *Windows only* +// Sets window to light theme. export function WindowSetLightTheme(): void; +// [WindowSetDarkTheme](https://wails.io/docs/next/reference/runtime/window#windowsetdarktheme) +// *Windows only* +// Sets window to dark theme. export function WindowSetDarkTheme(): void; +// [WindowCenter](https://wails.io/docs/reference/runtime/window#windowcenter) +// Centers the window on the monitor the window is currently on. export function WindowCenter(): void; +// [WindowSetTitle](https://wails.io/docs/reference/runtime/window#windowsettitle) +// Sets the text in the window title bar. export function WindowSetTitle(title: string): void; +// [WindowFullscreen](https://wails.io/docs/reference/runtime/window#windowfullscreen) +// Makes the window full screen. export function WindowFullscreen(): void; +// [WindowUnfullscreen](https://wails.io/docs/reference/runtime/window#windowunfullscreen) +// Restores the previous window dimensions and position prior to full screen. export function WindowUnfullscreen(): void; +// [WindowSetSize](https://wails.io/docs/reference/runtime/window#windowsetsize) +// Sets the width and height of the window. export function WindowSetSize(width: number, height: number): Promise; +// [WindowGetSize](https://wails.io/docs/reference/runtime/window#windowgetsize) +// Gets the width and height of the window. export function WindowGetSize(): Promise; +// [WindowSetMaxSize](https://wails.io/docs/reference/runtime/window#windowsetmaxsize) +// Sets the maximum window size. Will resize the window if the window is currently larger than the given dimensions. +// Setting a size of 0,0 will disable this constraint. export function WindowSetMaxSize(width: number, height: number): void; +// [WindowSetMinSize](https://wails.io/docs/reference/runtime/window#windowsetminsize) +// Sets the minimum window size. Will resize the window if the window is currently smaller than the given dimensions. +// Setting a size of 0,0 will disable this constraint. export function WindowSetMinSize(width: number, height: number): void; +// [WindowSetPosition](https://wails.io/docs/reference/runtime/window#windowsetposition) +// Sets the window position relative to the monitor the window is currently on. export function WindowSetPosition(x: number, y: number): void; +// [WindowGetPosition](https://wails.io/docs/reference/runtime/window#windowgetposition) +// Gets the window position relative to the monitor the window is currently on. export function WindowGetPosition(): Promise; +// [WindowHide](https://wails.io/docs/reference/runtime/window#windowhide) +// Hides the window. export function WindowHide(): void; +// [WindowShow](https://wails.io/docs/reference/runtime/window#windowshow) +// Shows the window, if it is currently hidden. export function WindowShow(): void; +// [WindowMaximise](https://wails.io/docs/reference/runtime/window#windowmaximise) +// Maximises the window to fill the screen. export function WindowMaximise(): void; +// [WindowToggleMaximise](https://wails.io/docs/reference/runtime/window#windowtogglemaximise) +// Toggles between Maximised and UnMaximised. export function WindowToggleMaximise(): void; +// [WindowUnmaximise](https://wails.io/docs/reference/runtime/window#windowunmaximise) +// Restores the window to the dimensions and position prior to maximising. export function WindowUnmaximise(): void; +// [WindowMinimise](https://wails.io/docs/reference/runtime/window#windowminimise) +// Minimises the window. export function WindowMinimise(): void; +// [WindowUnminimise](https://wails.io/docs/reference/runtime/window#windowunminimise) +// Restores the window to the dimensions and position prior to minimising. export function WindowUnminimise(): void; +// [WindowSetRGBA](https://wails.io/docs/reference/runtime/window#windowsetrgba) +// Sets the background colour of the window to the given RGBA colour definition. This colour will show through for all transparent pixels. export function WindowSetRGBA(R: number, G: number, B: number, A: number): void; +// [BrowserOpenURL](https://wails.io/docs/next/reference/runtime/browser#browseropenurl) +// Opens the given URL in the system browser. export function BrowserOpenURL(url: string): void; +// [Quit](https://wails.io/docs/next/reference/runtime/intro#quit) +// Quits the application. export function Quit(): void; diff --git a/v2/cmd/wails/internal/commands/initialise/templates/templates/svelte/frontend/wailsjs/runtime/runtime.js b/v2/cmd/wails/internal/commands/initialise/templates/templates/svelte/frontend/wailsjs/runtime/runtime.js index 0105feeb..9e602219 100644 --- a/v2/cmd/wails/internal/commands/initialise/templates/templates/svelte/frontend/wailsjs/runtime/runtime.js +++ b/v2/cmd/wails/internal/commands/initialise/templates/templates/svelte/frontend/wailsjs/runtime/runtime.js @@ -1,3 +1,17 @@ +/* + _ __ _ __ +| | / /___ _(_) /____ +| | /| / / __ `/ / / ___/ +| |/ |/ / /_/ / / (__ ) +|__/|__/\__,_/_/_/____/ +The electron alternative for Go +(c) Lea Anthony 2019-present +*/ + +export function LogPrint(message) { + window.runtime.LogPrint(message); +} + export function LogTrace(message) { window.runtime.LogTrace(message); } diff --git a/v2/cmd/wails/internal/commands/initialise/templates/templates/vanilla-ts/frontend/package.json b/v2/cmd/wails/internal/commands/initialise/templates/templates/vanilla-ts/frontend/package.json index 5ad43e85..7cf9f3e2 100644 --- a/v2/cmd/wails/internal/commands/initialise/templates/templates/vanilla-ts/frontend/package.json +++ b/v2/cmd/wails/internal/commands/initialise/templates/templates/vanilla-ts/frontend/package.json @@ -9,6 +9,6 @@ }, "devDependencies": { "typescript": "^4.5.4", - "vite": "^2.9.2" + "vite": "^2.9.5" } } \ No newline at end of file diff --git a/v2/cmd/wails/internal/commands/initialise/templates/templates/vanilla-ts/frontend/tsconfig.json b/v2/cmd/wails/internal/commands/initialise/templates/templates/vanilla-ts/frontend/tsconfig.json index 3865e3cb..62645742 100644 --- a/v2/cmd/wails/internal/commands/initialise/templates/templates/vanilla-ts/frontend/tsconfig.json +++ b/v2/cmd/wails/internal/commands/initialise/templates/templates/vanilla-ts/frontend/tsconfig.json @@ -16,7 +16,8 @@ "noEmit": true, "noUnusedLocals": true, "noUnusedParameters": true, - "noImplicitReturns": true + "noImplicitReturns": true, + "skipLibCheck": true }, "include": [ "src" diff --git a/v2/cmd/wails/internal/commands/initialise/templates/templates/vanilla-ts/frontend/wailsjs/runtime/runtime.d.ts b/v2/cmd/wails/internal/commands/initialise/templates/templates/vanilla-ts/frontend/wailsjs/runtime/runtime.d.ts index 462cfab3..ed6cf378 100644 --- a/v2/cmd/wails/internal/commands/initialise/templates/templates/vanilla-ts/frontend/wailsjs/runtime/runtime.d.ts +++ b/v2/cmd/wails/internal/commands/initialise/templates/templates/vanilla-ts/frontend/wailsjs/runtime/runtime.d.ts @@ -1,3 +1,13 @@ +/* + _ __ _ __ +| | / /___ _(_) /____ +| | /| / / __ `/ / / ___/ +| |/ |/ / /_/ / / (__ ) +|__/|__/\__,_/_/_/____/ +The electron alternative for Go +(c) Lea Anthony 2019-present +*/ + export interface Position { x: number; y: number; @@ -9,72 +19,152 @@ export interface Size { } +// [EventsEmit](https://wails.io/docs/reference/runtime/events#eventsemit) +// emits the given event. Optional data may be passed with the event. +// This will trigger any event listeners. export function EventsEmit(eventName: string, data?: any): void; +// [EventsOn](https://wails.io/docs/reference/runtime/events#eventson) sets up a listener for the given event name. export function EventsOn(eventName: string, callback: (data?: any) => void): void; +// [EventsOnMultiple](https://wails.io/docs/reference/runtime/events#eventsonmultiple) +// sets up a listener for the given event name, but will only trigger a given number times. export function EventsOnMultiple(eventName: string, callback: (data?: any) => void, maxCallbacks: number): void; +// [EventsOnce](https://wails.io/docs/reference/runtime/events#eventsonce) +// sets up a listener for the given event name, but will only trigger once. export function EventsOnce(eventName: string, callback: (data?: any) => void): void; +// [EventsOff](https://wails.io/docs/reference/runtime/events#eventsff) +// unregisters the listener for the given event name. export function EventsOff(eventName: string): void; +// [LogPrint](https://wails.io/docs/reference/runtime/log#logprint) +// logs the given message as a raw message +export function LogPrint(message: string): void; + +// [LogTrace](https://wails.io/docs/reference/runtime/log#logtrace) +// logs the given message at the `trace` log level. export function LogTrace(message: string): void; +// [LogDebug](https://wails.io/docs/reference/runtime/log#logdebug) +// logs the given message at the `debug` log level. export function LogDebug(message: string): void; +// [LogError](https://wails.io/docs/reference/runtime/log#logerror) +// logs the given message at the `error` log level. export function LogError(message: string): void; +// [LogFatal](https://wails.io/docs/reference/runtime/log#logfatal) +// logs the given message at the `fatal` log level. +// The application will quit after calling this method. export function LogFatal(message: string): void; +// [LogInfo](https://wails.io/docs/reference/runtime/log#loginfo) +// logs the given message at the `info` log level. export function LogInfo(message: string): void; +// [LogWarning](https://wails.io/docs/reference/runtime/log#logwarning) +// logs the given message at the `warning` log level. export function LogWarning(message: string): void; +// [WindowReload](https://wails.io/docs/reference/runtime/window#windowreload) +// Forces a reload by the main application as well as connected browsers. export function WindowReload(): void; +// [WindowSetSystemDefaultTheme](https://wails.io/docs/next/reference/runtime/window#windowsetsystemdefaulttheme) +// *Windows only* +// Sets window theme to system default (dark/light). export function WindowSetSystemDefaultTheme(): void; +// [WindowSetLightTheme](https://wails.io/docs/next/reference/runtime/window#windowsetlighttheme) +// *Windows only* +// Sets window to light theme. export function WindowSetLightTheme(): void; +// [WindowSetDarkTheme](https://wails.io/docs/next/reference/runtime/window#windowsetdarktheme) +// *Windows only* +// Sets window to dark theme. export function WindowSetDarkTheme(): void; +// [WindowCenter](https://wails.io/docs/reference/runtime/window#windowcenter) +// Centers the window on the monitor the window is currently on. export function WindowCenter(): void; +// [WindowSetTitle](https://wails.io/docs/reference/runtime/window#windowsettitle) +// Sets the text in the window title bar. export function WindowSetTitle(title: string): void; +// [WindowFullscreen](https://wails.io/docs/reference/runtime/window#windowfullscreen) +// Makes the window full screen. export function WindowFullscreen(): void; +// [WindowUnfullscreen](https://wails.io/docs/reference/runtime/window#windowunfullscreen) +// Restores the previous window dimensions and position prior to full screen. export function WindowUnfullscreen(): void; +// [WindowSetSize](https://wails.io/docs/reference/runtime/window#windowsetsize) +// Sets the width and height of the window. export function WindowSetSize(width: number, height: number): Promise; +// [WindowGetSize](https://wails.io/docs/reference/runtime/window#windowgetsize) +// Gets the width and height of the window. export function WindowGetSize(): Promise; +// [WindowSetMaxSize](https://wails.io/docs/reference/runtime/window#windowsetmaxsize) +// Sets the maximum window size. Will resize the window if the window is currently larger than the given dimensions. +// Setting a size of 0,0 will disable this constraint. export function WindowSetMaxSize(width: number, height: number): void; +// [WindowSetMinSize](https://wails.io/docs/reference/runtime/window#windowsetminsize) +// Sets the minimum window size. Will resize the window if the window is currently smaller than the given dimensions. +// Setting a size of 0,0 will disable this constraint. export function WindowSetMinSize(width: number, height: number): void; +// [WindowSetPosition](https://wails.io/docs/reference/runtime/window#windowsetposition) +// Sets the window position relative to the monitor the window is currently on. export function WindowSetPosition(x: number, y: number): void; +// [WindowGetPosition](https://wails.io/docs/reference/runtime/window#windowgetposition) +// Gets the window position relative to the monitor the window is currently on. export function WindowGetPosition(): Promise; +// [WindowHide](https://wails.io/docs/reference/runtime/window#windowhide) +// Hides the window. export function WindowHide(): void; +// [WindowShow](https://wails.io/docs/reference/runtime/window#windowshow) +// Shows the window, if it is currently hidden. export function WindowShow(): void; +// [WindowMaximise](https://wails.io/docs/reference/runtime/window#windowmaximise) +// Maximises the window to fill the screen. export function WindowMaximise(): void; +// [WindowToggleMaximise](https://wails.io/docs/reference/runtime/window#windowtogglemaximise) +// Toggles between Maximised and UnMaximised. export function WindowToggleMaximise(): void; +// [WindowUnmaximise](https://wails.io/docs/reference/runtime/window#windowunmaximise) +// Restores the window to the dimensions and position prior to maximising. export function WindowUnmaximise(): void; +// [WindowMinimise](https://wails.io/docs/reference/runtime/window#windowminimise) +// Minimises the window. export function WindowMinimise(): void; +// [WindowUnminimise](https://wails.io/docs/reference/runtime/window#windowunminimise) +// Restores the window to the dimensions and position prior to minimising. export function WindowUnminimise(): void; +// [WindowSetRGBA](https://wails.io/docs/reference/runtime/window#windowsetrgba) +// Sets the background colour of the window to the given RGBA colour definition. This colour will show through for all transparent pixels. export function WindowSetRGBA(R: number, G: number, B: number, A: number): void; +// [BrowserOpenURL](https://wails.io/docs/next/reference/runtime/browser#browseropenurl) +// Opens the given URL in the system browser. export function BrowserOpenURL(url: string): void; +// [Quit](https://wails.io/docs/next/reference/runtime/intro#quit) +// Quits the application. export function Quit(): void; diff --git a/v2/cmd/wails/internal/commands/initialise/templates/templates/vanilla-ts/frontend/wailsjs/runtime/runtime.js b/v2/cmd/wails/internal/commands/initialise/templates/templates/vanilla-ts/frontend/wailsjs/runtime/runtime.js index 0105feeb..9e602219 100644 --- a/v2/cmd/wails/internal/commands/initialise/templates/templates/vanilla-ts/frontend/wailsjs/runtime/runtime.js +++ b/v2/cmd/wails/internal/commands/initialise/templates/templates/vanilla-ts/frontend/wailsjs/runtime/runtime.js @@ -1,3 +1,17 @@ +/* + _ __ _ __ +| | / /___ _(_) /____ +| | /| / / __ `/ / / ___/ +| |/ |/ / /_/ / / (__ ) +|__/|__/\__,_/_/_/____/ +The electron alternative for Go +(c) Lea Anthony 2019-present +*/ + +export function LogPrint(message) { + window.runtime.LogPrint(message); +} + export function LogTrace(message) { window.runtime.LogTrace(message); } diff --git a/v2/cmd/wails/internal/commands/initialise/templates/templates/vanilla/frontend/package.json b/v2/cmd/wails/internal/commands/initialise/templates/templates/vanilla/frontend/package.json index 796b1b31..b1420743 100644 --- a/v2/cmd/wails/internal/commands/initialise/templates/templates/vanilla/frontend/package.json +++ b/v2/cmd/wails/internal/commands/initialise/templates/templates/vanilla/frontend/package.json @@ -8,6 +8,6 @@ "preview": "vite preview" }, "devDependencies": { - "vite": "^2.9.2" + "vite": "^2.9.5" } } \ No newline at end of file diff --git a/v2/cmd/wails/internal/commands/initialise/templates/templates/vanilla/frontend/wailsjs/runtime/runtime.d.ts b/v2/cmd/wails/internal/commands/initialise/templates/templates/vanilla/frontend/wailsjs/runtime/runtime.d.ts index 462cfab3..ed6cf378 100644 --- a/v2/cmd/wails/internal/commands/initialise/templates/templates/vanilla/frontend/wailsjs/runtime/runtime.d.ts +++ b/v2/cmd/wails/internal/commands/initialise/templates/templates/vanilla/frontend/wailsjs/runtime/runtime.d.ts @@ -1,3 +1,13 @@ +/* + _ __ _ __ +| | / /___ _(_) /____ +| | /| / / __ `/ / / ___/ +| |/ |/ / /_/ / / (__ ) +|__/|__/\__,_/_/_/____/ +The electron alternative for Go +(c) Lea Anthony 2019-present +*/ + export interface Position { x: number; y: number; @@ -9,72 +19,152 @@ export interface Size { } +// [EventsEmit](https://wails.io/docs/reference/runtime/events#eventsemit) +// emits the given event. Optional data may be passed with the event. +// This will trigger any event listeners. export function EventsEmit(eventName: string, data?: any): void; +// [EventsOn](https://wails.io/docs/reference/runtime/events#eventson) sets up a listener for the given event name. export function EventsOn(eventName: string, callback: (data?: any) => void): void; +// [EventsOnMultiple](https://wails.io/docs/reference/runtime/events#eventsonmultiple) +// sets up a listener for the given event name, but will only trigger a given number times. export function EventsOnMultiple(eventName: string, callback: (data?: any) => void, maxCallbacks: number): void; +// [EventsOnce](https://wails.io/docs/reference/runtime/events#eventsonce) +// sets up a listener for the given event name, but will only trigger once. export function EventsOnce(eventName: string, callback: (data?: any) => void): void; +// [EventsOff](https://wails.io/docs/reference/runtime/events#eventsff) +// unregisters the listener for the given event name. export function EventsOff(eventName: string): void; +// [LogPrint](https://wails.io/docs/reference/runtime/log#logprint) +// logs the given message as a raw message +export function LogPrint(message: string): void; + +// [LogTrace](https://wails.io/docs/reference/runtime/log#logtrace) +// logs the given message at the `trace` log level. export function LogTrace(message: string): void; +// [LogDebug](https://wails.io/docs/reference/runtime/log#logdebug) +// logs the given message at the `debug` log level. export function LogDebug(message: string): void; +// [LogError](https://wails.io/docs/reference/runtime/log#logerror) +// logs the given message at the `error` log level. export function LogError(message: string): void; +// [LogFatal](https://wails.io/docs/reference/runtime/log#logfatal) +// logs the given message at the `fatal` log level. +// The application will quit after calling this method. export function LogFatal(message: string): void; +// [LogInfo](https://wails.io/docs/reference/runtime/log#loginfo) +// logs the given message at the `info` log level. export function LogInfo(message: string): void; +// [LogWarning](https://wails.io/docs/reference/runtime/log#logwarning) +// logs the given message at the `warning` log level. export function LogWarning(message: string): void; +// [WindowReload](https://wails.io/docs/reference/runtime/window#windowreload) +// Forces a reload by the main application as well as connected browsers. export function WindowReload(): void; +// [WindowSetSystemDefaultTheme](https://wails.io/docs/next/reference/runtime/window#windowsetsystemdefaulttheme) +// *Windows only* +// Sets window theme to system default (dark/light). export function WindowSetSystemDefaultTheme(): void; +// [WindowSetLightTheme](https://wails.io/docs/next/reference/runtime/window#windowsetlighttheme) +// *Windows only* +// Sets window to light theme. export function WindowSetLightTheme(): void; +// [WindowSetDarkTheme](https://wails.io/docs/next/reference/runtime/window#windowsetdarktheme) +// *Windows only* +// Sets window to dark theme. export function WindowSetDarkTheme(): void; +// [WindowCenter](https://wails.io/docs/reference/runtime/window#windowcenter) +// Centers the window on the monitor the window is currently on. export function WindowCenter(): void; +// [WindowSetTitle](https://wails.io/docs/reference/runtime/window#windowsettitle) +// Sets the text in the window title bar. export function WindowSetTitle(title: string): void; +// [WindowFullscreen](https://wails.io/docs/reference/runtime/window#windowfullscreen) +// Makes the window full screen. export function WindowFullscreen(): void; +// [WindowUnfullscreen](https://wails.io/docs/reference/runtime/window#windowunfullscreen) +// Restores the previous window dimensions and position prior to full screen. export function WindowUnfullscreen(): void; +// [WindowSetSize](https://wails.io/docs/reference/runtime/window#windowsetsize) +// Sets the width and height of the window. export function WindowSetSize(width: number, height: number): Promise; +// [WindowGetSize](https://wails.io/docs/reference/runtime/window#windowgetsize) +// Gets the width and height of the window. export function WindowGetSize(): Promise; +// [WindowSetMaxSize](https://wails.io/docs/reference/runtime/window#windowsetmaxsize) +// Sets the maximum window size. Will resize the window if the window is currently larger than the given dimensions. +// Setting a size of 0,0 will disable this constraint. export function WindowSetMaxSize(width: number, height: number): void; +// [WindowSetMinSize](https://wails.io/docs/reference/runtime/window#windowsetminsize) +// Sets the minimum window size. Will resize the window if the window is currently smaller than the given dimensions. +// Setting a size of 0,0 will disable this constraint. export function WindowSetMinSize(width: number, height: number): void; +// [WindowSetPosition](https://wails.io/docs/reference/runtime/window#windowsetposition) +// Sets the window position relative to the monitor the window is currently on. export function WindowSetPosition(x: number, y: number): void; +// [WindowGetPosition](https://wails.io/docs/reference/runtime/window#windowgetposition) +// Gets the window position relative to the monitor the window is currently on. export function WindowGetPosition(): Promise; +// [WindowHide](https://wails.io/docs/reference/runtime/window#windowhide) +// Hides the window. export function WindowHide(): void; +// [WindowShow](https://wails.io/docs/reference/runtime/window#windowshow) +// Shows the window, if it is currently hidden. export function WindowShow(): void; +// [WindowMaximise](https://wails.io/docs/reference/runtime/window#windowmaximise) +// Maximises the window to fill the screen. export function WindowMaximise(): void; +// [WindowToggleMaximise](https://wails.io/docs/reference/runtime/window#windowtogglemaximise) +// Toggles between Maximised and UnMaximised. export function WindowToggleMaximise(): void; +// [WindowUnmaximise](https://wails.io/docs/reference/runtime/window#windowunmaximise) +// Restores the window to the dimensions and position prior to maximising. export function WindowUnmaximise(): void; +// [WindowMinimise](https://wails.io/docs/reference/runtime/window#windowminimise) +// Minimises the window. export function WindowMinimise(): void; +// [WindowUnminimise](https://wails.io/docs/reference/runtime/window#windowunminimise) +// Restores the window to the dimensions and position prior to minimising. export function WindowUnminimise(): void; +// [WindowSetRGBA](https://wails.io/docs/reference/runtime/window#windowsetrgba) +// Sets the background colour of the window to the given RGBA colour definition. This colour will show through for all transparent pixels. export function WindowSetRGBA(R: number, G: number, B: number, A: number): void; +// [BrowserOpenURL](https://wails.io/docs/next/reference/runtime/browser#browseropenurl) +// Opens the given URL in the system browser. export function BrowserOpenURL(url: string): void; +// [Quit](https://wails.io/docs/next/reference/runtime/intro#quit) +// Quits the application. export function Quit(): void; diff --git a/v2/cmd/wails/internal/commands/initialise/templates/templates/vanilla/frontend/wailsjs/runtime/runtime.js b/v2/cmd/wails/internal/commands/initialise/templates/templates/vanilla/frontend/wailsjs/runtime/runtime.js index 0105feeb..9e602219 100644 --- a/v2/cmd/wails/internal/commands/initialise/templates/templates/vanilla/frontend/wailsjs/runtime/runtime.js +++ b/v2/cmd/wails/internal/commands/initialise/templates/templates/vanilla/frontend/wailsjs/runtime/runtime.js @@ -1,3 +1,17 @@ +/* + _ __ _ __ +| | / /___ _(_) /____ +| | /| / / __ `/ / / ___/ +| |/ |/ / /_/ / / (__ ) +|__/|__/\__,_/_/_/____/ +The electron alternative for Go +(c) Lea Anthony 2019-present +*/ + +export function LogPrint(message) { + window.runtime.LogPrint(message); +} + export function LogTrace(message) { window.runtime.LogTrace(message); } 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 20d846b8..bb8558a5 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 @@ -13,7 +13,7 @@ "devDependencies": { "@vitejs/plugin-vue": "^2.3.1", "typescript": "^4.5.4", - "vite": "^2.9.2", - "vue-tsc": "^0.29.8" + "vite": "^2.9.5", + "vue-tsc": "^0.34.7" } } \ No newline at end of file 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 462cfab3..ed6cf378 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 @@ -1,3 +1,13 @@ +/* + _ __ _ __ +| | / /___ _(_) /____ +| | /| / / __ `/ / / ___/ +| |/ |/ / /_/ / / (__ ) +|__/|__/\__,_/_/_/____/ +The electron alternative for Go +(c) Lea Anthony 2019-present +*/ + export interface Position { x: number; y: number; @@ -9,72 +19,152 @@ export interface Size { } +// [EventsEmit](https://wails.io/docs/reference/runtime/events#eventsemit) +// emits the given event. Optional data may be passed with the event. +// This will trigger any event listeners. export function EventsEmit(eventName: string, data?: any): void; +// [EventsOn](https://wails.io/docs/reference/runtime/events#eventson) sets up a listener for the given event name. export function EventsOn(eventName: string, callback: (data?: any) => void): void; +// [EventsOnMultiple](https://wails.io/docs/reference/runtime/events#eventsonmultiple) +// sets up a listener for the given event name, but will only trigger a given number times. export function EventsOnMultiple(eventName: string, callback: (data?: any) => void, maxCallbacks: number): void; +// [EventsOnce](https://wails.io/docs/reference/runtime/events#eventsonce) +// sets up a listener for the given event name, but will only trigger once. export function EventsOnce(eventName: string, callback: (data?: any) => void): void; +// [EventsOff](https://wails.io/docs/reference/runtime/events#eventsff) +// unregisters the listener for the given event name. export function EventsOff(eventName: string): void; +// [LogPrint](https://wails.io/docs/reference/runtime/log#logprint) +// logs the given message as a raw message +export function LogPrint(message: string): void; + +// [LogTrace](https://wails.io/docs/reference/runtime/log#logtrace) +// logs the given message at the `trace` log level. export function LogTrace(message: string): void; +// [LogDebug](https://wails.io/docs/reference/runtime/log#logdebug) +// logs the given message at the `debug` log level. export function LogDebug(message: string): void; +// [LogError](https://wails.io/docs/reference/runtime/log#logerror) +// logs the given message at the `error` log level. export function LogError(message: string): void; +// [LogFatal](https://wails.io/docs/reference/runtime/log#logfatal) +// logs the given message at the `fatal` log level. +// The application will quit after calling this method. export function LogFatal(message: string): void; +// [LogInfo](https://wails.io/docs/reference/runtime/log#loginfo) +// logs the given message at the `info` log level. export function LogInfo(message: string): void; +// [LogWarning](https://wails.io/docs/reference/runtime/log#logwarning) +// logs the given message at the `warning` log level. export function LogWarning(message: string): void; +// [WindowReload](https://wails.io/docs/reference/runtime/window#windowreload) +// Forces a reload by the main application as well as connected browsers. export function WindowReload(): void; +// [WindowSetSystemDefaultTheme](https://wails.io/docs/next/reference/runtime/window#windowsetsystemdefaulttheme) +// *Windows only* +// Sets window theme to system default (dark/light). export function WindowSetSystemDefaultTheme(): void; +// [WindowSetLightTheme](https://wails.io/docs/next/reference/runtime/window#windowsetlighttheme) +// *Windows only* +// Sets window to light theme. export function WindowSetLightTheme(): void; +// [WindowSetDarkTheme](https://wails.io/docs/next/reference/runtime/window#windowsetdarktheme) +// *Windows only* +// Sets window to dark theme. export function WindowSetDarkTheme(): void; +// [WindowCenter](https://wails.io/docs/reference/runtime/window#windowcenter) +// Centers the window on the monitor the window is currently on. export function WindowCenter(): void; +// [WindowSetTitle](https://wails.io/docs/reference/runtime/window#windowsettitle) +// Sets the text in the window title bar. export function WindowSetTitle(title: string): void; +// [WindowFullscreen](https://wails.io/docs/reference/runtime/window#windowfullscreen) +// Makes the window full screen. export function WindowFullscreen(): void; +// [WindowUnfullscreen](https://wails.io/docs/reference/runtime/window#windowunfullscreen) +// Restores the previous window dimensions and position prior to full screen. export function WindowUnfullscreen(): void; +// [WindowSetSize](https://wails.io/docs/reference/runtime/window#windowsetsize) +// Sets the width and height of the window. export function WindowSetSize(width: number, height: number): Promise; +// [WindowGetSize](https://wails.io/docs/reference/runtime/window#windowgetsize) +// Gets the width and height of the window. export function WindowGetSize(): Promise; +// [WindowSetMaxSize](https://wails.io/docs/reference/runtime/window#windowsetmaxsize) +// Sets the maximum window size. Will resize the window if the window is currently larger than the given dimensions. +// Setting a size of 0,0 will disable this constraint. export function WindowSetMaxSize(width: number, height: number): void; +// [WindowSetMinSize](https://wails.io/docs/reference/runtime/window#windowsetminsize) +// Sets the minimum window size. Will resize the window if the window is currently smaller than the given dimensions. +// Setting a size of 0,0 will disable this constraint. export function WindowSetMinSize(width: number, height: number): void; +// [WindowSetPosition](https://wails.io/docs/reference/runtime/window#windowsetposition) +// Sets the window position relative to the monitor the window is currently on. export function WindowSetPosition(x: number, y: number): void; +// [WindowGetPosition](https://wails.io/docs/reference/runtime/window#windowgetposition) +// Gets the window position relative to the monitor the window is currently on. export function WindowGetPosition(): Promise; +// [WindowHide](https://wails.io/docs/reference/runtime/window#windowhide) +// Hides the window. export function WindowHide(): void; +// [WindowShow](https://wails.io/docs/reference/runtime/window#windowshow) +// Shows the window, if it is currently hidden. export function WindowShow(): void; +// [WindowMaximise](https://wails.io/docs/reference/runtime/window#windowmaximise) +// Maximises the window to fill the screen. export function WindowMaximise(): void; +// [WindowToggleMaximise](https://wails.io/docs/reference/runtime/window#windowtogglemaximise) +// Toggles between Maximised and UnMaximised. export function WindowToggleMaximise(): void; +// [WindowUnmaximise](https://wails.io/docs/reference/runtime/window#windowunmaximise) +// Restores the window to the dimensions and position prior to maximising. export function WindowUnmaximise(): void; +// [WindowMinimise](https://wails.io/docs/reference/runtime/window#windowminimise) +// Minimises the window. export function WindowMinimise(): void; +// [WindowUnminimise](https://wails.io/docs/reference/runtime/window#windowunminimise) +// Restores the window to the dimensions and position prior to minimising. export function WindowUnminimise(): void; +// [WindowSetRGBA](https://wails.io/docs/reference/runtime/window#windowsetrgba) +// Sets the background colour of the window to the given RGBA colour definition. This colour will show through for all transparent pixels. export function WindowSetRGBA(R: number, G: number, B: number, A: number): void; +// [BrowserOpenURL](https://wails.io/docs/next/reference/runtime/browser#browseropenurl) +// Opens the given URL in the system browser. export function BrowserOpenURL(url: string): void; +// [Quit](https://wails.io/docs/next/reference/runtime/intro#quit) +// Quits the application. export function Quit(): 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 0105feeb..9e602219 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 @@ -1,3 +1,17 @@ +/* + _ __ _ __ +| | / /___ _(_) /____ +| | /| / / __ `/ / / ___/ +| |/ |/ / /_/ / / (__ ) +|__/|__/\__,_/_/_/____/ +The electron alternative for Go +(c) Lea Anthony 2019-present +*/ + +export function LogPrint(message) { + window.runtime.LogPrint(message); +} + export function LogTrace(message) { window.runtime.LogTrace(message); } 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 ef349195..c0f98263 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 @@ -12,6 +12,6 @@ }, "devDependencies": { "@vitejs/plugin-vue": "^2.3.1", - "vite": "^2.9.2" + "vite": "^2.9.5" } } \ 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 462cfab3..ed6cf378 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 @@ -1,3 +1,13 @@ +/* + _ __ _ __ +| | / /___ _(_) /____ +| | /| / / __ `/ / / ___/ +| |/ |/ / /_/ / / (__ ) +|__/|__/\__,_/_/_/____/ +The electron alternative for Go +(c) Lea Anthony 2019-present +*/ + export interface Position { x: number; y: number; @@ -9,72 +19,152 @@ export interface Size { } +// [EventsEmit](https://wails.io/docs/reference/runtime/events#eventsemit) +// emits the given event. Optional data may be passed with the event. +// This will trigger any event listeners. export function EventsEmit(eventName: string, data?: any): void; +// [EventsOn](https://wails.io/docs/reference/runtime/events#eventson) sets up a listener for the given event name. export function EventsOn(eventName: string, callback: (data?: any) => void): void; +// [EventsOnMultiple](https://wails.io/docs/reference/runtime/events#eventsonmultiple) +// sets up a listener for the given event name, but will only trigger a given number times. export function EventsOnMultiple(eventName: string, callback: (data?: any) => void, maxCallbacks: number): void; +// [EventsOnce](https://wails.io/docs/reference/runtime/events#eventsonce) +// sets up a listener for the given event name, but will only trigger once. export function EventsOnce(eventName: string, callback: (data?: any) => void): void; +// [EventsOff](https://wails.io/docs/reference/runtime/events#eventsff) +// unregisters the listener for the given event name. export function EventsOff(eventName: string): void; +// [LogPrint](https://wails.io/docs/reference/runtime/log#logprint) +// logs the given message as a raw message +export function LogPrint(message: string): void; + +// [LogTrace](https://wails.io/docs/reference/runtime/log#logtrace) +// logs the given message at the `trace` log level. export function LogTrace(message: string): void; +// [LogDebug](https://wails.io/docs/reference/runtime/log#logdebug) +// logs the given message at the `debug` log level. export function LogDebug(message: string): void; +// [LogError](https://wails.io/docs/reference/runtime/log#logerror) +// logs the given message at the `error` log level. export function LogError(message: string): void; +// [LogFatal](https://wails.io/docs/reference/runtime/log#logfatal) +// logs the given message at the `fatal` log level. +// The application will quit after calling this method. export function LogFatal(message: string): void; +// [LogInfo](https://wails.io/docs/reference/runtime/log#loginfo) +// logs the given message at the `info` log level. export function LogInfo(message: string): void; +// [LogWarning](https://wails.io/docs/reference/runtime/log#logwarning) +// logs the given message at the `warning` log level. export function LogWarning(message: string): void; +// [WindowReload](https://wails.io/docs/reference/runtime/window#windowreload) +// Forces a reload by the main application as well as connected browsers. export function WindowReload(): void; +// [WindowSetSystemDefaultTheme](https://wails.io/docs/next/reference/runtime/window#windowsetsystemdefaulttheme) +// *Windows only* +// Sets window theme to system default (dark/light). export function WindowSetSystemDefaultTheme(): void; +// [WindowSetLightTheme](https://wails.io/docs/next/reference/runtime/window#windowsetlighttheme) +// *Windows only* +// Sets window to light theme. export function WindowSetLightTheme(): void; +// [WindowSetDarkTheme](https://wails.io/docs/next/reference/runtime/window#windowsetdarktheme) +// *Windows only* +// Sets window to dark theme. export function WindowSetDarkTheme(): void; +// [WindowCenter](https://wails.io/docs/reference/runtime/window#windowcenter) +// Centers the window on the monitor the window is currently on. export function WindowCenter(): void; +// [WindowSetTitle](https://wails.io/docs/reference/runtime/window#windowsettitle) +// Sets the text in the window title bar. export function WindowSetTitle(title: string): void; +// [WindowFullscreen](https://wails.io/docs/reference/runtime/window#windowfullscreen) +// Makes the window full screen. export function WindowFullscreen(): void; +// [WindowUnfullscreen](https://wails.io/docs/reference/runtime/window#windowunfullscreen) +// Restores the previous window dimensions and position prior to full screen. export function WindowUnfullscreen(): void; +// [WindowSetSize](https://wails.io/docs/reference/runtime/window#windowsetsize) +// Sets the width and height of the window. export function WindowSetSize(width: number, height: number): Promise; +// [WindowGetSize](https://wails.io/docs/reference/runtime/window#windowgetsize) +// Gets the width and height of the window. export function WindowGetSize(): Promise; +// [WindowSetMaxSize](https://wails.io/docs/reference/runtime/window#windowsetmaxsize) +// Sets the maximum window size. Will resize the window if the window is currently larger than the given dimensions. +// Setting a size of 0,0 will disable this constraint. export function WindowSetMaxSize(width: number, height: number): void; +// [WindowSetMinSize](https://wails.io/docs/reference/runtime/window#windowsetminsize) +// Sets the minimum window size. Will resize the window if the window is currently smaller than the given dimensions. +// Setting a size of 0,0 will disable this constraint. export function WindowSetMinSize(width: number, height: number): void; +// [WindowSetPosition](https://wails.io/docs/reference/runtime/window#windowsetposition) +// Sets the window position relative to the monitor the window is currently on. export function WindowSetPosition(x: number, y: number): void; +// [WindowGetPosition](https://wails.io/docs/reference/runtime/window#windowgetposition) +// Gets the window position relative to the monitor the window is currently on. export function WindowGetPosition(): Promise; +// [WindowHide](https://wails.io/docs/reference/runtime/window#windowhide) +// Hides the window. export function WindowHide(): void; +// [WindowShow](https://wails.io/docs/reference/runtime/window#windowshow) +// Shows the window, if it is currently hidden. export function WindowShow(): void; +// [WindowMaximise](https://wails.io/docs/reference/runtime/window#windowmaximise) +// Maximises the window to fill the screen. export function WindowMaximise(): void; +// [WindowToggleMaximise](https://wails.io/docs/reference/runtime/window#windowtogglemaximise) +// Toggles between Maximised and UnMaximised. export function WindowToggleMaximise(): void; +// [WindowUnmaximise](https://wails.io/docs/reference/runtime/window#windowunmaximise) +// Restores the window to the dimensions and position prior to maximising. export function WindowUnmaximise(): void; +// [WindowMinimise](https://wails.io/docs/reference/runtime/window#windowminimise) +// Minimises the window. export function WindowMinimise(): void; +// [WindowUnminimise](https://wails.io/docs/reference/runtime/window#windowunminimise) +// Restores the window to the dimensions and position prior to minimising. export function WindowUnminimise(): void; +// [WindowSetRGBA](https://wails.io/docs/reference/runtime/window#windowsetrgba) +// Sets the background colour of the window to the given RGBA colour definition. This colour will show through for all transparent pixels. export function WindowSetRGBA(R: number, G: number, B: number, A: number): void; +// [BrowserOpenURL](https://wails.io/docs/next/reference/runtime/browser#browseropenurl) +// Opens the given URL in the system browser. export function BrowserOpenURL(url: string): void; +// [Quit](https://wails.io/docs/next/reference/runtime/intro#quit) +// Quits the application. export function Quit(): 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 0105feeb..9e602219 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 @@ -1,3 +1,17 @@ +/* + _ __ _ __ +| | / /___ _(_) /____ +| | /| / / __ `/ / / ___/ +| |/ |/ / /_/ / / (__ ) +|__/|__/\__,_/_/_/____/ +The electron alternative for Go +(c) Lea Anthony 2019-present +*/ + +export function LogPrint(message) { + window.runtime.LogPrint(message); +} + export function LogTrace(message) { window.runtime.LogTrace(message); } diff --git a/v2/internal/frontend/runtime/wrapper/runtime.d.ts b/v2/internal/frontend/runtime/wrapper/runtime.d.ts index 462cfab3..ed6cf378 100644 --- a/v2/internal/frontend/runtime/wrapper/runtime.d.ts +++ b/v2/internal/frontend/runtime/wrapper/runtime.d.ts @@ -1,3 +1,13 @@ +/* + _ __ _ __ +| | / /___ _(_) /____ +| | /| / / __ `/ / / ___/ +| |/ |/ / /_/ / / (__ ) +|__/|__/\__,_/_/_/____/ +The electron alternative for Go +(c) Lea Anthony 2019-present +*/ + export interface Position { x: number; y: number; @@ -9,72 +19,152 @@ export interface Size { } +// [EventsEmit](https://wails.io/docs/reference/runtime/events#eventsemit) +// emits the given event. Optional data may be passed with the event. +// This will trigger any event listeners. export function EventsEmit(eventName: string, data?: any): void; +// [EventsOn](https://wails.io/docs/reference/runtime/events#eventson) sets up a listener for the given event name. export function EventsOn(eventName: string, callback: (data?: any) => void): void; +// [EventsOnMultiple](https://wails.io/docs/reference/runtime/events#eventsonmultiple) +// sets up a listener for the given event name, but will only trigger a given number times. export function EventsOnMultiple(eventName: string, callback: (data?: any) => void, maxCallbacks: number): void; +// [EventsOnce](https://wails.io/docs/reference/runtime/events#eventsonce) +// sets up a listener for the given event name, but will only trigger once. export function EventsOnce(eventName: string, callback: (data?: any) => void): void; +// [EventsOff](https://wails.io/docs/reference/runtime/events#eventsff) +// unregisters the listener for the given event name. export function EventsOff(eventName: string): void; +// [LogPrint](https://wails.io/docs/reference/runtime/log#logprint) +// logs the given message as a raw message +export function LogPrint(message: string): void; + +// [LogTrace](https://wails.io/docs/reference/runtime/log#logtrace) +// logs the given message at the `trace` log level. export function LogTrace(message: string): void; +// [LogDebug](https://wails.io/docs/reference/runtime/log#logdebug) +// logs the given message at the `debug` log level. export function LogDebug(message: string): void; +// [LogError](https://wails.io/docs/reference/runtime/log#logerror) +// logs the given message at the `error` log level. export function LogError(message: string): void; +// [LogFatal](https://wails.io/docs/reference/runtime/log#logfatal) +// logs the given message at the `fatal` log level. +// The application will quit after calling this method. export function LogFatal(message: string): void; +// [LogInfo](https://wails.io/docs/reference/runtime/log#loginfo) +// logs the given message at the `info` log level. export function LogInfo(message: string): void; +// [LogWarning](https://wails.io/docs/reference/runtime/log#logwarning) +// logs the given message at the `warning` log level. export function LogWarning(message: string): void; +// [WindowReload](https://wails.io/docs/reference/runtime/window#windowreload) +// Forces a reload by the main application as well as connected browsers. export function WindowReload(): void; +// [WindowSetSystemDefaultTheme](https://wails.io/docs/next/reference/runtime/window#windowsetsystemdefaulttheme) +// *Windows only* +// Sets window theme to system default (dark/light). export function WindowSetSystemDefaultTheme(): void; +// [WindowSetLightTheme](https://wails.io/docs/next/reference/runtime/window#windowsetlighttheme) +// *Windows only* +// Sets window to light theme. export function WindowSetLightTheme(): void; +// [WindowSetDarkTheme](https://wails.io/docs/next/reference/runtime/window#windowsetdarktheme) +// *Windows only* +// Sets window to dark theme. export function WindowSetDarkTheme(): void; +// [WindowCenter](https://wails.io/docs/reference/runtime/window#windowcenter) +// Centers the window on the monitor the window is currently on. export function WindowCenter(): void; +// [WindowSetTitle](https://wails.io/docs/reference/runtime/window#windowsettitle) +// Sets the text in the window title bar. export function WindowSetTitle(title: string): void; +// [WindowFullscreen](https://wails.io/docs/reference/runtime/window#windowfullscreen) +// Makes the window full screen. export function WindowFullscreen(): void; +// [WindowUnfullscreen](https://wails.io/docs/reference/runtime/window#windowunfullscreen) +// Restores the previous window dimensions and position prior to full screen. export function WindowUnfullscreen(): void; +// [WindowSetSize](https://wails.io/docs/reference/runtime/window#windowsetsize) +// Sets the width and height of the window. export function WindowSetSize(width: number, height: number): Promise; +// [WindowGetSize](https://wails.io/docs/reference/runtime/window#windowgetsize) +// Gets the width and height of the window. export function WindowGetSize(): Promise; +// [WindowSetMaxSize](https://wails.io/docs/reference/runtime/window#windowsetmaxsize) +// Sets the maximum window size. Will resize the window if the window is currently larger than the given dimensions. +// Setting a size of 0,0 will disable this constraint. export function WindowSetMaxSize(width: number, height: number): void; +// [WindowSetMinSize](https://wails.io/docs/reference/runtime/window#windowsetminsize) +// Sets the minimum window size. Will resize the window if the window is currently smaller than the given dimensions. +// Setting a size of 0,0 will disable this constraint. export function WindowSetMinSize(width: number, height: number): void; +// [WindowSetPosition](https://wails.io/docs/reference/runtime/window#windowsetposition) +// Sets the window position relative to the monitor the window is currently on. export function WindowSetPosition(x: number, y: number): void; +// [WindowGetPosition](https://wails.io/docs/reference/runtime/window#windowgetposition) +// Gets the window position relative to the monitor the window is currently on. export function WindowGetPosition(): Promise; +// [WindowHide](https://wails.io/docs/reference/runtime/window#windowhide) +// Hides the window. export function WindowHide(): void; +// [WindowShow](https://wails.io/docs/reference/runtime/window#windowshow) +// Shows the window, if it is currently hidden. export function WindowShow(): void; +// [WindowMaximise](https://wails.io/docs/reference/runtime/window#windowmaximise) +// Maximises the window to fill the screen. export function WindowMaximise(): void; +// [WindowToggleMaximise](https://wails.io/docs/reference/runtime/window#windowtogglemaximise) +// Toggles between Maximised and UnMaximised. export function WindowToggleMaximise(): void; +// [WindowUnmaximise](https://wails.io/docs/reference/runtime/window#windowunmaximise) +// Restores the window to the dimensions and position prior to maximising. export function WindowUnmaximise(): void; +// [WindowMinimise](https://wails.io/docs/reference/runtime/window#windowminimise) +// Minimises the window. export function WindowMinimise(): void; +// [WindowUnminimise](https://wails.io/docs/reference/runtime/window#windowunminimise) +// Restores the window to the dimensions and position prior to minimising. export function WindowUnminimise(): void; +// [WindowSetRGBA](https://wails.io/docs/reference/runtime/window#windowsetrgba) +// Sets the background colour of the window to the given RGBA colour definition. This colour will show through for all transparent pixels. export function WindowSetRGBA(R: number, G: number, B: number, A: number): void; +// [BrowserOpenURL](https://wails.io/docs/next/reference/runtime/browser#browseropenurl) +// Opens the given URL in the system browser. export function BrowserOpenURL(url: string): void; +// [Quit](https://wails.io/docs/next/reference/runtime/intro#quit) +// Quits the application. export function Quit(): void; diff --git a/v2/internal/frontend/runtime/wrapper/runtime.js b/v2/internal/frontend/runtime/wrapper/runtime.js index 0105feeb..9e602219 100644 --- a/v2/internal/frontend/runtime/wrapper/runtime.js +++ b/v2/internal/frontend/runtime/wrapper/runtime.js @@ -1,3 +1,17 @@ +/* + _ __ _ __ +| | / /___ _(_) /____ +| | /| / / __ `/ / / ___/ +| |/ |/ / /_/ / / (__ ) +|__/|__/\__,_/_/_/____/ +The electron alternative for Go +(c) Lea Anthony 2019-present +*/ + +export function LogPrint(message) { + window.runtime.LogPrint(message); +} + export function LogTrace(message) { window.runtime.LogTrace(message); }