@wailsio/runtime 3.0.0-alpha.9 → 3.0.0-alpha.94

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/dist/android.js +39 -0
  2. package/{src → dist}/application.js +32 -46
  3. package/dist/browser.js +20 -0
  4. package/dist/callable.js +144 -0
  5. package/dist/calls.js +114 -0
  6. package/dist/cancellable.js +792 -0
  7. package/dist/clipboard.js +30 -0
  8. package/dist/contextmenu.js +83 -0
  9. package/dist/create.js +99 -0
  10. package/dist/dialogs.js +69 -0
  11. package/dist/drag.js +268 -0
  12. package/dist/environment.js +17 -0
  13. package/dist/event_types.js +292 -0
  14. package/dist/events.js +119 -0
  15. package/dist/flags.js +23 -0
  16. package/dist/index.js +88 -0
  17. package/dist/ios.js +28 -0
  18. package/dist/listener.js +44 -0
  19. package/dist/nanoid.js +38 -0
  20. package/dist/plugins/vite.js +64 -0
  21. package/dist/runtime.js +198 -0
  22. package/dist/screens.js +58 -0
  23. package/dist/system.js +158 -0
  24. package/dist/updater.js +74 -0
  25. package/dist/utils.js +98 -0
  26. package/dist/window.js +734 -0
  27. package/dist/wml.js +179 -0
  28. package/package.json +71 -26
  29. package/types/android.d.ts +21 -0
  30. package/types/application.d.ts +3 -10
  31. package/types/browser.d.ts +4 -4
  32. package/types/callable.d.ts +3 -0
  33. package/types/calls.d.ts +52 -24
  34. package/types/cancellable.d.ts +433 -0
  35. package/types/clipboard.d.ts +6 -5
  36. package/types/contextmenu.d.ts +1 -1
  37. package/types/create.d.ts +36 -0
  38. package/types/dialogs.d.ts +132 -20
  39. package/types/drag.d.ts +1 -4
  40. package/types/environment.d.ts +8 -0
  41. package/types/event_types.d.ts +281 -0
  42. package/types/events.d.ts +70 -33
  43. package/types/flags.d.ts +3 -3
  44. package/types/index.d.ts +32 -48
  45. package/types/ios.d.ts +13 -0
  46. package/types/listener.d.ts +9 -0
  47. package/types/nanoid.d.ts +1 -0
  48. package/types/plugins/vite.d.ts +10 -0
  49. package/types/runtime.d.ts +61 -22
  50. package/types/screens.d.ts +64 -7
  51. package/types/system.d.ts +74 -39
  52. package/types/updater.d.ts +65 -0
  53. package/types/utils.d.ts +21 -0
  54. package/types/window.d.ts +327 -13
  55. package/types/wml.d.ts +5 -3
  56. package/src/browser.js +0 -24
  57. package/src/calls.js +0 -123
  58. package/src/clipboard.js +0 -35
  59. package/src/contextmenu.js +0 -98
  60. package/src/dialogs.js +0 -138
  61. package/src/drag.js +0 -125
  62. package/src/events.js +0 -134
  63. package/src/flags.js +0 -63
  64. package/src/index.d.ts +0 -136
  65. package/src/index.js +0 -58
  66. package/src/runtime.js +0 -122
  67. package/src/screens.js +0 -45
  68. package/src/system.js +0 -122
  69. package/src/window.js +0 -122
  70. package/src/wml.js +0 -151
  71. package/tsconfig.json +0 -20
