@wailsio/runtime 3.0.0-alpha.65 → 3.0.0-alpha.69

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 (142) hide show
  1. package/{src → dist}/application.js +2 -16
  2. package/dist/browser.js +20 -0
  3. package/dist/callable.js +144 -0
  4. package/dist/calls.js +194 -0
  5. package/dist/cancellable.js +792 -0
  6. package/dist/clipboard.js +30 -0
  7. package/dist/contextmenu.js +80 -0
  8. package/{src → dist}/create.js +2 -33
  9. package/dist/dialogs.js +134 -0
  10. package/dist/drag.js +222 -0
  11. package/dist/event_types.js +232 -0
  12. package/dist/events.js +114 -0
  13. package/dist/flags.js +23 -0
  14. package/dist/index.js +38 -0
  15. package/dist/listener.js +44 -0
  16. package/{src → dist}/nanoid.js +7 -11
  17. package/dist/runtime.js +63 -0
  18. package/dist/screens.js +38 -0
  19. package/dist/system.js +146 -0
  20. package/{src → dist}/utils.js +29 -20
  21. package/dist/window.js +570 -0
  22. package/{src → dist}/wml.js +52 -123
  23. package/package.json +43 -19
  24. package/types/application.d.ts +3 -10
  25. package/types/browser.d.ts +4 -4
  26. package/types/callable.d.ts +3 -0
  27. package/types/calls.d.ts +43 -49
  28. package/types/cancellable.d.ts +434 -0
  29. package/types/clipboard.d.ts +6 -5
  30. package/types/contextmenu.d.ts +1 -0
  31. package/types/create.d.ts +6 -27
  32. package/types/dialogs.d.ts +99 -143
  33. package/types/drag.d.ts +1 -0
  34. package/types/event_types.d.ts +221 -219
  35. package/types/events.d.ts +46 -250
  36. package/types/flags.d.ts +3 -3
  37. package/types/index.d.ts +16 -14
  38. package/types/listener.d.ts +9 -0
  39. package/types/nanoid.d.ts +1 -1
  40. package/types/runtime.d.ts +18 -26
  41. package/types/screens.d.ts +42 -76
  42. package/types/system.d.ts +59 -79
  43. package/types/utils.d.ts +15 -8
  44. package/types/window.d.ts +123 -224
  45. package/types/wml.d.ts +2 -6
  46. package/docs/.nojekyll +0 -1
  47. package/docs/assets/highlight.css +0 -22
  48. package/docs/assets/icons.js +0 -15
  49. package/docs/assets/icons.svg +0 -1
  50. package/docs/assets/main.js +0 -59
  51. package/docs/assets/navigation.js +0 -1
  52. package/docs/assets/search.js +0 -1
  53. package/docs/assets/style.css +0 -1415
  54. package/docs/classes/Call.RuntimeError.html +0 -11
  55. package/docs/classes/Events.WailsEvent.html +0 -4
  56. package/docs/functions/Application.Hide.html +0 -2
  57. package/docs/functions/Application.Quit.html +0 -2
  58. package/docs/functions/Application.Show.html +0 -2
  59. package/docs/functions/Browser.OpenURL.html +0 -3
  60. package/docs/functions/Call.ByID.html +0 -8
  61. package/docs/functions/Call.ByName.html +0 -6
  62. package/docs/functions/Call.Call.html +0 -11
  63. package/docs/functions/Clipboard.SetText.html +0 -6
  64. package/docs/functions/Clipboard.Text.html +0 -3
  65. package/docs/functions/Create.Any.html +0 -2
  66. package/docs/functions/Create.Array.html +0 -4
  67. package/docs/functions/Create.ByteSlice.html +0 -3
  68. package/docs/functions/Create.Map.html +0 -4
  69. package/docs/functions/Create.Nullable.html +0 -3
  70. package/docs/functions/Create.Struct.html +0 -3
  71. package/docs/functions/Dialogs.Error.html +0 -5
  72. package/docs/functions/Dialogs.Info.html +0 -5
  73. package/docs/functions/Dialogs.OpenFile.html +0 -3
  74. package/docs/functions/Dialogs.Question.html +0 -5
  75. package/docs/functions/Dialogs.SaveFile.html +0 -3
  76. package/docs/functions/Dialogs.Warning.html +0 -5
  77. package/docs/functions/Events.Emit.html +0 -6
  78. package/docs/functions/Events.Off.html +0 -4
  79. package/docs/functions/Events.OffAll.html +0 -3
  80. package/docs/functions/Events.On.html +0 -7
  81. package/docs/functions/Events.OnMultiple.html +0 -8
  82. package/docs/functions/Events.Once.html +0 -7
  83. package/docs/functions/Events.setup.html +0 -1
  84. package/docs/functions/Flags.GetFlag.html +0 -6
  85. package/docs/functions/Screens.GetAll.html +0 -3
  86. package/docs/functions/Screens.GetCurrent.html +0 -3
  87. package/docs/functions/Screens.GetPrimary.html +0 -3
  88. package/docs/functions/System.Capabilities.html +0 -4
  89. package/docs/functions/System.Environment.html +0 -5
  90. package/docs/functions/System.IsAMD64.html +0 -3
  91. package/docs/functions/System.IsARM.html +0 -3
  92. package/docs/functions/System.IsARM64.html +0 -5
  93. package/docs/functions/System.IsDarkMode.html +0 -5
  94. package/docs/functions/System.IsDebug.html +0 -1
  95. package/docs/functions/System.IsLinux.html +0 -3
  96. package/docs/functions/System.IsMac.html +0 -3
  97. package/docs/functions/System.IsWindows.html +0 -3
  98. package/docs/functions/System.invoke.html +0 -1
  99. package/docs/functions/WML.Enable.html +0 -2
  100. package/docs/functions/WML.Reload.html +0 -2
  101. package/docs/functions/init.html +0 -1
  102. package/docs/index.html +0 -5
  103. package/docs/interfaces/Call.CallOptions.html +0 -7
  104. package/docs/interfaces/Dialogs.Button.html +0 -7
  105. package/docs/interfaces/Dialogs.FileFilter.html +0 -5
  106. package/docs/interfaces/Dialogs.MessageDialogOptions.html +0 -9
  107. package/docs/interfaces/Dialogs.OpenFileDialogOptions.html +0 -33
  108. package/docs/interfaces/Dialogs.SaveFileDialogOptions.html +0 -35
  109. package/docs/interfaces/Screens.Rect.html +0 -9
  110. package/docs/interfaces/Screens.Screen.html +0 -25
  111. package/docs/interfaces/Screens.Size.html +0 -5
  112. package/docs/interfaces/System.EnvironmentInfo.html +0 -11
  113. package/docs/interfaces/System.OSInfo.html +0 -9
  114. package/docs/modules/Application.html +0 -4
  115. package/docs/modules/Browser.html +0 -2
  116. package/docs/modules/Call.html +0 -6
  117. package/docs/modules/Clipboard.html +0 -3
  118. package/docs/modules/Create.html +0 -7
  119. package/docs/modules/Dialogs.html +0 -12
  120. package/docs/modules/Events.html +0 -10
  121. package/docs/modules/Flags.html +0 -2
  122. package/docs/modules/Screens.html +0 -7
  123. package/docs/modules/System.html +0 -14
  124. package/docs/modules/WML.html +0 -3
  125. package/docs/modules.html +0 -14
  126. package/docs/variables/Events.Types.html +0 -1
  127. package/docs/variables/Window.html +0 -2
  128. package/src/browser.js +0 -24
  129. package/src/calls.js +0 -221
  130. package/src/clipboard.js +0 -35
  131. package/src/contextmenu.js +0 -97
  132. package/src/dialogs.js +0 -200
  133. package/src/drag.js +0 -119
  134. package/src/event_types.js +0 -219
  135. package/src/events.js +0 -140
  136. package/src/flags.js +0 -25
  137. package/src/index.js +0 -60
  138. package/src/runtime.js +0 -92
  139. package/src/screens.js +0 -71
  140. package/src/system.js +0 -143
  141. package/src/window.js +0 -638
  142. package/tsconfig.json +0 -20
