···11+package main
22+33+import (
44+ "context"
55+ "fmt"
66+)
77+88+// App struct
99+type App struct {
1010+ ctx context.Context
1111+}
1212+1313+// NewApp creates a new App application struct
1414+func NewApp() *App {
1515+ return &App{}
1616+}
1717+1818+// startup is called when the app starts. The context is saved
1919+// so we can call the runtime methods
2020+func (a *App) startup(ctx context.Context) {
2121+ a.ctx = ctx
2222+}
2323+2424+// Greet returns a greeting for the given name
2525+func (a *App) Greet(name string) string {
2626+ return fmt.Sprintf("Hello %s, It's show time!", name)
2727+}
+35
build/README.md
···11+# Build Directory
22+33+The build directory is used to house all the build files and assets for your application.
44+55+The structure is:
66+77+* bin - Output directory
88+* darwin - macOS specific files
99+* windows - Windows specific files
1010+1111+## Mac
1212+1313+The `darwin` directory holds files specific to Mac builds.
1414+These may be customised and used as part of the build. To return these files to the default state, simply delete them
1515+and
1616+build with `wails build`.
1717+1818+The directory contains the following files:
1919+2020+- `Info.plist` - the main plist file used for Mac builds. It is used when building using `wails build`.
2121+- `Info.dev.plist` - same as the main plist file but used when building using `wails dev`.
2222+2323+## Windows
2424+2525+The `windows` directory contains the manifest and rc files used when building with `wails build`.
2626+These may be customised for your application. To return these files to the default state, simply delete them and
2727+build with `wails build`.
2828+2929+- `icon.ico` - The icon used for the application. This is used when building using `wails build`. If you wish to
3030+ use a different icon, simply replace this file with your own. If it is missing, a new `icon.ico` file
3131+ will be created using the `appicon.png` file in the build directory.
3232+- `installer/*` - The files used to create the Windows installer. These are used when building using `wails build`.
3333+- `info.json` - Application details used for Windows builds. The data here will be used by the Windows installer,
3434+ as well as the application itself (right click the exe -> properties -> details)
3535+- `wails.exe.manifest` - The main application manifest file.
···11+Unicode true
22+33+####
44+## Please note: Template replacements don't work in this file. They are provided with default defines like
55+## mentioned underneath.
66+## If the keyword is not defined, "wails_tools.nsh" will populate them with the values from ProjectInfo.
77+## If they are defined here, "wails_tools.nsh" will not touch them. This allows to use this project.nsi manually
88+## from outside of Wails for debugging and development of the installer.
99+##
1010+## For development first make a wails nsis build to populate the "wails_tools.nsh":
1111+## > wails build --target windows/amd64 --nsis
1212+## Then you can call makensis on this file with specifying the path to your binary:
1313+## For a AMD64 only installer:
1414+## > makensis -DARG_WAILS_AMD64_BINARY=..\..\bin\app.exe
1515+## For a ARM64 only installer:
1616+## > makensis -DARG_WAILS_ARM64_BINARY=..\..\bin\app.exe
1717+## For a installer with both architectures:
1818+## > makensis -DARG_WAILS_AMD64_BINARY=..\..\bin\app-amd64.exe -DARG_WAILS_ARM64_BINARY=..\..\bin\app-arm64.exe
1919+####
2020+## The following information is taken from the ProjectInfo file, but they can be overwritten here.
2121+####
2222+## !define INFO_PROJECTNAME "MyProject" # Default "{{.Name}}"
2323+## !define INFO_COMPANYNAME "MyCompany" # Default "{{.Info.CompanyName}}"
2424+## !define INFO_PRODUCTNAME "MyProduct" # Default "{{.Info.ProductName}}"
2525+## !define INFO_PRODUCTVERSION "1.0.0" # Default "{{.Info.ProductVersion}}"
2626+## !define INFO_COPYRIGHT "Copyright" # Default "{{.Info.Copyright}}"
2727+###
2828+## !define PRODUCT_EXECUTABLE "Application.exe" # Default "${INFO_PROJECTNAME}.exe"
2929+## !define UNINST_KEY_NAME "UninstKeyInRegistry" # Default "${INFO_COMPANYNAME}${INFO_PRODUCTNAME}"
3030+####
3131+## !define REQUEST_EXECUTION_LEVEL "admin" # Default "admin" see also https://nsis.sourceforge.io/Docs/Chapter4.html
3232+####
3333+## Include the wails tools
3434+####
3535+!include "wails_tools.nsh"
3636+3737+# The version information for this two must consist of 4 parts
3838+VIProductVersion "${INFO_PRODUCTVERSION}.0"
3939+VIFileVersion "${INFO_PRODUCTVERSION}.0"
4040+4141+VIAddVersionKey "CompanyName" "${INFO_COMPANYNAME}"
4242+VIAddVersionKey "FileDescription" "${INFO_PRODUCTNAME} Installer"
4343+VIAddVersionKey "ProductVersion" "${INFO_PRODUCTVERSION}"
4444+VIAddVersionKey "FileVersion" "${INFO_PRODUCTVERSION}"
4545+VIAddVersionKey "LegalCopyright" "${INFO_COPYRIGHT}"
4646+VIAddVersionKey "ProductName" "${INFO_PRODUCTNAME}"
4747+4848+# Enable HiDPI support. https://nsis.sourceforge.io/Reference/ManifestDPIAware
4949+ManifestDPIAware true
5050+5151+!include "MUI.nsh"
5252+5353+!define MUI_ICON "..\icon.ico"
5454+!define MUI_UNICON "..\icon.ico"
5555+# !define MUI_WELCOMEFINISHPAGE_BITMAP "resources\leftimage.bmp" #Include this to add a bitmap on the left side of the Welcome Page. Must be a size of 164x314
5656+!define MUI_FINISHPAGE_NOAUTOCLOSE # Wait on the INSTFILES page so the user can take a look into the details of the installation steps
5757+!define MUI_ABORTWARNING # This will warn the user if they exit from the installer.
5858+5959+!insertmacro MUI_PAGE_WELCOME # Welcome to the installer page.
6060+# !insertmacro MUI_PAGE_LICENSE "resources\eula.txt" # Adds a EULA page to the installer
6161+!insertmacro MUI_PAGE_DIRECTORY # In which folder install page.
6262+!insertmacro MUI_PAGE_INSTFILES # Installing page.
6363+!insertmacro MUI_PAGE_FINISH # Finished installation page.
6464+6565+!insertmacro MUI_UNPAGE_INSTFILES # Uinstalling page
6666+6767+!insertmacro MUI_LANGUAGE "English" # Set the Language of the installer
6868+6969+## The following two statements can be used to sign the installer and the uninstaller. The path to the binaries are provided in %1
7070+#!uninstfinalize 'signtool --file "%1"'
7171+#!finalize 'signtool --file "%1"'
7272+7373+Name "${INFO_PRODUCTNAME}"
7474+OutFile "..\..\bin\${INFO_PROJECTNAME}-${ARCH}-installer.exe" # Name of the installer's file.
7575+InstallDir "$PROGRAMFILES64\${INFO_COMPANYNAME}\${INFO_PRODUCTNAME}" # Default installing folder ($PROGRAMFILES is Program Files folder).
7676+ShowInstDetails show # This will always show the installation details.
7777+7878+Function .onInit
7979+ !insertmacro wails.checkArchitecture
8080+FunctionEnd
8181+8282+Section
8383+ !insertmacro wails.setShellContext
8484+8585+ !insertmacro wails.webview2runtime
8686+8787+ SetOutPath $INSTDIR
8888+8989+ !insertmacro wails.files
9090+9191+ CreateShortcut "$SMPROGRAMS\${INFO_PRODUCTNAME}.lnk" "$INSTDIR\${PRODUCT_EXECUTABLE}"
9292+ CreateShortCut "$DESKTOP\${INFO_PRODUCTNAME}.lnk" "$INSTDIR\${PRODUCT_EXECUTABLE}"
9393+9494+ !insertmacro wails.associateFiles
9595+ !insertmacro wails.associateCustomProtocols
9696+9797+ !insertmacro wails.writeUninstaller
9898+SectionEnd
9999+100100+Section "uninstall"
101101+ !insertmacro wails.setShellContext
102102+103103+ RMDir /r "$AppData\${PRODUCT_EXECUTABLE}" # Remove the WebView2 DataPath
104104+105105+ RMDir /r $INSTDIR
106106+107107+ Delete "$SMPROGRAMS\${INFO_PRODUCTNAME}.lnk"
108108+ Delete "$DESKTOP\${INFO_PRODUCTNAME}.lnk"
109109+110110+ !insertmacro wails.unassociateFiles
111111+ !insertmacro wails.unassociateCustomProtocols
112112+113113+ !insertmacro wails.deleteUninstaller
114114+SectionEnd
···11+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
22+<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
33+ <assemblyIdentity type="win32" name="com.wails.{{.Name}}" version="{{.Info.ProductVersion}}.0" processorArchitecture="*"/>
44+ <dependency>
55+ <dependentAssembly>
66+ <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*"/>
77+ </dependentAssembly>
88+ </dependency>
99+ <asmv3:application>
1010+ <asmv3:windowsSettings>
1111+ <dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/pm</dpiAware> <!-- fallback for Windows 7 and 8 -->
1212+ <dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">permonitorv2,permonitor</dpiAwareness> <!-- falls back to per-monitor if per-monitor v2 is not supported -->
1313+ </asmv3:windowsSettings>
1414+ </asmv3:application>
1515+</assembly>
+65
frontend/README.md
···11+# Svelte + TS + Vite
22+33+This template should help get you started developing with Svelte and TypeScript in Vite.
44+55+## Recommended IDE Setup
66+77+[VS Code](https://code.visualstudio.com/)
88+99++ [Svelte](https://marketplace.visualstudio.com/items?itemName=svelte.svelte-vscode).
1010+1111+## Need an official Svelte framework?
1212+1313+Check out [SvelteKit](https://github.com/sveltejs/kit#readme), which is also powered by Vite. Deploy anywhere with its
1414+serverless-first approach and adapt to various platforms, with out of the box support for TypeScript, SCSS, and Less,
1515+and easily-added support for mdsvex, GraphQL, PostCSS, Tailwind CSS, and more.
1616+1717+## Technical considerations
1818+1919+**Why use this over SvelteKit?**
2020+2121+- It brings its own routing solution which might not be preferable for some users.
2222+- It is first and foremost a framework that just happens to use Vite under the hood, not a Vite app.
2323+ `vite dev` and `vite build` wouldn't work in a SvelteKit environment, for example.
2424+2525+This template contains as little as possible to get started with Vite + TypeScript + Svelte, while taking into account
2626+the developer experience with regards to HMR and intellisense. It demonstrates capabilities on par with the
2727+other `create-vite` templates and is a good starting point for beginners dipping their toes into a Vite + Svelte
2828+project.
2929+3030+Should you later need the extended capabilities and extensibility provided by SvelteKit, the template has been
3131+structured similarly to SvelteKit so that it is easy to migrate.
3232+3333+**Why `global.d.ts` instead of `compilerOptions.types` inside `jsconfig.json` or `tsconfig.json`?**
3434+3535+Setting `compilerOptions.types` shuts out all other types not explicitly listed in the configuration. Using triple-slash
3636+references keeps the default TypeScript setting of accepting type information from the entire workspace, while also
3737+adding `svelte` and `vite/client` type information.
3838+3939+**Why include `.vscode/extensions.json`?**
4040+4141+Other templates indirectly recommend extensions via the README, but this file allows VS Code to prompt the user to
4242+install the recommended extension upon opening the project.
4343+4444+**Why enable `allowJs` in the TS template?**
4545+4646+While `allowJs: false` would indeed prevent the use of `.js` files in the project, it does not prevent the use of
4747+JavaScript syntax in `.svelte` files. In addition, it would force `checkJs: false`, bringing the worst of both worlds:
4848+not being able to guarantee the entire codebase is TypeScript, and also having worse typechecking for the existing
4949+JavaScript. In addition, there are valid use cases in which a mixed codebase may be relevant.
5050+5151+**Why is HMR not preserving my local component state?**
5252+5353+HMR state preservation comes with a number of gotchas! It has been disabled by default in both `svelte-hmr`
5454+and `@sveltejs/vite-plugin-svelte` due to its often surprising behavior. You can read the
5555+details [here](https://github.com/rixo/svelte-hmr#svelte-hmr).
5656+5757+If you have state that's important to retain within a component, consider creating an external store which would not be
5858+replaced by HMR.
5959+6060+```ts
6161+// store.ts
6262+// An extremely simple external store
6363+import { writable } from 'svelte/store'
6464+export default writable(0)
6565+```
···11+Copyright 2016 The Nunito Project Authors (contact@sansoxygen.com),
22+33+This Font Software is licensed under the SIL Open Font License, Version 1.1.
44+This license is copied below, and is also available with a FAQ at:
55+http://scripts.sil.org/OFL
66+77+88+-----------------------------------------------------------
99+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
1010+-----------------------------------------------------------
1111+1212+PREAMBLE
1313+The goals of the Open Font License (OFL) are to stimulate worldwide
1414+development of collaborative font projects, to support the font creation
1515+efforts of academic and linguistic communities, and to provide a free and
1616+open framework in which fonts may be shared and improved in partnership
1717+with others.
1818+1919+The OFL allows the licensed fonts to be used, studied, modified and
2020+redistributed freely as long as they are not sold by themselves. The
2121+fonts, including any derivative works, can be bundled, embedded,
2222+redistributed and/or sold with any software provided that any reserved
2323+names are not used by derivative works. The fonts and derivatives,
2424+however, cannot be released under any other type of license. The
2525+requirement for fonts to remain under this license does not apply
2626+to any document created using the fonts or their derivatives.
2727+2828+DEFINITIONS
2929+"Font Software" refers to the set of files released by the Copyright
3030+Holder(s) under this license and clearly marked as such. This may
3131+include source files, build scripts and documentation.
3232+3333+"Reserved Font Name" refers to any names specified as such after the
3434+copyright statement(s).
3535+3636+"Original Version" refers to the collection of Font Software components as
3737+distributed by the Copyright Holder(s).
3838+3939+"Modified Version" refers to any derivative made by adding to, deleting,
4040+or substituting -- in part or in whole -- any of the components of the
4141+Original Version, by changing formats or by porting the Font Software to a
4242+new environment.
4343+4444+"Author" refers to any designer, engineer, programmer, technical
4545+writer or other person who contributed to the Font Software.
4646+4747+PERMISSION & CONDITIONS
4848+Permission is hereby granted, free of charge, to any person obtaining
4949+a copy of the Font Software, to use, study, copy, merge, embed, modify,
5050+redistribute, and sell modified and unmodified copies of the Font
5151+Software, subject to the following conditions:
5252+5353+1) Neither the Font Software nor any of its individual components,
5454+in Original or Modified Versions, may be sold by itself.
5555+5656+2) Original or Modified Versions of the Font Software may be bundled,
5757+redistributed and/or sold with any software, provided that each copy
5858+contains the above copyright notice and this license. These can be
5959+included either as stand-alone text files, human-readable headers or
6060+in the appropriate machine-readable metadata fields within text or
6161+binary files as long as those fields can be easily viewed by the user.
6262+6363+3) No Modified Version of the Font Software may use the Reserved Font
6464+Name(s) unless explicit written permission is granted by the corresponding
6565+Copyright Holder. This restriction only applies to the primary font name as
6666+presented to the users.
6767+6868+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
6969+Software shall not be used to promote, endorse or advertise any
7070+Modified Version, except to acknowledge the contribution(s) of the
7171+Copyright Holder(s) and the Author(s) or with their explicit written
7272+permission.
7373+7474+5) The Font Software, modified or unmodified, in part or in whole,
7575+must be distributed entirely under this license, and must not be
7676+distributed under any other license. The requirement for fonts to
7777+remain under this license does not apply to any document created
7878+using the Font Software.
7979+8080+TERMINATION
8181+This license becomes null and void if any of the above conditions are
8282+not met.
8383+8484+DISCLAIMER
8585+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
8686+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
8787+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
8888+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
8989+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
9090+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
9191+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
9292+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
9393+OTHER DEALINGS IN THE FONT SOFTWARE.
···11+import {defineConfig} from 'vite'
22+import {svelte} from '@sveltejs/vite-plugin-svelte'
33+44+// https://vitejs.dev/config/
55+export default defineConfig({
66+ plugins: [svelte()]
77+})
+4
frontend/wailsjs/go/main/App.d.ts
···11+// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
22+// This file is automatically generated. DO NOT EDIT
33+44+export function Greet(arg1:string):Promise<string>;
+7
frontend/wailsjs/go/main/App.js
···11+// @ts-check
22+// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
33+// This file is automatically generated. DO NOT EDIT
44+55+export function Greet(arg1) {
66+ return window['go']['main']['App']['Greet'](arg1);
77+}
···11+/*
22+ _ __ _ __
33+| | / /___ _(_) /____
44+| | /| / / __ `/ / / ___/
55+| |/ |/ / /_/ / / (__ )
66+|__/|__/\__,_/_/_/____/
77+The electron alternative for Go
88+(c) Lea Anthony 2019-present
99+*/
1010+1111+export interface Position {
1212+ x: number;
1313+ y: number;
1414+}
1515+1616+export interface Size {
1717+ w: number;
1818+ h: number;
1919+}
2020+2121+export interface Screen {
2222+ isCurrent: boolean;
2323+ isPrimary: boolean;
2424+ width : number
2525+ height : number
2626+}
2727+2828+// Environment information such as platform, buildtype, ...
2929+export interface EnvironmentInfo {
3030+ buildType: string;
3131+ platform: string;
3232+ arch: string;
3333+}
3434+3535+// [EventsEmit](https://wails.io/docs/reference/runtime/events#eventsemit)
3636+// emits the given event. Optional data may be passed with the event.
3737+// This will trigger any event listeners.
3838+export function EventsEmit(eventName: string, ...data: any): void;
3939+4040+// [EventsOn](https://wails.io/docs/reference/runtime/events#eventson) sets up a listener for the given event name.
4141+export function EventsOn(eventName: string, callback: (...data: any) => void): () => void;
4242+4343+// [EventsOnMultiple](https://wails.io/docs/reference/runtime/events#eventsonmultiple)
4444+// sets up a listener for the given event name, but will only trigger a given number times.
4545+export function EventsOnMultiple(eventName: string, callback: (...data: any) => void, maxCallbacks: number): () => void;
4646+4747+// [EventsOnce](https://wails.io/docs/reference/runtime/events#eventsonce)
4848+// sets up a listener for the given event name, but will only trigger once.
4949+export function EventsOnce(eventName: string, callback: (...data: any) => void): () => void;
5050+5151+// [EventsOff](https://wails.io/docs/reference/runtime/events#eventsoff)
5252+// unregisters the listener for the given event name.
5353+export function EventsOff(eventName: string, ...additionalEventNames: string[]): void;
5454+5555+// [EventsOffAll](https://wails.io/docs/reference/runtime/events#eventsoffall)
5656+// unregisters all listeners.
5757+export function EventsOffAll(): void;
5858+5959+// [LogPrint](https://wails.io/docs/reference/runtime/log#logprint)
6060+// logs the given message as a raw message
6161+export function LogPrint(message: string): void;
6262+6363+// [LogTrace](https://wails.io/docs/reference/runtime/log#logtrace)
6464+// logs the given message at the `trace` log level.
6565+export function LogTrace(message: string): void;
6666+6767+// [LogDebug](https://wails.io/docs/reference/runtime/log#logdebug)
6868+// logs the given message at the `debug` log level.
6969+export function LogDebug(message: string): void;
7070+7171+// [LogError](https://wails.io/docs/reference/runtime/log#logerror)
7272+// logs the given message at the `error` log level.
7373+export function LogError(message: string): void;
7474+7575+// [LogFatal](https://wails.io/docs/reference/runtime/log#logfatal)
7676+// logs the given message at the `fatal` log level.
7777+// The application will quit after calling this method.
7878+export function LogFatal(message: string): void;
7979+8080+// [LogInfo](https://wails.io/docs/reference/runtime/log#loginfo)
8181+// logs the given message at the `info` log level.
8282+export function LogInfo(message: string): void;
8383+8484+// [LogWarning](https://wails.io/docs/reference/runtime/log#logwarning)
8585+// logs the given message at the `warning` log level.
8686+export function LogWarning(message: string): void;
8787+8888+// [WindowReload](https://wails.io/docs/reference/runtime/window#windowreload)
8989+// Forces a reload by the main application as well as connected browsers.
9090+export function WindowReload(): void;
9191+9292+// [WindowReloadApp](https://wails.io/docs/reference/runtime/window#windowreloadapp)
9393+// Reloads the application frontend.
9494+export function WindowReloadApp(): void;
9595+9696+// [WindowSetAlwaysOnTop](https://wails.io/docs/reference/runtime/window#windowsetalwaysontop)
9797+// Sets the window AlwaysOnTop or not on top.
9898+export function WindowSetAlwaysOnTop(b: boolean): void;
9999+100100+// [WindowSetSystemDefaultTheme](https://wails.io/docs/next/reference/runtime/window#windowsetsystemdefaulttheme)
101101+// *Windows only*
102102+// Sets window theme to system default (dark/light).
103103+export function WindowSetSystemDefaultTheme(): void;
104104+105105+// [WindowSetLightTheme](https://wails.io/docs/next/reference/runtime/window#windowsetlighttheme)
106106+// *Windows only*
107107+// Sets window to light theme.
108108+export function WindowSetLightTheme(): void;
109109+110110+// [WindowSetDarkTheme](https://wails.io/docs/next/reference/runtime/window#windowsetdarktheme)
111111+// *Windows only*
112112+// Sets window to dark theme.
113113+export function WindowSetDarkTheme(): void;
114114+115115+// [WindowCenter](https://wails.io/docs/reference/runtime/window#windowcenter)
116116+// Centers the window on the monitor the window is currently on.
117117+export function WindowCenter(): void;
118118+119119+// [WindowSetTitle](https://wails.io/docs/reference/runtime/window#windowsettitle)
120120+// Sets the text in the window title bar.
121121+export function WindowSetTitle(title: string): void;
122122+123123+// [WindowFullscreen](https://wails.io/docs/reference/runtime/window#windowfullscreen)
124124+// Makes the window full screen.
125125+export function WindowFullscreen(): void;
126126+127127+// [WindowUnfullscreen](https://wails.io/docs/reference/runtime/window#windowunfullscreen)
128128+// Restores the previous window dimensions and position prior to full screen.
129129+export function WindowUnfullscreen(): void;
130130+131131+// [WindowIsFullscreen](https://wails.io/docs/reference/runtime/window#windowisfullscreen)
132132+// Returns the state of the window, i.e. whether the window is in full screen mode or not.
133133+export function WindowIsFullscreen(): Promise<boolean>;
134134+135135+// [WindowSetSize](https://wails.io/docs/reference/runtime/window#windowsetsize)
136136+// Sets the width and height of the window.
137137+export function WindowSetSize(width: number, height: number): void;
138138+139139+// [WindowGetSize](https://wails.io/docs/reference/runtime/window#windowgetsize)
140140+// Gets the width and height of the window.
141141+export function WindowGetSize(): Promise<Size>;
142142+143143+// [WindowSetMaxSize](https://wails.io/docs/reference/runtime/window#windowsetmaxsize)
144144+// Sets the maximum window size. Will resize the window if the window is currently larger than the given dimensions.
145145+// Setting a size of 0,0 will disable this constraint.
146146+export function WindowSetMaxSize(width: number, height: number): void;
147147+148148+// [WindowSetMinSize](https://wails.io/docs/reference/runtime/window#windowsetminsize)
149149+// Sets the minimum window size. Will resize the window if the window is currently smaller than the given dimensions.
150150+// Setting a size of 0,0 will disable this constraint.
151151+export function WindowSetMinSize(width: number, height: number): void;
152152+153153+// [WindowSetPosition](https://wails.io/docs/reference/runtime/window#windowsetposition)
154154+// Sets the window position relative to the monitor the window is currently on.
155155+export function WindowSetPosition(x: number, y: number): void;
156156+157157+// [WindowGetPosition](https://wails.io/docs/reference/runtime/window#windowgetposition)
158158+// Gets the window position relative to the monitor the window is currently on.
159159+export function WindowGetPosition(): Promise<Position>;
160160+161161+// [WindowHide](https://wails.io/docs/reference/runtime/window#windowhide)
162162+// Hides the window.
163163+export function WindowHide(): void;
164164+165165+// [WindowShow](https://wails.io/docs/reference/runtime/window#windowshow)
166166+// Shows the window, if it is currently hidden.
167167+export function WindowShow(): void;
168168+169169+// [WindowMaximise](https://wails.io/docs/reference/runtime/window#windowmaximise)
170170+// Maximises the window to fill the screen.
171171+export function WindowMaximise(): void;
172172+173173+// [WindowToggleMaximise](https://wails.io/docs/reference/runtime/window#windowtogglemaximise)
174174+// Toggles between Maximised and UnMaximised.
175175+export function WindowToggleMaximise(): void;
176176+177177+// [WindowUnmaximise](https://wails.io/docs/reference/runtime/window#windowunmaximise)
178178+// Restores the window to the dimensions and position prior to maximising.
179179+export function WindowUnmaximise(): void;
180180+181181+// [WindowIsMaximised](https://wails.io/docs/reference/runtime/window#windowismaximised)
182182+// Returns the state of the window, i.e. whether the window is maximised or not.
183183+export function WindowIsMaximised(): Promise<boolean>;
184184+185185+// [WindowMinimise](https://wails.io/docs/reference/runtime/window#windowminimise)
186186+// Minimises the window.
187187+export function WindowMinimise(): void;
188188+189189+// [WindowUnminimise](https://wails.io/docs/reference/runtime/window#windowunminimise)
190190+// Restores the window to the dimensions and position prior to minimising.
191191+export function WindowUnminimise(): void;
192192+193193+// [WindowIsMinimised](https://wails.io/docs/reference/runtime/window#windowisminimised)
194194+// Returns the state of the window, i.e. whether the window is minimised or not.
195195+export function WindowIsMinimised(): Promise<boolean>;
196196+197197+// [WindowIsNormal](https://wails.io/docs/reference/runtime/window#windowisnormal)
198198+// Returns the state of the window, i.e. whether the window is normal or not.
199199+export function WindowIsNormal(): Promise<boolean>;
200200+201201+// [WindowSetBackgroundColour](https://wails.io/docs/reference/runtime/window#windowsetbackgroundcolour)
202202+// Sets the background colour of the window to the given RGBA colour definition. This colour will show through for all transparent pixels.
203203+export function WindowSetBackgroundColour(R: number, G: number, B: number, A: number): void;
204204+205205+// [ScreenGetAll](https://wails.io/docs/reference/runtime/window#screengetall)
206206+// Gets the all screens. Call this anew each time you want to refresh data from the underlying windowing system.
207207+export function ScreenGetAll(): Promise<Screen[]>;
208208+209209+// [BrowserOpenURL](https://wails.io/docs/reference/runtime/browser#browseropenurl)
210210+// Opens the given URL in the system browser.
211211+export function BrowserOpenURL(url: string): void;
212212+213213+// [Environment](https://wails.io/docs/reference/runtime/intro#environment)
214214+// Returns information about the environment
215215+export function Environment(): Promise<EnvironmentInfo>;
216216+217217+// [Quit](https://wails.io/docs/reference/runtime/intro#quit)
218218+// Quits the application.
219219+export function Quit(): void;
220220+221221+// [Hide](https://wails.io/docs/reference/runtime/intro#hide)
222222+// Hides the application.
223223+export function Hide(): void;
224224+225225+// [Show](https://wails.io/docs/reference/runtime/intro#show)
226226+// Shows the application.
227227+export function Show(): void;
228228+229229+// [ClipboardGetText](https://wails.io/docs/reference/runtime/clipboard#clipboardgettext)
230230+// Returns the current text stored on clipboard
231231+export function ClipboardGetText(): Promise<string>;
232232+233233+// [ClipboardSetText](https://wails.io/docs/reference/runtime/clipboard#clipboardsettext)
234234+// Sets a text on the clipboard
235235+export function ClipboardSetText(text: string): Promise<boolean>;
236236+237237+// [OnFileDrop](https://wails.io/docs/reference/runtime/draganddrop#onfiledrop)
238238+// OnFileDrop listens to drag and drop events and calls the callback with the coordinates of the drop and an array of path strings.
239239+export function OnFileDrop(callback: (x: number, y: number ,paths: string[]) => void, useDropTarget: boolean) :void
240240+241241+// [OnFileDropOff](https://wails.io/docs/reference/runtime/draganddrop#dragandddropoff)
242242+// OnFileDropOff removes the drag and drop listeners and handlers.
243243+export function OnFileDropOff() :void
244244+245245+// Check if the file path resolver is available
246246+export function CanResolveFilePaths(): boolean;
247247+248248+// Resolves file paths for an array of files
249249+export function ResolveFilePaths(files: File[]): void
+242
frontend/wailsjs/runtime/runtime.js
···11+/*
22+ _ __ _ __
33+| | / /___ _(_) /____
44+| | /| / / __ `/ / / ___/
55+| |/ |/ / /_/ / / (__ )
66+|__/|__/\__,_/_/_/____/
77+The electron alternative for Go
88+(c) Lea Anthony 2019-present
99+*/
1010+1111+export function LogPrint(message) {
1212+ window.runtime.LogPrint(message);
1313+}
1414+1515+export function LogTrace(message) {
1616+ window.runtime.LogTrace(message);
1717+}
1818+1919+export function LogDebug(message) {
2020+ window.runtime.LogDebug(message);
2121+}
2222+2323+export function LogInfo(message) {
2424+ window.runtime.LogInfo(message);
2525+}
2626+2727+export function LogWarning(message) {
2828+ window.runtime.LogWarning(message);
2929+}
3030+3131+export function LogError(message) {
3232+ window.runtime.LogError(message);
3333+}
3434+3535+export function LogFatal(message) {
3636+ window.runtime.LogFatal(message);
3737+}
3838+3939+export function EventsOnMultiple(eventName, callback, maxCallbacks) {
4040+ return window.runtime.EventsOnMultiple(eventName, callback, maxCallbacks);
4141+}
4242+4343+export function EventsOn(eventName, callback) {
4444+ return EventsOnMultiple(eventName, callback, -1);
4545+}
4646+4747+export function EventsOff(eventName, ...additionalEventNames) {
4848+ return window.runtime.EventsOff(eventName, ...additionalEventNames);
4949+}
5050+5151+export function EventsOffAll() {
5252+ return window.runtime.EventsOffAll();
5353+}
5454+5555+export function EventsOnce(eventName, callback) {
5656+ return EventsOnMultiple(eventName, callback, 1);
5757+}
5858+5959+export function EventsEmit(eventName) {
6060+ let args = [eventName].slice.call(arguments);
6161+ return window.runtime.EventsEmit.apply(null, args);
6262+}
6363+6464+export function WindowReload() {
6565+ window.runtime.WindowReload();
6666+}
6767+6868+export function WindowReloadApp() {
6969+ window.runtime.WindowReloadApp();
7070+}
7171+7272+export function WindowSetAlwaysOnTop(b) {
7373+ window.runtime.WindowSetAlwaysOnTop(b);
7474+}
7575+7676+export function WindowSetSystemDefaultTheme() {
7777+ window.runtime.WindowSetSystemDefaultTheme();
7878+}
7979+8080+export function WindowSetLightTheme() {
8181+ window.runtime.WindowSetLightTheme();
8282+}
8383+8484+export function WindowSetDarkTheme() {
8585+ window.runtime.WindowSetDarkTheme();
8686+}
8787+8888+export function WindowCenter() {
8989+ window.runtime.WindowCenter();
9090+}
9191+9292+export function WindowSetTitle(title) {
9393+ window.runtime.WindowSetTitle(title);
9494+}
9595+9696+export function WindowFullscreen() {
9797+ window.runtime.WindowFullscreen();
9898+}
9999+100100+export function WindowUnfullscreen() {
101101+ window.runtime.WindowUnfullscreen();
102102+}
103103+104104+export function WindowIsFullscreen() {
105105+ return window.runtime.WindowIsFullscreen();
106106+}
107107+108108+export function WindowGetSize() {
109109+ return window.runtime.WindowGetSize();
110110+}
111111+112112+export function WindowSetSize(width, height) {
113113+ window.runtime.WindowSetSize(width, height);
114114+}
115115+116116+export function WindowSetMaxSize(width, height) {
117117+ window.runtime.WindowSetMaxSize(width, height);
118118+}
119119+120120+export function WindowSetMinSize(width, height) {
121121+ window.runtime.WindowSetMinSize(width, height);
122122+}
123123+124124+export function WindowSetPosition(x, y) {
125125+ window.runtime.WindowSetPosition(x, y);
126126+}
127127+128128+export function WindowGetPosition() {
129129+ return window.runtime.WindowGetPosition();
130130+}
131131+132132+export function WindowHide() {
133133+ window.runtime.WindowHide();
134134+}
135135+136136+export function WindowShow() {
137137+ window.runtime.WindowShow();
138138+}
139139+140140+export function WindowMaximise() {
141141+ window.runtime.WindowMaximise();
142142+}
143143+144144+export function WindowToggleMaximise() {
145145+ window.runtime.WindowToggleMaximise();
146146+}
147147+148148+export function WindowUnmaximise() {
149149+ window.runtime.WindowUnmaximise();
150150+}
151151+152152+export function WindowIsMaximised() {
153153+ return window.runtime.WindowIsMaximised();
154154+}
155155+156156+export function WindowMinimise() {
157157+ window.runtime.WindowMinimise();
158158+}
159159+160160+export function WindowUnminimise() {
161161+ window.runtime.WindowUnminimise();
162162+}
163163+164164+export function WindowSetBackgroundColour(R, G, B, A) {
165165+ window.runtime.WindowSetBackgroundColour(R, G, B, A);
166166+}
167167+168168+export function ScreenGetAll() {
169169+ return window.runtime.ScreenGetAll();
170170+}
171171+172172+export function WindowIsMinimised() {
173173+ return window.runtime.WindowIsMinimised();
174174+}
175175+176176+export function WindowIsNormal() {
177177+ return window.runtime.WindowIsNormal();
178178+}
179179+180180+export function BrowserOpenURL(url) {
181181+ window.runtime.BrowserOpenURL(url);
182182+}
183183+184184+export function Environment() {
185185+ return window.runtime.Environment();
186186+}
187187+188188+export function Quit() {
189189+ window.runtime.Quit();
190190+}
191191+192192+export function Hide() {
193193+ window.runtime.Hide();
194194+}
195195+196196+export function Show() {
197197+ window.runtime.Show();
198198+}
199199+200200+export function ClipboardGetText() {
201201+ return window.runtime.ClipboardGetText();
202202+}
203203+204204+export function ClipboardSetText(text) {
205205+ return window.runtime.ClipboardSetText(text);
206206+}
207207+208208+/**
209209+ * Callback for OnFileDrop returns a slice of file path strings when a drop is finished.
210210+ *
211211+ * @export
212212+ * @callback OnFileDropCallback
213213+ * @param {number} x - x coordinate of the drop
214214+ * @param {number} y - y coordinate of the drop
215215+ * @param {string[]} paths - A list of file paths.
216216+ */
217217+218218+/**
219219+ * OnFileDrop listens to drag and drop events and calls the callback with the coordinates of the drop and an array of path strings.
220220+ *
221221+ * @export
222222+ * @param {OnFileDropCallback} callback - Callback for OnFileDrop returns a slice of file path strings when a drop is finished.
223223+ * @param {boolean} [useDropTarget=true] - Only call the callback when the drop finished on an element that has the drop target style. (--wails-drop-target)
224224+ */
225225+export function OnFileDrop(callback, useDropTarget) {
226226+ return window.runtime.OnFileDrop(callback, useDropTarget);
227227+}
228228+229229+/**
230230+ * OnFileDropOff removes the drag and drop listeners and handlers.
231231+ */
232232+export function OnFileDropOff() {
233233+ return window.runtime.OnFileDropOff();
234234+}
235235+236236+export function CanResolveFilePaths() {
237237+ return window.runtime.CanResolveFilePaths();
238238+}
239239+240240+export function ResolveFilePaths(files) {
241241+ return window.runtime.ResolveFilePaths(files);
242242+}