@@ -1,17 +1,74 @@
1
+ export interface Size {
2
+ /** The width of a rectangular area. */
3
+ Width: number;
4
+ /** The height of a rectangular area. */
5
+ Height: number;
6
+ }
7
+ export interface Rect {
8
+ /** The X coordinate of the origin. */
9
+ X: number;
10
+ /** The Y coordinate of the origin. */
11
+ Y: number;
12
+ /** The width of the rectangle. */
13
+ Width: number;
14
+ /** The height of the rectangle. */
15
+ Height: number;
16
+ }
17
+ export interface Screen {
18
+ /** Unique identifier for the screen. */
19
+ ID: string;
20
+ /** Human-readable name of the screen. */
21
+ Name: string;
22
+ /** The scale factor of the screen (DPI/96). 1 = standard DPI, 2 = HiDPI (Retina), etc. */
23
+ ScaleFactor: number;
24
+ /** The X coordinate of the screen. */
25
+ X: number;
26
+ /** The Y coordinate of the screen. */
27
+ Y: number;
28
+ /** Contains the width and height of the screen. */
29
+ Size: Size;
30
+ /** Contains the bounds of the screen in terms of X, Y, Width, and Height. */
31
+ Bounds: Rect;
32
+ /** Contains the physical bounds of the screen in terms of X, Y, Width, and Height (before scaling). */
33
+ PhysicalBounds: Rect;
34
+ /** Contains the area of the screen that is actually usable (excluding taskbar and other system UI). */
35
+ WorkArea: Rect;
36
+ /** Contains the physical WorkArea of the screen (before scaling). */
37
+ PhysicalWorkArea: Rect;
38
+ /** True if this is the primary monitor selected by the user in the operating system. */
39
+ IsPrimary: boolean;
40
+ /** The rotation of the screen. */
41
+ Rotation: number;
42
+ }
1
43
  /**
2
44
  * Gets all screens.
3
- * @returns {Promise<Screen[]>} A promise that resolves to an array of Screen objects.
45
+ *
46
+ * @returns A promise that resolves to an array of Screen objects.
4
47
  */
5
- export function GetAll(): Promise<Screen[]>;
48
+ export declare function GetAll(): Promise<Screen[]>;
6
49
  /**
7
50
  * Gets the primary screen.
8
- * @returns {Promise<Screen>} A promise that resolves to the primary screen.
51
+ *
52
+ * @returns A promise that resolves to the primary screen.
9
53
  */
10
- export function GetPrimary(): Promise<Screen>;
54
+ export declare function GetPrimary(): Promise<Screen>;
11
55
  /**
12
56
  * Gets the current active screen.
13
57
  *
14
- * @returns {Promise<Screen>} A promise that resolves with the current active screen.
58
+ * @returns A promise that resolves with the current active screen.
59
+ */
60
+ export declare function GetCurrent(): Promise<Screen>;
61
+ /**
62
+ * Gets a screen by its unique display ID.
63
+ *
64
+ * @param id - The unique identifier of the screen.
65
+ * @returns A promise that resolves to the matching Screen.
66
+ */
67
+ export declare function GetByID(id: string): Promise<Screen>;
68
+ /**
69
+ * Gets a screen by its index in the screen list.
70
+ *
71
+ * @param index - The zero-based index of the screen.
72
+ * @returns A promise that resolves to the matching Screen.
15
73
  */
16
- export function GetCurrent(): Promise<Screen>;
17
- export type Screen = any;
74
+ export declare function GetByIndex(index: number): Promise<Screen>;
package/types/system.d.ts CHANGED
@@ -1,72 +1,107 @@
1
+ export declare function invoke(msg: any): void;
1
2
  /**
2
- * @function
3
3
  * Retrieves the system dark mode status.
4
- * @returns {Promise<boolean>} - A promise that resolves to a boolean value indicating if the system is in dark mode.
4
+ *
5
+ * @returns A promise that resolves to a boolean value indicating if the system is in dark mode.
5
6
  */
6
- export function IsDarkMode(): Promise<boolean>;
7
+ export declare function IsDarkMode(): Promise<boolean>;
7
8
  /**
8
9
  * Fetches the capabilities of the application from the server.
9
10
  *
10
- * @async
11
- * @function Capabilities
12
- * @returns {Promise<Object>} A promise that resolves to an object containing the capabilities.
13
- */
14
- export function Capabilities(): Promise<any>;
15
- /**
16
- * @typedef {object} EnvironmentInfo
17
- * @property {string} OS - The operating system in use.
18
- * @property {string} Arch - The architecture of the system.
11
+ * @returns A promise that resolves to an object containing the capabilities.
19
12
  */