@@ -0,0 +1,232 @@
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
+ ApplicationShouldHandleReopen: "mac:ApplicationShouldHandleReopen",
75
+ ApplicationWillBecomeActive: "mac:ApplicationWillBecomeActive",
76
+ ApplicationWillFinishLaunching: "mac:ApplicationWillFinishLaunching",
77
+ ApplicationWillHide: "mac:ApplicationWillHide",
78
+ ApplicationWillResignActive: "mac:ApplicationWillResignActive",
79
+ ApplicationWillTerminate: "mac:ApplicationWillTerminate",
80
+ ApplicationWillUnhide: "mac:ApplicationWillUnhide",
81
+ ApplicationWillUpdate: "mac:ApplicationWillUpdate",
82
+ MenuDidAddItem: "mac:MenuDidAddItem",
83
+ MenuDidBeginTracking: "mac:MenuDidBeginTracking",
84
+ MenuDidClose: "mac:MenuDidClose",
85
+ MenuDidDisplayItem: "mac:MenuDidDisplayItem",
86
+ MenuDidEndTracking: "mac:MenuDidEndTracking",
87
+ MenuDidHighlightItem: "mac:MenuDidHighlightItem",
88
+ MenuDidOpen: "mac:MenuDidOpen",
89
+ MenuDidPopUp: "mac:MenuDidPopUp",
90
+ MenuDidRemoveItem: "mac:MenuDidRemoveItem",
91
+ MenuDidSendAction: "mac:MenuDidSendAction",
92
+ MenuDidSendActionToItem: "mac:MenuDidSendActionToItem",
93
+ MenuDidUpdate: "mac:MenuDidUpdate",
94
+ MenuWillAddItem: "mac:MenuWillAddItem",
95
+ MenuWillBeginTracking: "mac:MenuWillBeginTracking",
96
+ MenuWillDisplayItem: "mac:MenuWillDisplayItem",
97
+ MenuWillEndTracking: "mac:MenuWillEndTracking",
98
+ MenuWillHighlightItem: "mac:MenuWillHighlightItem",
99
+ MenuWillOpen: "mac:MenuWillOpen",
100
+ MenuWillPopUp: "mac:MenuWillPopUp",
101
+ MenuWillRemoveItem: "mac:MenuWillRemoveItem",
102
+ MenuWillSendAction: "mac:MenuWillSendAction",
103
+ MenuWillSendActionToItem: "mac:MenuWillSendActionToItem",
104
+ MenuWillUpdate: "mac:MenuWillUpdate",
105
+ WebViewDidCommitNavigation: "mac:WebViewDidCommitNavigation",
106
+ WebViewDidFinishNavigation: "mac:WebViewDidFinishNavigation",
107
+ WebViewDidReceiveServerRedirectForProvisionalNavigation: "mac:WebViewDidReceiveServerRedirectForProvisionalNavigation",
108
+ WebViewDidStartProvisionalNavigation: "mac:WebViewDidStartProvisionalNavigation",
109
+ WindowDidBecomeKey: "mac:WindowDidBecomeKey",
110
+ WindowDidBecomeMain: "mac:WindowDidBecomeMain",
111
+ WindowDidBeginSheet: "mac:WindowDidBeginSheet",
112
+ WindowDidChangeAlpha: "mac:WindowDidChangeAlpha",
113
+ WindowDidChangeBackingLocation: "mac:WindowDidChangeBackingLocation",
114
+ WindowDidChangeBackingProperties: "mac:WindowDidChangeBackingProperties",
115
+ WindowDidChangeCollectionBehavior: "mac:WindowDidChangeCollectionBehavior",
116
+ WindowDidChangeEffectiveAppearance: "mac:WindowDidChangeEffectiveAppearance",
117
+ WindowDidChangeOcclusionState: "mac:WindowDidChangeOcclusionState",
118
+ WindowDidChangeOrderingMode: "mac:WindowDidChangeOrderingMode",
119
+ WindowDidChangeScreen: "mac:WindowDidChangeScreen",
120
+ WindowDidChangeScreenParameters: "mac:WindowDidChangeScreenParameters",
121
+ WindowDidChangeScreenProfile: "mac:WindowDidChangeScreenProfile",
122
+ WindowDidChangeScreenSpace: "mac:WindowDidChangeScreenSpace",
123
+ WindowDidChangeScreenSpaceProperties: "mac:WindowDidChangeScreenSpaceProperties",
124
+ WindowDidChangeSharingType: "mac:WindowDidChangeSharingType",
125
+ WindowDidChangeSpace: "mac:WindowDidChangeSpace",
126
+ WindowDidChangeSpaceOrderingMode: "mac:WindowDidChangeSpaceOrderingMode",
127
+ WindowDidChangeTitle: "mac:WindowDidChangeTitle",
128
+ WindowDidChangeToolbar: "mac:WindowDidChangeToolbar",
129
+ WindowDidDeminiaturize: "mac:WindowDidDeminiaturize",
130
+ WindowDidEndSheet: "mac:WindowDidEndSheet",
131
+ WindowDidEnterFullScreen: "mac:WindowDidEnterFullScreen",
132
+ WindowDidEnterVersionBrowser: "mac:WindowDidEnterVersionBrowser",
133
+ WindowDidExitFullScreen: "mac:WindowDidExitFullScreen",
134
+ WindowDidExitVersionBrowser: "mac:WindowDidExitVersionBrowser",
135
+ WindowDidExpose: "mac:WindowDidExpose",
136
+ WindowDidFocus: "mac:WindowDidFocus",
137
+ WindowDidMiniaturize: "mac:WindowDidMiniaturize",
138
+ WindowDidMove: "mac:WindowDidMove",
139
+ WindowDidOrderOffScreen: "mac:WindowDidOrderOffScreen",
140
+ WindowDidOrderOnScreen: "mac:WindowDidOrderOnScreen",
141
+ WindowDidResignKey: "mac:WindowDidResignKey",
142
+ WindowDidResignMain: "mac:WindowDidResignMain",
143
+ WindowDidResize: "mac:WindowDidResize",
144
+ WindowDidUpdate: "mac:WindowDidUpdate",
145
+ WindowDidUpdateAlpha: "mac:WindowDidUpdateAlpha",
146
+ WindowDidUpdateCollectionBehavior: "mac:WindowDidUpdateCollectionBehavior",
147
+ WindowDidUpdateCollectionProperties: "mac:WindowDidUpdateCollectionProperties",
148
+ WindowDidUpdateShadow: "mac:WindowDidUpdateShadow",
149
+ WindowDidUpdateTitle: "mac:WindowDidUpdateTitle",
150
+ WindowDidUpdateToolbar: "mac:WindowDidUpdateToolbar",
151
+ WindowDidZoom: "mac:WindowDidZoom",
152
+ WindowFileDraggingEntered: "mac:WindowFileDraggingEntered",
153
+ WindowFileDraggingExited: "mac:WindowFileDraggingExited",
154
+ WindowFileDraggingPerformed: "mac:WindowFileDraggingPerformed",
155
+ WindowHide: "mac:WindowHide",
156
+ WindowMaximise: "mac:WindowMaximise",
157
+ WindowUnMaximise: "mac:WindowUnMaximise",
158
+ WindowMinimise: "mac:WindowMinimise",
159
+ WindowUnMinimise: "mac:WindowUnMinimise",
160
+ WindowShouldClose: "mac:WindowShouldClose",
161
+ WindowShow: "mac:WindowShow",
162
+ WindowWillBecomeKey: "mac:WindowWillBecomeKey",
163
+ WindowWillBecomeMain: "mac:WindowWillBecomeMain",
164
+ WindowWillBeginSheet: "mac:WindowWillBeginSheet",
165
+ WindowWillChangeOrderingMode: "mac:WindowWillChangeOrderingMode",
166
+ WindowWillClose: "mac:WindowWillClose",
167
+ WindowWillDeminiaturize: "mac:WindowWillDeminiaturize",
168
+ WindowWillEnterFullScreen: "mac:WindowWillEnterFullScreen",
169
+ WindowWillEnterVersionBrowser: "mac:WindowWillEnterVersionBrowser",
170
+ WindowWillExitFullScreen: "mac:WindowWillExitFullScreen",
171
+ WindowWillExitVersionBrowser: "mac:WindowWillExitVersionBrowser",
172
+ WindowWillFocus: "mac:WindowWillFocus",
173
+ WindowWillMiniaturize: "mac:WindowWillMiniaturize",
174
+ WindowWillMove: "mac:WindowWillMove",
175
+ WindowWillOrderOffScreen: "mac:WindowWillOrderOffScreen",
176
+ WindowWillOrderOnScreen: "mac:WindowWillOrderOnScreen",
177
+ WindowWillResignMain: "mac:WindowWillResignMain",
178
+ WindowWillResize: "mac:WindowWillResize",
179
+ WindowWillUnfocus: "mac:WindowWillUnfocus",
180
+ WindowWillUpdate: "mac:WindowWillUpdate",
181
+ WindowWillUpdateAlpha: "mac:WindowWillUpdateAlpha",
182
+ WindowWillUpdateCollectionBehavior: "mac:WindowWillUpdateCollectionBehavior",
183
+ WindowWillUpdateCollectionProperties: "mac:WindowWillUpdateCollectionProperties",
184
+ WindowWillUpdateShadow: "mac:WindowWillUpdateShadow",
185
+ WindowWillUpdateTitle: "mac:WindowWillUpdateTitle",
186
+ WindowWillUpdateToolbar: "mac:WindowWillUpdateToolbar",
187
+ WindowWillUpdateVisibility: "mac:WindowWillUpdateVisibility",
188
+ WindowWillUseStandardFrame: "mac:WindowWillUseStandardFrame",
189
+ WindowZoomIn: "mac:WindowZoomIn",
190
+ WindowZoomOut: "mac:WindowZoomOut",
191
+ WindowZoomReset: "mac:WindowZoomReset",
192
+ }),
193
+ Linux: Object.freeze({
194
+ ApplicationStartup: "linux:ApplicationStartup",
195
+ SystemThemeChanged: "linux:SystemThemeChanged",
196
+ WindowDeleteEvent: "linux:WindowDeleteEvent",
197
+ WindowDidMove: "linux:WindowDidMove",
198
+ WindowDidResize: "linux:WindowDidResize",
199
+ WindowFocusIn: "linux:WindowFocusIn",
200
+ WindowFocusOut: "linux:WindowFocusOut",
201
+ WindowLoadChanged: "linux:WindowLoadChanged",
202
+ }),
203
+ Common: Object.freeze({
204
+ ApplicationOpenedWithFile: "common:ApplicationOpenedWithFile",
205
+ ApplicationStarted: "common:ApplicationStarted",
206
+ ApplicationLaunchedWithUrl: "common:ApplicationLaunchedWithUrl",
207
+ ThemeChanged: "common:ThemeChanged",
208
+ WindowClosing: "common:WindowClosing",
209
+ WindowDidMove: "common:WindowDidMove",
210
+ WindowDidResize: "common:WindowDidResize",
211
+ WindowDPIChanged: "common:WindowDPIChanged",
212
+ WindowFilesDropped: "common:WindowFilesDropped",
213
+ WindowFocus: "common:WindowFocus",
214
+ WindowFullscreen: "common:WindowFullscreen",
215
+ WindowHide: "common:WindowHide",
216
+ WindowLostFocus: "common:WindowLostFocus",
217
+ WindowMaximise: "common:WindowMaximise",
218
+ WindowMinimise: "common:WindowMinimise",
219
+ WindowToggleFrameless: "common:WindowToggleFrameless",
220
+ WindowRestore: "common:WindowRestore",
221
+ WindowRuntimeReady: "common:WindowRuntimeReady",
222
+ WindowShow: "common:WindowShow",
223
+ WindowUnFullscreen: "common:WindowUnFullscreen",
224
+ WindowUnMaximise: "common:WindowUnMaximise",
225
+ WindowUnMinimise: "common:WindowUnMinimise",
226
+ WindowZoom: "common:WindowZoom",
227
+ WindowZoomIn: "common:WindowZoomIn",
228
+ WindowZoomOut: "common:WindowZoomOut",
229
+ WindowZoomReset: "common:WindowZoomReset",
230
+ WindowDropZoneFilesDropped: "common:WindowDropZoneFilesDropped",
231
+ }),
232
+ });
package/dist/events.js ADDED
@@ -0,0 +1,114 @@
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
+ // Setup
13
+ window._wails = window._wails || {};
14
+ window._wails.dispatchWailsEvent = dispatchWailsEvent;
15
+ const call = newRuntimeCaller(objectNames.Events);
16
+ const EmitMethod = 0;
17
+ export { Types } from "./event_types.js";
18
+ /**
19
+ * Represents a system event or a custom event emitted through wails-provided facilities.
20
+ */
21
+ export class WailsEvent {
22
+ constructor(name, data = null) {
23
+ this.name = name;
24
+ this.data = data;
25
+ }
26
+ }
27
+ function dispatchWailsEvent(event) {
28
+ let listeners = eventListeners.get(event.name);
29
+ if (!listeners) {
30
+ return;
31
+ }
32
+ let wailsEvent = new WailsEvent(event.name, event.data);
33
+ if ('sender' in event) {
34
+ wailsEvent.sender = event.sender;
35
+ }
36
+ listeners = listeners.filter(listener => !listener.dispatch(wailsEvent));
37
+ if (listeners.length === 0) {
38
+ eventListeners.delete(event.name);
39
+ }
40
+ else {
41
+ eventListeners.set(event.name, listeners);
42
+ }
43
+ }
44
+ /**
45
+ * Register a callback function to be called multiple times for a specific event.
46
+ *
47
+ * @param eventName - The name of the event to register the callback for.
48
+ * @param callback - The callback function to be called when the event is triggered.
49
+ * @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.
50
+ * @returns A function that, when called, will unregister the callback from the event.
51
+ */
52
+ export function OnMultiple(eventName, callback, maxCallbacks) {
53
+ let listeners = eventListeners.get(eventName) || [];
54
+ const thisListener = new Listener(eventName, callback, maxCallbacks);
55
+ listeners.push(thisListener);
56
+ eventListeners.set(eventName, listeners);
57
+ return () => listenerOff(thisListener);
58
+ }
59
+ /**
60
+ * Registers a callback function to be executed when the specified event occurs.
61
+ *
62
+ * @param eventName - The name of the event to register the callback for.
63
+ * @param callback - The callback function to be called when the event is triggered.
64
+ * @returns A function that, when called, will unregister the callback from the event.
65
+ */
66
+ export function On(eventName, callback) {
67
+ return OnMultiple(eventName, callback, -1);
68
+ }
69
+ /**
70
+ * Registers a callback function to be executed only once for the specified event.
71
+ *
72
+ * @param eventName - The name of the event to register the callback for.
73
+ * @param callback - The callback function to be called when the event is triggered.
74
+ * @returns A function that, when called, will unregister the callback from the event.
75
+ */
76
+ export function Once(eventName, callback) {
77
+ return OnMultiple(eventName, callback, 1);
78
+ }
79
+ /**
80
+ * Removes event listeners for the specified event names.
81
+ *
82
+ * @param eventNames - The name of the events to remove listeners for.
83
+ */
84
+ export function Off(...eventNames) {
85
+ eventNames.forEach(eventName => eventListeners.delete(eventName));
86
+ }
87
+ /**
88
+ * Removes all event listeners.
89
+ */
90
+ export function OffAll() {
91
+ eventListeners.clear();
92
+ }
93
+ /**
94
+ * Emits an event using the name and data.
95
+ *
96
+ * @returns A promise that will be fulfilled once the event has been emitted.
97
+ * @param name - the name of the event to emit.
98
+ * @param data - the data to be sent with the event.
99
+ */
100
+ export function Emit(name, data) {
101
+ let eventName;
102
+ let eventData;
103
+ if (typeof name === 'object' && name !== null && 'name' in name && 'data' in name) {
104
+ // If name is an object with a name property, use it directly
105
+ eventName = name['name'];
106
+ eventData = name['data'];
107
+ }
108
+ else {
109
+ // Otherwise use the standard parameters
110
+ eventName = name;
111
+ eventData = data;
112
+ }
113
+ return call(EmitMethod, { name: eventName, data: eventData });
114
+ }
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,38 @@
1
+ /*
2
+ _ __ _ __
3
+ | | / /___ _(_) /____
4
+ | | /| / / __ `/ / / ___/
5
+ | |/ |/ / /_/ / / (__ )
6
+ |__/|__/\__,_/_/_/____/
7
+ The electron alternative for Go
8
+ (c) Lea Anthony 2019-present
9
+ */
10
+ // Setup
11
+ window._wails = window._wails || {};
12
+ import "./contextmenu.js";
13
+ import "./drag.js";
14
+ // Re-export public API
15
+ import * as Application from "./application.js";
16
+ import * as Browser from "./browser.js";
17
+ import * as Call from "./calls.js";
18
+ import * as Clipboard from "./clipboard.js";
19
+ import * as Create from "./create.js";
20
+ import * as Dialogs from "./dialogs.js";
21
+ import * as Events from "./events.js";
22
+ import * as Flags from "./flags.js";
23
+ import * as Screens from "./screens.js";
24
+ import * as System from "./system.js";
25
+ import Window from "./window.js";
26
+ import * as WML from "./wml.js";
27
+ export { Application, Browser, Call, Clipboard, Dialogs, Events, Flags, Screens, System, Window, WML };
28
+ /**
29
+ * An internal utility consumed by the binding generator.
30
+ *
31
+ * @ignore
32
+ * @internal
33
+ */
34
+ export { Create };
35
+ export * from "./cancellable.js";
36
+ // Notify backend
37
+ window._wails.invoke = System.invoke;
38
+ System.invoke("wails:runtime:ready");
@@ -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
+ }
@@ -1,5 +1,4 @@
1
1
  // Source: https://github.com/ai/nanoid
