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

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
@@ -0,0 +1,292 @@
1
+ /*
2
+ _ __ _ __
3
+ | | / /___ _(_) /____
4
+ | | /| / / __ `/ / / ___/
5
+ | |/ |/ / /_/ / / (__ )
6
+ |__/|__/\__,_/_/_/____/
7
+ The electron alternative for Go
8
+ (c) Lea Anthony 2019-present
9
+ */
10
+ // Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
11
+ // This file is automatically generated. DO NOT EDIT
12
+ export const Types = Object.freeze({
13
+ Windows: Object.freeze({
14
+ APMPowerSettingChange: "windows:APMPowerSettingChange",
15
+ APMPowerStatusChange: "windows:APMPowerStatusChange",
16
+ APMResumeAutomatic: "windows:APMResumeAutomatic",
17
+ APMResumeSuspend: "windows:APMResumeSuspend",
18
+ APMSuspend: "windows:APMSuspend",
19
+ ApplicationStarted: "windows:ApplicationStarted",
20
+ SystemThemeChanged: "windows:SystemThemeChanged",
21
+ WebViewNavigationCompleted: "windows:WebViewNavigationCompleted",
22
+ WindowActive: "windows:WindowActive",
23
+ WindowBackgroundErase: "windows:WindowBackgroundErase",
24
+ WindowClickActive: "windows:WindowClickActive",
25
+ WindowClosing: "windows:WindowClosing",
26
+ WindowDidMove: "windows:WindowDidMove",
27
+ WindowDidResize: "windows:WindowDidResize",
28
+ WindowDPIChanged: "windows:WindowDPIChanged",
29
+ WindowDragDrop: "windows:WindowDragDrop",
30
+ WindowDragEnter: "windows:WindowDragEnter",
31
+ WindowDragLeave: "windows:WindowDragLeave",
32
+ WindowDragOver: "windows:WindowDragOver",
33
+ WindowEndMove: "windows:WindowEndMove",
34
+ WindowEndResize: "windows:WindowEndResize",
35
+ WindowFullscreen: "windows:WindowFullscreen",
36
+ WindowHide: "windows:WindowHide",
37
+ WindowInactive: "windows:WindowInactive",
38
+ WindowKeyDown: "windows:WindowKeyDown",
39
+ WindowKeyUp: "windows:WindowKeyUp",
40
+ WindowKillFocus: "windows:WindowKillFocus",
41
+ WindowNonClientHit: "windows:WindowNonClientHit",
42
+ WindowNonClientMouseDown: "windows:WindowNonClientMouseDown",
43
+ WindowNonClientMouseLeave: "windows:WindowNonClientMouseLeave",
44
+ WindowNonClientMouseMove: "windows:WindowNonClientMouseMove",
45
+ WindowNonClientMouseUp: "windows:WindowNonClientMouseUp",
46
+ WindowPaint: "windows:WindowPaint",
47
+ WindowRestore: "windows:WindowRestore",
48
+ WindowSetFocus: "windows:WindowSetFocus",
49
+ WindowShow: "windows:WindowShow",
50
+ WindowStartMove: "windows:WindowStartMove",
51
+ WindowStartResize: "windows:WindowStartResize",
52
+ WindowUnFullscreen: "windows:WindowUnFullscreen",
53
+ WindowZOrderChanged: "windows:WindowZOrderChanged",
54
+ WindowMinimise: "windows:WindowMinimise",
55
+ WindowUnMinimise: "windows:WindowUnMinimise",
56
+ WindowMaximise: "windows:WindowMaximise",
57
+ WindowUnMaximise: "windows:WindowUnMaximise",
58
+ }),
59
+ Mac: Object.freeze({
60
+ ApplicationDidBecomeActive: "mac:ApplicationDidBecomeActive",
61
+ ApplicationDidChangeBackingProperties: "mac:ApplicationDidChangeBackingProperties",
62
+ ApplicationDidChangeEffectiveAppearance: "mac:ApplicationDidChangeEffectiveAppearance",
63
+ ApplicationDidChangeIcon: "mac:ApplicationDidChangeIcon",
64
+ ApplicationDidChangeOcclusionState: "mac:ApplicationDidChangeOcclusionState",
65
+ ApplicationDidChangeScreenParameters: "mac:ApplicationDidChangeScreenParameters",
66
+ ApplicationDidChangeStatusBarFrame: "mac:ApplicationDidChangeStatusBarFrame",
67
+ ApplicationDidChangeStatusBarOrientation: "mac:ApplicationDidChangeStatusBarOrientation",
68
+ ApplicationDidChangeTheme: "mac:ApplicationDidChangeTheme",
69
+ ApplicationDidFinishLaunching: "mac:ApplicationDidFinishLaunching",
70
+ ApplicationDidHide: "mac:ApplicationDidHide",
71
+ ApplicationDidResignActive: "mac:ApplicationDidResignActive",
72
+ ApplicationDidUnhide: "mac:ApplicationDidUnhide",
73
+ ApplicationDidUpdate: "mac:ApplicationDidUpdate",
74
+ ApplicationDidWake: "mac:ApplicationDidWake",
75
+ ApplicationScreensDidSleep: "mac:ApplicationScreensDidSleep",
76
+ ApplicationScreensDidWake: "mac:ApplicationScreensDidWake",
77
+ ApplicationShouldHandleReopen: "mac:ApplicationShouldHandleReopen",
78
+ ApplicationWillBecomeActive: "mac:ApplicationWillBecomeActive",
79
+ ApplicationWillFinishLaunching: "mac:ApplicationWillFinishLaunching",
80
+ ApplicationWillHide: "mac:ApplicationWillHide",
81
+ ApplicationWillResignActive: "mac:ApplicationWillResignActive",
82
+ ApplicationWillSleep: "mac:ApplicationWillSleep",
83
+ ApplicationWillTerminate: "mac:ApplicationWillTerminate",
84
+ ApplicationWillUnhide: "mac:ApplicationWillUnhide",
85
+ ApplicationWillUpdate: "mac:ApplicationWillUpdate",
86
+ MenuDidAddItem: "mac:MenuDidAddItem",
87
+ MenuDidBeginTracking: "mac:MenuDidBeginTracking",
88
+ MenuDidClose: "mac:MenuDidClose",
89
+ MenuDidDisplayItem: "mac:MenuDidDisplayItem",
90
+ MenuDidEndTracking: "mac:MenuDidEndTracking",
91
+ MenuDidHighlightItem: "mac:MenuDidHighlightItem",
92
+ MenuDidOpen: "mac:MenuDidOpen",
93
+ MenuDidPopUp: "mac:MenuDidPopUp",
94
+ MenuDidRemoveItem: "mac:MenuDidRemoveItem",
95
+ MenuDidSendAction: "mac:MenuDidSendAction",
96
+ MenuDidSendActionToItem: "mac:MenuDidSendActionToItem",
97
+ MenuDidUpdate: "mac:MenuDidUpdate",
98
+ MenuWillAddItem: "mac:MenuWillAddItem",
99
+ MenuWillBeginTracking: "mac:MenuWillBeginTracking",
100
+ MenuWillDisplayItem: "mac:MenuWillDisplayItem",
101
+ MenuWillEndTracking: "mac:MenuWillEndTracking",
102
+ MenuWillHighlightItem: "mac:MenuWillHighlightItem",
103
+ MenuWillOpen: "mac:MenuWillOpen",
104
+ MenuWillPopUp: "mac:MenuWillPopUp",
105
+ MenuWillRemoveItem: "mac:MenuWillRemoveItem",
106
+ MenuWillSendAction: "mac:MenuWillSendAction",
107
+ MenuWillSendActionToItem: "mac:MenuWillSendActionToItem",
108
+ MenuWillUpdate: "mac:MenuWillUpdate",
109
+ WebViewDidCommitNavigation: "mac:WebViewDidCommitNavigation",
110
+ WebViewDidFinishNavigation: "mac:WebViewDidFinishNavigation",
111
+ WebViewDidReceiveServerRedirectForProvisionalNavigation: "mac:WebViewDidReceiveServerRedirectForProvisionalNavigation",
112
+ WebViewDidStartProvisionalNavigation: "mac:WebViewDidStartProvisionalNavigation",
113
+ WindowDidBecomeKey: "mac:WindowDidBecomeKey",
114
+ WindowDidBecomeMain: "mac:WindowDidBecomeMain",
115
+ WindowDidBeginSheet: "mac:WindowDidBeginSheet",
116
+ WindowDidChangeAlpha: "mac:WindowDidChangeAlpha",
117
+ WindowDidChangeBackingLocation: "mac:WindowDidChangeBackingLocation",
118
+ WindowDidChangeBackingProperties: "mac:WindowDidChangeBackingProperties",
119
+ WindowDidChangeCollectionBehavior: "mac:WindowDidChangeCollectionBehavior",
120
+ WindowDidChangeEffectiveAppearance: "mac:WindowDidChangeEffectiveAppearance",
121
+ WindowDidChangeOcclusionState: "mac:WindowDidChangeOcclusionState",
122
+ WindowDidChangeOrderingMode: "mac:WindowDidChangeOrderingMode",
123
+ WindowDidChangeScreen: "mac:WindowDidChangeScreen",
124
+ WindowDidChangeScreenParameters: "mac:WindowDidChangeScreenParameters",
125
+ WindowDidChangeScreenProfile: "mac:WindowDidChangeScreenProfile",
126
+ WindowDidChangeScreenSpace: "mac:WindowDidChangeScreenSpace",
127
+ WindowDidChangeScreenSpaceProperties: "mac:WindowDidChangeScreenSpaceProperties",
128
+ WindowDidChangeSharingType: "mac:WindowDidChangeSharingType",
129
+ WindowDidChangeSpace: "mac:WindowDidChangeSpace",
130
+ WindowDidChangeSpaceOrderingMode: "mac:WindowDidChangeSpaceOrderingMode",
131
+ WindowDidChangeTitle: "mac:WindowDidChangeTitle",
132
+ WindowDidChangeToolbar: "mac:WindowDidChangeToolbar",
133
+ WindowDidDeminiaturize: "mac:WindowDidDeminiaturize",
134
+ WindowDidEndSheet: "mac:WindowDidEndSheet",
135
+ WindowDidEnterFullScreen: "mac:WindowDidEnterFullScreen",
136
+ WindowDidEnterVersionBrowser: "mac:WindowDidEnterVersionBrowser",
137
+ WindowDidExitFullScreen: "mac:WindowDidExitFullScreen",
138
+ WindowDidExitVersionBrowser: "mac:WindowDidExitVersionBrowser",
139
+ WindowDidExpose: "mac:WindowDidExpose",
140
+ WindowDidFocus: "mac:WindowDidFocus",
141
+ WindowDidMiniaturize: "mac:WindowDidMiniaturize",
142
+ WindowDidMove: "mac:WindowDidMove",
143
+ WindowDidOrderOffScreen: "mac:WindowDidOrderOffScreen",
144
+ WindowDidOrderOnScreen: "mac:WindowDidOrderOnScreen",
145
+ WindowDidResignKey: "mac:WindowDidResignKey",
146
+ WindowDidResignMain: "mac:WindowDidResignMain",
147
+ WindowDidResize: "mac:WindowDidResize",
148
+ WindowDidUpdate: "mac:WindowDidUpdate",
149
+ WindowDidUpdateAlpha: "mac:WindowDidUpdateAlpha",
150
+ WindowDidUpdateCollectionBehavior: "mac:WindowDidUpdateCollectionBehavior",
151
+ WindowDidUpdateCollectionProperties: "mac:WindowDidUpdateCollectionProperties",
152
+ WindowDidUpdateShadow: "mac:WindowDidUpdateShadow",
153
+ WindowDidUpdateTitle: "mac:WindowDidUpdateTitle",
154
+ WindowDidUpdateToolbar: "mac:WindowDidUpdateToolbar",
155
+ WindowDidZoom: "mac:WindowDidZoom",
156
+ WindowFileDraggingEntered: "mac:WindowFileDraggingEntered",
157
+ WindowFileDraggingExited: "mac:WindowFileDraggingExited",
158
+ WindowFileDraggingPerformed: "mac:WindowFileDraggingPerformed",
159
+ WindowHide: "mac:WindowHide",
160
+ WindowMaximise: "mac:WindowMaximise",
161
+ WindowUnMaximise: "mac:WindowUnMaximise",
162
+ WindowMinimise: "mac:WindowMinimise",
163
+ WindowUnMinimise: "mac:WindowUnMinimise",
164
+ WindowShouldClose: "mac:WindowShouldClose",
165
+ WindowShow: "mac:WindowShow",
166
+ WindowWillBecomeKey: "mac:WindowWillBecomeKey",
167
+ WindowWillBecomeMain: "mac:WindowWillBecomeMain",
168
+ WindowWillBeginSheet: "mac:WindowWillBeginSheet",
169
+ WindowWillChangeOrderingMode: "mac:WindowWillChangeOrderingMode",
170
+ WindowWillClose: "mac:WindowWillClose",
171
+ WindowWillDeminiaturize: "mac:WindowWillDeminiaturize",
172
+ WindowWillEnterFullScreen: "mac:WindowWillEnterFullScreen",
173
+ WindowWillEnterVersionBrowser: "mac:WindowWillEnterVersionBrowser",
174
+ WindowWillExitFullScreen: "mac:WindowWillExitFullScreen",
175
+ WindowWillExitVersionBrowser: "mac:WindowWillExitVersionBrowser",
176
+ WindowWillFocus: "mac:WindowWillFocus",
177
+ WindowWillMiniaturize: "mac:WindowWillMiniaturize",
178
+ WindowWillMove: "mac:WindowWillMove",
179
+ WindowWillOrderOffScreen: "mac:WindowWillOrderOffScreen",
180
+ WindowWillOrderOnScreen: "mac:WindowWillOrderOnScreen",
181
+ WindowWillResignMain: "mac:WindowWillResignMain",
182
+ WindowWillResize: "mac:WindowWillResize",
183
+ WindowWillUnfocus: "mac:WindowWillUnfocus",
184
+ WindowWillUpdate: "mac:WindowWillUpdate",
185
+ WindowWillUpdateAlpha: "mac:WindowWillUpdateAlpha",
186
+ WindowWillUpdateCollectionBehavior: "mac:WindowWillUpdateCollectionBehavior",
187
+ WindowWillUpdateCollectionProperties: "mac:WindowWillUpdateCollectionProperties",
188
+ WindowWillUpdateShadow: "mac:WindowWillUpdateShadow",
189
+ WindowWillUpdateTitle: "mac:WindowWillUpdateTitle",
190
+ WindowWillUpdateToolbar: "mac:WindowWillUpdateToolbar",
191
+ WindowWillUpdateVisibility: "mac:WindowWillUpdateVisibility",
192
+ WindowWillUseStandardFrame: "mac:WindowWillUseStandardFrame",
193
+ WindowZoomIn: "mac:WindowZoomIn",
194
+ WindowZoomOut: "mac:WindowZoomOut",
195
+ WindowZoomReset: "mac:WindowZoomReset",
196
+ }),
197
+ Linux: Object.freeze({
198
+ ApplicationStartup: "linux:ApplicationStartup",
199
+ SystemDidWake: "linux:SystemDidWake",
200
+ SystemThemeChanged: "linux:SystemThemeChanged",
201
+ SystemWillSleep: "linux:SystemWillSleep",
202
+ WindowDeleteEvent: "linux:WindowDeleteEvent",
203
+ WindowDidMove: "linux:WindowDidMove",
204
+ WindowDidResize: "linux:WindowDidResize",
205
+ WindowFocusIn: "linux:WindowFocusIn",
206
+ WindowFocusOut: "linux:WindowFocusOut",
207
+ WindowLoadStarted: "linux:WindowLoadStarted",
208
+ WindowLoadRedirected: "linux:WindowLoadRedirected",
209
+ WindowLoadCommitted: "linux:WindowLoadCommitted",
210
+ WindowLoadFinished: "linux:WindowLoadFinished",
211
+ }),
212
+ iOS: Object.freeze({
213
+ ApplicationDidBecomeActive: "ios:ApplicationDidBecomeActive",
214
+ ApplicationDidEnterBackground: "ios:ApplicationDidEnterBackground",
215
+ ApplicationDidFinishLaunching: "ios:ApplicationDidFinishLaunching",
216
+ ApplicationDidReceiveMemoryWarning: "ios:ApplicationDidReceiveMemoryWarning",
217
+ ApplicationWillEnterForeground: "ios:ApplicationWillEnterForeground",
218
+ ApplicationWillResignActive: "ios:ApplicationWillResignActive",
219
+ ApplicationWillTerminate: "ios:ApplicationWillTerminate",
220
+ WindowDidLoad: "ios:WindowDidLoad",
221
+ WindowWillAppear: "ios:WindowWillAppear",
222
+ WindowDidAppear: "ios:WindowDidAppear",
223
+ WindowWillDisappear: "ios:WindowWillDisappear",
224
+ WindowDidDisappear: "ios:WindowDidDisappear",
225
+ WindowSafeAreaInsetsChanged: "ios:WindowSafeAreaInsetsChanged",
226
+ WindowOrientationChanged: "ios:WindowOrientationChanged",
227
+ WindowTouchBegan: "ios:WindowTouchBegan",
228
+ WindowTouchMoved: "ios:WindowTouchMoved",
229
+ WindowTouchEnded: "ios:WindowTouchEnded",
230
+ WindowTouchCancelled: "ios:WindowTouchCancelled",
231
+ WebViewDidStartNavigation: "ios:WebViewDidStartNavigation",
232
+ WebViewDidFinishNavigation: "ios:WebViewDidFinishNavigation",
233
+ WebViewDidFailNavigation: "ios:WebViewDidFailNavigation",
234
+ WebViewDecidePolicyForNavigationAction: "ios:WebViewDecidePolicyForNavigationAction",
235
+ BatteryChanged: "ios:BatteryChanged",
236
+ NetworkChanged: "ios:NetworkChanged",
237
+ ThemeChanged: "ios:ThemeChanged",
238
+ ScreenLocked: "ios:ScreenLocked",
239
+ ScreenUnlocked: "ios:ScreenUnlocked",
240
+ }),
241
+ Android: Object.freeze({
242
+ ActivityCreated: "android:ActivityCreated",
243
+ ActivityStarted: "android:ActivityStarted",
244
+ ActivityResumed: "android:ActivityResumed",
245
+ ActivityPaused: "android:ActivityPaused",
246
+ ActivityStopped: "android:ActivityStopped",
247
+ ActivityDestroyed: "android:ActivityDestroyed",
248
+ ApplicationLowMemory: "android:ApplicationLowMemory",
249
+ WebViewPageStarted: "android:WebViewPageStarted",
250
+ WebViewPageFinished: "android:WebViewPageFinished",
251
+ BatteryChanged: "android:BatteryChanged",
252
+ NetworkChanged: "android:NetworkChanged",
253
+ ThemeChanged: "android:ThemeChanged",
254
+ ScreenLocked: "android:ScreenLocked",
255
+ ScreenUnlocked: "android:ScreenUnlocked",
256
+ }),
257
+ Common: Object.freeze({
258
+ ApplicationOpenedWithFile: "common:ApplicationOpenedWithFile",
259
+ ApplicationStarted: "common:ApplicationStarted",
260
+ ApplicationLaunchedWithUrl: "common:ApplicationLaunchedWithUrl",
261
+ ThemeChanged: "common:ThemeChanged",
262
+ SystemDidWake: "common:SystemDidWake",
263
+ SystemWillSleep: "common:SystemWillSleep",
264
+ WindowClosing: "common:WindowClosing",
265
+ WindowDidMove: "common:WindowDidMove",
266
+ WindowDidResize: "common:WindowDidResize",
267
+ WindowDPIChanged: "common:WindowDPIChanged",
268
+ WindowFilesDropped: "common:WindowFilesDropped",
269
+ WindowFocus: "common:WindowFocus",
270
+ WindowFullscreen: "common:WindowFullscreen",
271
+ WindowHide: "common:WindowHide",
272
+ WindowLostFocus: "common:WindowLostFocus",
273
+ WindowMaximise: "common:WindowMaximise",
274
+ WindowMinimise: "common:WindowMinimise",
275
+ WindowToggleFrameless: "common:WindowToggleFrameless",
276
+ WindowRestore: "common:WindowRestore",
277
+ WindowRuntimeReady: "common:WindowRuntimeReady",
278
+ WindowShow: "common:WindowShow",
279
+ WindowUnFullscreen: "common:WindowUnFullscreen",
280
+ WindowUnMaximise: "common:WindowUnMaximise",
281
+ WindowUnMinimise: "common:WindowUnMinimise",
282
+ WindowZoom: "common:WindowZoom",
283
+ WindowZoomIn: "common:WindowZoomIn",
284
+ WindowZoomOut: "common:WindowZoomOut",
285
+ WindowZoomReset: "common:WindowZoomReset",
286
+ BatteryChanged: "common:BatteryChanged",
287
+ NetworkChanged: "common:NetworkChanged",
288
+ ScreenLocked: "common:ScreenLocked",
289
+ ScreenUnlocked: "common:ScreenUnlocked",
290
+ LowMemory: "common:LowMemory",
291
+ }),
292
+ });
package/dist/events.js ADDED
@@ -0,0 +1,119 @@
1
+ /*
2
+ _ __ _ __
3
+ | | / /___ _(_) /____
4
+ | | /| / / __ `/ / / ___/
5
+ | |/ |/ / /_/ / / (__ )
6
+ |__/|__/\__,_/_/_/____/
7
+ The electron alternative for Go
8
+ (c) Lea Anthony 2019-present
9
+ */
10
+ import { newRuntimeCaller, objectNames } from "./runtime.js";
11
+ import { eventListeners, Listener, listenerOff } from "./listener.js";
12
+ import { Events as Create } from "./create.js";
13
+ import { Types } from "./event_types.js";
14
+ // Setup
15
+ import { hasDOM } from "./environment.js";
16
+ if (hasDOM) {
17
+ window._wails = window._wails || {};
18
+ window._wails.dispatchWailsEvent = dispatchWailsEvent;
19
+ }
20
+ const call = newRuntimeCaller(objectNames.Events);
21
+ const EmitMethod = 0;
22
+ export * from "./event_types.js";
23
+ /**
24
+ * Represents a system event or a custom event emitted through wails-provided facilities.
25
+ */
26
+ export class WailsEvent {
27
+ constructor(name, data) {
28
+ this.name = name;
29
+ this.data = data !== null && data !== void 0 ? data : null;
30
+ }
31
+ }
32
+ function dispatchWailsEvent(event) {
33
+ let listeners = eventListeners.get(event.name);
34
+ if (!listeners) {
35
+ return;
36
+ }
37
+ let wailsEvent = new WailsEvent(event.name, (event.name in Create) ? Create[event.name](event.data) : event.data);
38
+ if ('sender' in event) {
39
+ wailsEvent.sender = event.sender;
40
+ }
41
+ // Dispatch to a snapshot, then remove all expired listeners in a single
42
+ // post-dispatch filter of the live map.
43
+ // - Writing the snapshot back wholesale would undo subscription changes
44
+ // made inside a handler (#4393).
45
+ // - Calling listenerOff() per expired listener inside the loop is O(n²)
46
+ // when many listeners expire on the same event.
47
+ // Filtering the live array once after dispatch is O(n) and still honours
48
+ // any listeners added or removed by handlers during dispatch.
49
+ const expired = new Set();
50
+ for (const listener of listeners.slice()) {
51
+ if (listener.dispatch(wailsEvent)) {
52
+ expired.add(listener);
53
+ }
54
+ }
55
+ if (expired.size > 0) {
56
+ const live = eventListeners.get(event.name);
57
+ if (live) {
58
+ const remaining = live.filter(l => !expired.has(l));
59
+ if (remaining.length === 0) {
60
+ eventListeners.delete(event.name);
61
+ }
62
+ else {
63
+ eventListeners.set(event.name, remaining);
64
+ }
65
+ }
66
+ }
67
+ }
68
+ /**
69
+ * Register a callback function to be called multiple times for a specific event.
70
+ *
71
+ * @param eventName - The name of the event to register the callback for.
72
+ * @param callback - The callback function to be called when the event is triggered.
73
+ * @param maxCallbacks - The maximum number of times the callback can be called for the event. Once the maximum number is reached, the callback will no longer be called.
74
+ * @returns A function that, when called, will unregister the callback from the event.
75
+ */
76
+ export function OnMultiple(eventName, callback, maxCallbacks) {
77
+ let listeners = eventListeners.get(eventName) || [];
78
+ const thisListener = new Listener(eventName, callback, maxCallbacks);
79
+ listeners.push(thisListener);
80
+ eventListeners.set(eventName, listeners);
81
+ return () => listenerOff(thisListener);
82
+ }
83
+ /**
84
+ * Registers a callback function to be executed when the specified event occurs.
85
+ *
86
+ * @param eventName - The name of the event to register the callback for.
87
+ * @param callback - The callback function to be called when the event is triggered.
88
+ * @returns A function that, when called, will unregister the callback from the event.
89
+ */
90
+ export function On(eventName, callback) {
91
+ return OnMultiple(eventName, callback, -1);
92
+ }
93
+ /**
94
+ * Registers a callback function to be executed only once for the specified event.
95
+ *
96
+ * @param eventName - The name of the event to register the callback for.
97
+ * @param callback - The callback function to be called when the event is triggered.
98
+ * @returns A function that, when called, will unregister the callback from the event.
99
+ */
100
+ export function Once(eventName, callback) {
101
+ return OnMultiple(eventName, callback, 1);
102
+ }
103
+ /**
104
+ * Removes event listeners for the specified event names.
105
+ *
106
+ * @param eventNames - The name of the events to remove listeners for.
107
+ */
108
+ export function Off(...eventNames) {
109
+ eventNames.forEach(eventName => eventListeners.delete(eventName));
110
+ }
111
+ /**
112
+ * Removes all event listeners.
113
+ */
114
+ export function OffAll() {
115
+ eventListeners.clear();
116
+ }
117
+ export function Emit(name, data) {
118
+ return call(EmitMethod, new WailsEvent(name, data));
119
+ }
package/dist/flags.js ADDED
@@ -0,0 +1,23 @@
1
+ /*
2
+ _ __ _ __
3
+ | | / /___ _(_) /____
4
+ | | /| / / __ `/ / / ___/
5
+ | |/ |/ / /_/ / / (__ )
6
+ |__/|__/\__,_/_/_/____/
7
+ The electron alternative for Go
8
+ (c) Lea Anthony 2019-present
9
+ */
10
+ /**
11
+ * Retrieves the value associated with the specified key from the flag map.
12
+ *
13
+ * @param key - The key to retrieve the value for.
14
+ * @return The value associated with the specified key.
15
+ */
16
+ export function GetFlag(key) {
17
+ try {
18
+ return window._wails.flags[key];
19
+ }
20
+ catch (e) {
21
+ throw new Error("Unable to retrieve flag '" + key + "': " + e, { cause: e });
22
+ }
23
+ }
package/dist/index.js ADDED
@@ -0,0 +1,88 @@
1
+ /*
2
+ _ __ _ __
3
+ | | / /___ _(_) /____
4
+ | | /| / / __ `/ / / ___/
5
+ | |/ |/ / /_/ / / (__ )
6
+ |__/|__/\__,_/_/_/____/
7
+ The electron alternative for Go
8
+ (c) Lea Anthony 2019-present
9
+ */
10
+ // Setup
11
+ import { hasDOM } from "./environment.js";
12
+ if (hasDOM) {
13
+ window._wails = window._wails || {};
14
+ }
15
+ import "./contextmenu.js";
16
+ import "./drag.js";
17
+ // Re-export public API
18
+ import * as Application from "./application.js";
19
+ import * as Browser from "./browser.js";
20
+ import * as Call from "./calls.js";
21
+ import * as Clipboard from "./clipboard.js";
22
+ import * as Create from "./create.js";
23
+ import * as Dialogs from "./dialogs.js";
24
+ import * as Events from "./events.js";
25
+ import * as Flags from "./flags.js";
26
+ import * as Screens from "./screens.js";
27
+ import * as System from "./system.js";
28
+ import * as IOS from "./ios.js";
29
+ import * as Android from "./android.js";
30
+ import * as Updater from "./updater.js";
31
+ import Window, { handleDragEnter, handleDragLeave, handleDragOver } from "./window.js";
32
+ import * as WML from "./wml.js";
33
+ export { Application, Browser, Call, Clipboard, Dialogs, Events, Flags, Screens, System, IOS, Android, Updater, Window, WML };
34
+ /**
35
+ * An internal utility consumed by the binding generator.
36
+ *
37
+ * @ignore
38
+ */
39
+ export { Create };
40
+ export * from "./cancellable.js";
41
+ // Export transport interfaces and utilities
42
+ export { setTransport, getTransport, objectNames, clientId, } from "./runtime.js";
43
+ import { clientId } from "./runtime.js";
44
+ // Notify backend
45
+ if (hasDOM) {
46
+ window._wails.invoke = System.invoke;
47
+ window._wails.clientId = clientId;
48
+ }
49
+ // Register platform handlers (internal API)
50
+ // Note: Window is the thisWindow instance (default export from window.ts)
51
+ // Binding ensures 'this' correctly refers to the current window instance
52
+ if (hasDOM) {
53
+ window._wails.handlePlatformFileDrop = Window.HandlePlatformFileDrop.bind(Window);
54
+ }
55
+ // Linux-specific drag handlers (GTK intercepts DOM drag events)
56
+ if (hasDOM) {
57
+ window._wails.handleDragEnter = handleDragEnter;
58
+ window._wails.handleDragLeave = handleDragLeave;
59
+ window._wails.handleDragOver = handleDragOver;
60
+ }
61
+ if (hasDOM) {
62
+ System.invoke("wails:runtime:ready");
63
+ }
64
+ /**
65
+ * Loads a script from the given URL if it exists.
66
+ * Uses HEAD request to check existence, then injects a script tag.
67
+ * Silently ignores if the script doesn't exist.
68
+ */
69
+ export function loadOptionalScript(url) {
70
+ return fetch(url, { method: 'HEAD' })
71
+ .then(response => {
72
+ if (response.ok) {
73
+ // Verify the response is actually JavaScript and not an HTML fallback
74
+ // (e.g. Vite dev server returns index.html for unknown routes)
75
+ const contentType = (response.headers.get('content-type') || '').toLowerCase();
76
+ if (contentType.includes('javascript')) {
77
+ const script = document.createElement('script');
78
+ script.src = url;
79
+ document.head.appendChild(script);
80
+ }
81
+ }
82
+ })
83
+ .catch(() => { }); // Silently ignore - script is optional
84
+ }
85
+ // Load custom.js if available (used by server mode for WebSocket events, etc.)
86
+ if (hasDOM) {
87
+ loadOptionalScript('/wails/custom.js');
88
+ }
package/dist/ios.js ADDED
@@ -0,0 +1,28 @@
1
+ /*
2
+ _ __ _ __
3
+ | | / /___ _(_) /____
4
+ | | /| / / __ `/ / / ___/
5
+ | |/ |/ / /_/ / / (__ )
6
+ |__/|__/\__,_/_/_/____/
7
+ The electron alternative for Go
8
+ (c) Lea Anthony 2019-present
9
+ */
10
+ import { newRuntimeCaller, objectNames } from "./runtime.js";
11
+ const call = newRuntimeCaller(objectNames.IOS);
12
+ // Method IDs
13
+ const HapticsImpact = 0;
14
+ const DeviceInfo = 1;
15
+ export var Haptics;
16
+ (function (Haptics) {
17
+ function Impact(style = "medium") {
18
+ return call(HapticsImpact, { style });
19
+ }
20
+ Haptics.Impact = Impact;
21
+ })(Haptics || (Haptics = {}));
22
+ export var Device;
23
+ (function (Device) {
24
+ function Info() {
25
+ return call(DeviceInfo);
26
+ }
27
+ Device.Info = Info;
28
+ })(Device || (Device = {}));
@@ -0,0 +1,44 @@
1
+ /*
2
+ _ __ _ __
3
+ | | / /___ _(_) /____
4
+ | | /| / / __ `/ / / ___/
5
+ | |/ |/ / /_/ / / (__ )
6
+ |__/|__/\__,_/_/_/____/
7
+ The electron alternative for Go
8
+ (c) Lea Anthony 2019-present
9
+ */
10
+ // The following utilities have been factored out of ./events.ts
11
+ // for testing purposes.
12
+ export const eventListeners = new Map();
13
+ export class Listener {
14
+ constructor(eventName, callback, maxCallbacks) {
15
+ this.eventName = eventName;
16
+ this.callback = callback;
17
+ this.maxCallbacks = maxCallbacks || -1;
18
+ }
19
+ dispatch(data) {
20
+ try {
21
+ this.callback(data);
22
+ }
23
+ catch (err) {
24
+ console.error(err);
25
+ }
26
+ if (this.maxCallbacks === -1)
27
+ return false;
28
+ this.maxCallbacks -= 1;
29
+ return this.maxCallbacks === 0;
30
+ }
31
+ }
32
+ export function listenerOff(listener) {
33
+ let listeners = eventListeners.get(listener.eventName);
34
+ if (!listeners) {
35
+ return;
36
+ }
37
+ listeners = listeners.filter(l => l !== listener);
38
+ if (listeners.length === 0) {
39
+ eventListeners.delete(listener.eventName);
40
+ }
41
+ else {
42
+ eventListeners.set(listener.eventName, listeners);
43
+ }
44
+ }
package/dist/nanoid.js ADDED
@@ -0,0 +1,38 @@
1
+ // Source: https://github.com/ai/nanoid
2
+ // The MIT License (MIT)
3
+ //
4
+ // Copyright 2017 Andrey Sitnik <andrey@sitnik.ru>
5
+ //
6
+ // Permission is hereby granted, free of charge, to any person obtaining a copy of
7
+ // this software and associated documentation files (the "Software"), to deal in
8
+ // the Software without restriction, including without limitation the rights to
9
+ // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
10
+ // the Software, and to permit persons to whom the Software is furnished to do so,
11
+ // subject to the following conditions:
12
+ //
13
+ // The above copyright notice and this permission notice shall be included in all
14
+ // copies or substantial portions of the Software.
15
+ //
16
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
18
+ // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
19
+ // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
20
+ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21
+ // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+ // This alphabet uses `A-Za-z0-9_-` symbols.
23
+ // The order of characters is optimized for better gzip and brotli compression.
24
+ // References to the same file (works both for gzip and brotli):
25
+ // `'use`, `andom`, and `rict'`
26
+ // References to the brotli default dictionary:
27
+ // `-26T`, `1983`, `40px`, `75px`, `bush`, `jack`, `mind`, `very`, and `wolf`
28
+ const urlAlphabet = 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict';
29
+ export function nanoid(size = 21) {
30
+ let id = '';
31
+ // A compact alternative for `for (var i = 0; i < step; i++)`.
32
+ let i = size | 0;
33
+ while (i--) {
34
+ // `| 0` is more compact and faster than `Math.floor()`.
35
+ id += urlAlphabet[(Math.random() * 64) | 0];
36
+ }
37
+ return id;
38
+ }