13
+ export declare function Capabilities(): Promise<Record<string, any>>;
14
+ export interface OSInfo {
15
+ /** The branding of the OS. */
16
+ Branding: string;
17
+ /** The ID of the OS. */
18
+ ID: string;
19
+ /** The name of the OS. */
20
+ Name: string;
21
+ /** The version of the OS. */
22
+ Version: string;
23
+ }
24
+ export interface EnvironmentInfo {
25
+ /** The architecture of the system. */
26
+ Arch: string;
27
+ /** True if the application is running in debug mode, otherwise false. */
28
+ Debug: boolean;
29
+ /** The operating system in use. */
30
+ OS: string;
31
+ /** Details of the operating system. */
32
+ OSInfo: OSInfo;
33
+ /** Additional platform information. */
34
+ PlatformInfo: Record<string, any>;
35
+ }
20
36
  /**
21
- * @function
22
37
  * Retrieves environment details.
23
- * @returns {Promise<EnvironmentInfo>} - A promise that resolves to an object containing OS and system architecture.
38
+ *
39
+ * @returns A promise that resolves to an object containing OS and system architecture.
24
40
  */
25
- export function Environment(): Promise<EnvironmentInfo>;
41
+ export declare function Environment(): Promise<EnvironmentInfo>;
26
42
  /**
27
43
  * Checks if the current operating system is Windows.
28
44
  *
29
- * @return {boolean} True if the operating system is Windows, otherwise false.
45
+ * @return True if the operating system is Windows, otherwise false.
30
46
  */
31
- export function IsWindows(): boolean;
47
+ export declare function IsWindows(): boolean;
32
48
  /**
33
49
  * Checks if the current operating system is Linux.
34
50
  *
35
- * @returns {boolean} Returns true if the current operating system is Linux, false otherwise.
51
+ * @returns Returns true if the current operating system is Linux, false otherwise.
36
52
  */
37
- export function IsLinux(): boolean;
53
+ export declare function IsLinux(): boolean;
38
54
  /**
39
55
  * Checks if the current environment is a macOS operating system.
40
56
  *
41
- * @returns {boolean} True if the environment is macOS, false otherwise.
57
+ * @returns True if the environment is macOS, false otherwise.
58
+ */
59
+ export declare function IsMac(): boolean;
60
+ /**
61
+ * Checks if the current operating system is iOS.
62
+ *
63
+ * @returns True if the operating system is iOS, otherwise false.
64
+ */
65
+ export declare function IsIOS(): boolean;
66
+ /**
67
+ * Checks if the current operating system is Android.
68
+ *
69
+ * @returns True if the operating system is Android, otherwise false.
42
70
  */
43
- export function IsMac(): boolean;
71
+ export declare function IsAndroid(): boolean;
72
+ /**
73
+ * Checks if the app is running on a mobile OS (iOS or Android).
74
+ *
75
+ * @returns True on iOS or Android, otherwise false.
76
+ */
77
+ export declare function IsMobile(): boolean;
78
+ /**
79
+ * Checks if the app is running on a desktop OS (macOS, Windows or Linux).
80
+ *
81
+ * @returns True on macOS, Windows or Linux, otherwise false.
82
+ */
83
+ export declare function IsDesktop(): boolean;
44
84
  /**
45
85
  * Checks if the current environment architecture is AMD64.
46
- * @returns {boolean} True if the current environment architecture is AMD64, false otherwise.
86
+ *
87
+ * @returns True if the current environment architecture is AMD64, false otherwise.
47
88
  */
48
- export function IsAMD64(): boolean;
89
+ export declare function IsAMD64(): boolean;
49
90
  /**
50
91
  * Checks if the current architecture is ARM.
51
92
  *
52
- * @returns {boolean} True if the current architecture is ARM, false otherwise.
93
+ * @returns True if the current architecture is ARM, false otherwise.
53
94
  */
54
- export function IsARM(): boolean;
95
+ export declare function IsARM(): boolean;
55
96
  /**
56
97
  * Checks if the current environment is ARM64 architecture.
57
98
  *
58
- * @returns {boolean} - Returns true if the environment is ARM64 architecture, otherwise returns false.
99
+ * @returns Returns true if the environment is ARM64 architecture, otherwise returns false.
59
100
  */