2
-
3
2
  // The MIT License (MIT)
4
3
  //
5
4
  // Copyright 2017 Andrey Sitnik <andrey@sitnik.ru>
@@ -20,23 +19,20 @@
20
19
  // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
21
20
  // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22
21
  // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
-
24
22
  // This alphabet uses `A-Za-z0-9_-` symbols.
25
23
  // The order of characters is optimized for better gzip and brotli compression.
26
24
  // References to the same file (works both for gzip and brotli):
27
25
  // `'use`, `andom`, and `rict'`
28
26
  // References to the brotli default dictionary:
29
27
  // `-26T`, `1983`, `40px`, `75px`, `bush`, `jack`, `mind`, `very`, and `wolf`
30
- let urlAlphabet =
31
- 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict'
32
-
33
- export let nanoid = (size = 21) => {
34
- let id = ''
28
+ const urlAlphabet = 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict';
29
+ export function nanoid(size = 21) {
30
+ let id = '';
35
31
  // A compact alternative for `for (var i = 0; i < step; i++)`.
36
- let i = size | 0
32
+ let i = size | 0;
37
33
  while (i--) {
38
34
  // `| 0` is more compact and faster than `Math.floor()`.
39
- id += urlAlphabet[(Math.random() * 64) | 0]
35
+ id += urlAlphabet[(Math.random() * 64) | 0];
40
36
  }
41
- return id
42
- }
37
+ return id;
38
+ }
@@ -0,0 +1,63 @@
1
+ /*
2
+ _ __ _ __
3
+ | | / /___ _(_) /____
4
+ | | /| / / __ `/ / / ___/
5
+ | |/ |/ / /_/ / / (__ )
6
+ |__/|__/\__,_/_/_/____/
7
+ The electron alternative for Go
8
+ (c) Lea Anthony 2019-present
9
+ */
10
+ import { nanoid } from './nanoid.js';
11
+ const runtimeURL = window.location.origin + "/wails/runtime";
12
+ // Object Names
13
+ export const objectNames = Object.freeze({
14
+ Call: 0,
15
+ Clipboard: 1,
16
+ Application: 2,
17
+ Events: 3,
18
+ ContextMenu: 4,
19
+ Dialog: 5,
20
+ Window: 6,
21
+ Screens: 7,
22
+ System: 8,
23
+ Browser: 9,
24
+ CancelCall: 10,
25
+ });
26
+ export let clientId = nanoid();
27
+ /**
28
+ * Creates a new runtime caller with specified ID.
29
+ *
30
+ * @param object - The object to invoke the method on.
31
+ * @param windowName - The name of the window.
32
+ * @return The new runtime caller function.
33
+ */
34
+ export function newRuntimeCaller(object, windowName = '') {
35
+ return function (method, args = null) {
36
+ return runtimeCallWithID(object, method, windowName, args);
37
+ };
38
+ }
39
+ async function runtimeCallWithID(objectID, method, windowName, args) {
40
+ var _a, _b;
41
+ let url = new URL(runtimeURL);
42
+ url.searchParams.append("object", objectID.toString());
43
+ url.searchParams.append("method", method.toString());
44
+ if (args) {
45
+ url.searchParams.append("args", JSON.stringify(args));
46
+ }
47
+ let headers = {
48
+ ["x-wails-client-id"]: clientId
49
+ };
50
+ if (windowName) {
51
+ headers["x-wails-window-name"] = windowName;
52
+ }
53
+ let response = await fetch(url, { headers });
54
+ if (!response.ok) {
55
+ throw new Error(await response.text());
56
+ }
57
+ if (((_b = (_a = response.headers.get("Content-Type")) === null || _a === void 0 ? void 0 : _a.indexOf("application/json")) !== null && _b !== void 0 ? _b : -1) !== -1) {
58
+ return response.json();
59
+ }
60
+ else {
61
+ return response.text();
62
+ }
63
+ }
@@ -0,0 +1,38 @@
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.Screens);
12
+ const getAll = 0;
13
+ const getPrimary = 1;
14
+ const getCurrent = 2;
15
+ /**
16
+ * Gets all screens.
17
+ *
18
+ * @returns A promise that resolves to an array of Screen objects.
19
+ */
20
+ export function GetAll() {
21
+ return call(getAll);
22
+ }
23
+ /**
24
+ * Gets the primary screen.
25
+ *
26
+ * @returns A promise that resolves to the primary screen.
27
+ */
28
+ export function GetPrimary() {
29
+ return call(getPrimary);
30
+ }
31
+ /**
32
+ * Gets the current active screen.
33
+ *
34
+ * @returns A promise that resolves with the current active screen.
35
+ */
36
+ export function GetCurrent() {
37
+ return call(getCurrent);
38
+ }