60
- export function IsARM64(): boolean;
61
- export function IsDebug(): boolean;
62
- export let invoke: any;
63
- export type EnvironmentInfo = {
64
- /**
65
- * - The operating system in use.
66
- */
67
- OS: string;
68
- /**
69
- * - The architecture of the system.
70
- */
71
- Arch: string;
72
- };
101
+ export declare function IsARM64(): boolean;
102
+ /**
103
+ * Reports whether the app is being run in debug mode.
104
+ *
105
+ * @returns True if the app is being run in debug mode.
106
+ */
107
+ export declare function IsDebug(): boolean;
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Updater event name constants.
3
+ *
4
+ * Use these instead of hard-coding string literals when subscribing to
5
+ * updater events from JavaScript:
6
+ *
7
+ * import { Events, Updater } from "@wailsio/runtime";
8
+ *
9
+ * Events.On(Updater.Events.UpdateAvailable, (e) => {
10
+ * console.log("update found:", e.data.version);
11
+ * });
12
+ *
13
+ * Events.On(Updater.Events.DownloadProgress, (e) => {
14
+ * const p = e.data;
15
+ * console.log(`${p.written} / ${p.total} bytes`);
16
+ * });
17
+ *
18
+ * Mirrors the Go-side constants in `pkg/updater/events.go` and the
19
+ * user-action constants in `pkg/updater/window_lifecycle.go`. Any
20
+ * changes here must stay in sync with those files — there's an
21
+ * integration test that asserts the strings match.
22
+ */
23
+ export declare const Events: Readonly<{
24
+ /** A Check round-trip is starting. Payload: null. */
25
+ CheckStarted: "wails:updater:check-started";
26
+ /** Check found a newer release. Payload: Release. */
27
+ UpdateAvailable: "wails:updater:update-available";
28
+ /** Check confirmed the caller is up to date. Payload: null. */
29
+ NoUpdate: "wails:updater:no-update";
30
+ /** Download is starting. Payload: Release. */
31
+ DownloadStarted: "wails:updater:download-started";
32
+ /** Periodic progress tick during download (~10 Hz). Payload: Progress. */
33
+ DownloadProgress: "wails:updater:download-progress";
34
+ /** All bytes are on disk, but verification has not yet started. Payload: Release. */
35
+ DownloadComplete: "wails:updater:download-complete";
36
+ /** Signature / digest verification has started. Payload: Release. */
37
+ Verifying: "wails:updater:verifying";
38
+ /** The Updater is swapping the binary into place. Payload: Release. */
39
+ Installing: "wails:updater:installing";
40
+ /** Update is staged and a restart is pending. Payload: Release. */
41
+ UpdateReady: "wails:updater:update-ready";
42
+ /** Something failed. Payload: ErrorInfo { stage, message, provider }. */
43
+ Error: "wails:updater:error";
44
+ /** Host-side context delivered once per session. Payload: Meta { currentVersion, skippedVersion }. */
45
+ Meta: "wails:updater:meta";
46
+ /** Sub-namespace: user-action events that the UI emits BACK to the host. */
47
+ User: Readonly<{
48
+ /** User clicked Install on an Available update. */
49
+ Install: "wails:updater:user:install";
50
+ /** User clicked Restart & Apply on a Ready update. */
51
+ Restart: "wails:updater:user:restart";
52
+ /** User clicked Skip This Version. */
53
+ Skip: "wails:updater:user:skip";
54
+ /** User clicked Remind Me Later. */
55
+ Remind: "wails:updater:user:remind";
56
+ /** User clicked Close / Cancel. */
57
+ Cancel: "wails:updater:user:cancel";
58
+ }>;
59
+ /** Sub-namespace: framework-internal events the UI emits to coordinate
60
+ * with the host. Most app code can ignore these. */
61
+ Window: Readonly<{
62
+ /** The window finished loading and asks the host to replay current state. */
63
+ Ready: "wails:updater:window:ready";
64
+ }>;
65
+ }>;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Logs a message to the console with custom formatting.
3
+ *
4
+ * @param message - The message to be logged.
5
+ */
6
+ export declare function debugLog(message: any): void;
7
+ /**
8
+ * Checks whether the webview supports the {@link MouseEvent#buttons} property.
9
+ * Looking at you macOS High Sierra!
10
+ */
11
+ export declare function canTrackButtons(): boolean;
12
+ /**
13
+ * Checks whether the browser supports removing listeners by triggering an AbortSignal
14
+ * (see https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#signal).
15
+ */
16
+ export declare function canAbortListeners(): boolean;
17
+ /**
18
+ * Resolves the closest HTMLElement ancestor of an event's target.
19
+ */
20
+ export declare function eventTarget(event: Event): HTMLElement;
21
+ export declare function whenReady(callback: () => void): void;
package/types/window.d.ts CHANGED
@@ -1,17 +1,331 @@
1
+ import type { Screen } from "./screens.js";
1
2
  /**
2
- * Gets the specified window.
3
- *
4
- * @param {string} windowName - The name of the window to get.
5
- * @return {Object} - The specified window object.
3
+ * Called from Go when a file drag enters the window on Linux/macOS.
6
4
  */
7
- export function Get(windowName: string): any;
5
+ declare function handleDragEnter(): void;
8
6
  /**
9
- * Returns a map of all methods in the current window.
10
- * @returns {Map} - A map of window methods.
7
+ * Called from Go when a file drag leaves the window on Linux/macOS.
11
8
  */
12
- export function WindowMethods(targetWindow: any): Map<any, any>;
13
- declare const _default: any;
14
- export default _default;
15
- export type Size = any;
16
- export type Position = any;
17
- export type Screen = any;
9
+ declare function handleDragLeave(): void;
10
+ /**
11
+ * Called from Go during file drag to update hover state on Linux/macOS.
12
+ * @param x - X coordinate in CSS pixels
13
+ * @param y - Y coordinate in CSS pixels
14
+ */
15
+ declare function handleDragOver(x: number, y: number): void;
16
+ export { handleDragEnter, handleDragLeave, handleDragOver };
17
+ /**
18
+ * A record describing the position of a window.
19
+ */
20
+ interface Position {
21
+ /** The horizontal position of the window. */
22
+ x: number;
23
+ /** The vertical position of the window. */
24
+ y: number;
25
+ }
26
+ /**
27
+ * A record describing the size of a window.
28
+ */
29
+ interface Size {
30
+ /** The width of the window. */
31
+ width: number;
32
+ /** The height of the window. */
33
+ height: number;
34
+ }
35
+ declare const callerSym: unique symbol;
36
+ declare class Window {
37
+ private [callerSym];
38
+ /**
39
+ * Initialises a window object with the specified name.
40
+ *
41
+ * @private
42
+ * @param name - The name of the target window.
43
+ */
44
+ constructor(name?: string);
45
+ /**
46
+ * Gets the specified window.
47
+ *
48
+ * @param name - The name of the window to get.
49
+ * @returns The corresponding window object.
50
+ */
51
+ Get(name: string): Window;
52
+ /**
53
+ * Returns the absolute position of the window.
54
+ *
55
+ * @returns The current absolute position of the window.
56
+ */
57
+ Position(): Promise<Position>;
58
+ /**
59
+ * Centers the window on the screen.
60
+ */
61
+ Center(): Promise<void>;
62
+ /**
63
+ * Closes the window.
64
+ */
65
+ Close(): Promise<void>;
66
+ /**
67
+ * Disables min/max size constraints.
68
+ */
69
+ DisableSizeConstraints(): Promise<void>;
70
+ /**
71
+ * Enables min/max size constraints.
72
+ */
73
+ EnableSizeConstraints(): Promise<void>;
74
+ /**
75
+ * Focuses the window.
76
+ */
77
+ Focus(): Promise<void>;
78
+ /**
79
+ * Forces the window to reload the page assets.
80
+ */
81
+ ForceReload(): Promise<void>;
82
+ /**
83
+ * Switches the window to fullscreen mode.
84
+ */
85
+ Fullscreen(): Promise<void>;
86
+ /**
87
+ * Returns the screen that the window is on.
88
+ *
89
+ * @returns The screen the window is currently on.
90
+ */
91
+ GetScreen(): Promise<Screen>;
92
+ /**
93
+ * Returns the current zoom level of the window.
94
+ *
95
+ * @returns The current zoom level.
96
+ */
97
+ GetZoom(): Promise<number>;
98
+ /**
99
+ * Returns the height of the window.
100
+ *
101
+ * @returns The current height of the window.
102
+ */
103
+ Height(): Promise<number>;
104
+ /**
105
+ * Hides the window.
106
+ */
107
+ Hide(): Promise<void>;
108
+ /**
109
+ * Returns true if the window is focused.
110
+ *
111
+ * @returns Whether the window is currently focused.
112
+ */
113
+ IsFocused(): Promise<boolean>;
114
+ /**
115
+ * Returns true if the window is fullscreen.
116
+ *
117
+ * @returns Whether the window is currently fullscreen.
118
+ */
119
+ IsFullscreen(): Promise<boolean>;
120
+ /**
121
+ * Returns true if the window is maximised.
122
+ *
123
+ * @returns Whether the window is currently maximised.
124
+ */
125
+ IsMaximised(): Promise<boolean>;
126
+ /**
127
+ * Returns true if the window is minimised.
128
+ *
129
+ * @returns Whether the window is currently minimised.
130
+ */
131
+ IsMinimised(): Promise<boolean>;
132
+ /**
133
+ * Maximises the window.
134
+ */
135
+ Maximise(): Promise<void>;
136
+ /**
137
+ * Minimises the window.
138
+ */
139
+ Minimise(): Promise<void>;
140
+ /**
141
+ * Returns the name of the window.
142
+ *
143
+ * @returns The name of the window.
144
+ */
145
+ Name(): Promise<string>;
146
+ /**
147
+ * Opens the development tools pane.
148
+ */
149
+ OpenDevTools(): Promise<void>;
150
+ /**
151
+ * Returns the relative position of the window to the screen.
152
+ *
153
+ * @returns The current relative position of the window.
154
+ */
155
+ RelativePosition(): Promise<Position>;
156
+ /**
157
+ * Reloads the page assets.
158
+ */
159
+ Reload(): Promise<void>;
160
+ /**
161
+ * Returns true if the window is resizable.
162
+ *
163
+ * @returns Whether the window is currently resizable.
164
+ */
165
+ Resizable(): Promise<boolean>;
166
+ /**
167
+ * Restores the window to its previous state if it was previously minimised, maximised or fullscreen.
168
+ */
169
+ Restore(): Promise<void>;
170
+ /**
171
+ * Sets the absolute position of the window.
172
+ *
173
+ * @param x - The desired horizontal absolute position of the window.
174
+ * @param y - The desired vertical absolute position of the window.
175
+ */
176
+ SetPosition(x: number, y: number): Promise<void>;
177
+ /**
178
+ * Sets the window to be always on top.
179
+ *
180
+ * @param alwaysOnTop - Whether the window should stay on top.
181
+ */
182
+ SetAlwaysOnTop(alwaysOnTop: boolean): Promise<void>;
183
+ /**
184
+ * Sets the background colour of the window.
185
+ *
186
+ * @param r - The desired red component of the window background.
187
+ * @param g - The desired green component of the window background.
188
+ * @param b - The desired blue component of the window background.
189
+ * @param a - The desired alpha component of the window background.
190
+ */
191
+ SetBackgroundColour(r: number, g: number, b: number, a: number): Promise<void>;
192
+ /**
193
+ * Removes the window frame and title bar.
194
+ *
195
+ * @param frameless - Whether the window should be frameless.
196
+ */
197
+ SetFrameless(frameless: boolean): Promise<void>;
198
+ /**
199
+ * Disables the system fullscreen button.
200
+ *
201
+ * @param enabled - Whether the fullscreen button should be enabled.
202
+ */
203
+ SetFullscreenButtonEnabled(enabled: boolean): Promise<void>;
204
+ /**
205
+ * Sets the maximum size of the window.
206
+ *
207
+ * @param width - The desired maximum width of the window.
208
+ * @param height - The desired maximum height of the window.
209
+ */
210
+ SetMaxSize(width: number, height: number): Promise<void>;
211
+ /**
212
+ * Sets the minimum size of the window.
213
+ *
214
+ * @param width - The desired minimum width of the window.
215
+ * @param height - The desired minimum height of the window.
216
+ */
217
+ SetMinSize(width: number, height: number): Promise<void>;
218
+ /**
219
+ * Sets the relative position of the window to the screen.
220
+ *
221
+ * @param x - The desired horizontal relative position of the window.
222
+ * @param y - The desired vertical relative position of the window.
223
+ */
224
+ SetRelativePosition(x: number, y: number): Promise<void>;
225
+ /**
226
+ * Sets whether the window is resizable.
227
+ *
228
+ * @param resizable - Whether the window should be resizable.
229
+ */
230
+ SetResizable(resizable: boolean): Promise<void>;
231
+ /**
232
+ * Sets the size of the window.
233
+ *
234
+ * @param width - The desired width of the window.
235
+ * @param height - The desired height of the window.
236
+ */
237
+ SetSize(width: number, height: number): Promise<void>;
238
+ /**
239
+ * Sets the title of the window.
240
+ *
241
+ * @param title - The desired title of the window.
242
+ */
243
+ SetTitle(title: string): Promise<void>;
244
+ /**
245
+ * Sets the zoom level of the window.
246
+ *
247
+ * @param zoom - The desired zoom level.
248
+ */
249
+ SetZoom(zoom: number): Promise<void>;
250
+ /**
251
+ * Shows the window.
252
+ */
253
+ Show(): Promise<void>;
254
+ /**
255
+ * Returns the size of the window.
256
+ *
257
+ * @returns The current size of the window.
258
+ */
259
+ Size(): Promise<Size>;
260
+ /**
261
+ * Toggles the window between fullscreen and normal.
262
+ */
263
+ ToggleFullscreen(): Promise<void>;
264
+ /**
265
+ * Toggles the window between maximised and normal.
266
+ */
267
+ ToggleMaximise(): Promise<void>;
268
+ /**
269
+ * Toggles the window between frameless and normal.
270
+ */
271
+ ToggleFrameless(): Promise<void>;
272
+ /**
273
+ * Un-fullscreens the window.
274
+ */
275
+ UnFullscreen(): Promise<void>;
276
+ /**
277
+ * Un-maximises the window.
278
+ */
279
+ UnMaximise(): Promise<void>;
280
+ /**
281
+ * Un-minimises the window.
282
+ */
283
+ UnMinimise(): Promise<void>;
284
+ /**
285
+ * Returns the width of the window.
286
+ *
287
+ * @returns The current width of the window.
288
+ */
289
+ Width(): Promise<number>;
290
+ /**
291
+ * Zooms the window.
292
+ */
293
+ Zoom(): Promise<void>;
294
+ /**
295
+ * Increases the zoom level of the webview content.
296
+ */
297
+ ZoomIn(): Promise<void>;
298
+ /**
299
+ * Decreases the zoom level of the webview content.
300
+ */
301
+ ZoomOut(): Promise<void>;
302
+ /**
303
+ * Resets the zoom level of the webview content.
304
+ */
305
+ ZoomReset(): Promise<void>;
306
+ /**
307
+ * Handles file drops originating from platform-specific code (e.g., macOS/Linux native drag-and-drop).
308
+ * Gathers information about the drop target element and sends it back to the Go backend.
309
+ *
310
+ * @param filenames - An array of file paths (strings) that were dropped.
311
+ * @param x - The x-coordinate of the drop event (CSS pixels).
312
+ * @param y - The y-coordinate of the drop event (CSS pixels).
313
+ */
314
+ HandlePlatformFileDrop(filenames: string[], x: number, y: number): void;
315
+ /**
316
+ * Moves the window to the center of the specified screen's work area.
317
+ *
318
+ * @param screenID - The ID of the target screen.
319
+ */
320
+ SetScreen(screenID: string): Promise<void>;
321
+ SnapAssist(): Promise<void>;
322
+ /**
323
+ * Opens the print dialog for the window.
324
+ */
325
+ Print(): Promise<void>;
326
+ }
327
+ /**
328
+ * The window within which the script is running.
329
+ */
330
+ declare const thisWindow: Window;
331
+ export default thisWindow;
package/types/wml.d.ts CHANGED
@@ -1,6 +1,8 @@
1
+ /**
2
+ * Schedules an automatic reload of WML to be performed as soon as the document is fully loaded.
3
+ */
4
+ export declare function Enable(): void;
1
5
  /**
2
6
  * Reloads the WML page by adding necessary event listeners and browser listeners.
3
- *
4
- * @return {void}
5
7
  */
6
- export function reloadWML(): void;
8
+ export declare function Reload(): void;