@wailsio/runtime 3.0.0-alpha.65 → 3.0.0-alpha.66
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.
- package/{src → dist}/application.js +2 -16
- package/dist/browser.js +20 -0
- package/dist/callable.js +144 -0
- package/dist/calls.js +194 -0
- package/dist/cancellable.js +792 -0
- package/dist/clipboard.js +30 -0
- package/dist/contextmenu.js +80 -0
- package/{src → dist}/create.js +2 -33
- package/dist/dialogs.js +134 -0
- package/dist/drag.js +222 -0
- package/dist/event_types.js +229 -0
- package/dist/events.js +101 -0
- package/dist/flags.js +23 -0
- package/dist/index.js +38 -0
- package/dist/listener.js +44 -0
- package/{src → dist}/nanoid.js +7 -11
- package/dist/runtime.js +63 -0
- package/dist/screens.js +38 -0
- package/dist/system.js +116 -0
- package/{src → dist}/utils.js +29 -20
- package/dist/window.js +438 -0
- package/{src → dist}/wml.js +51 -122
- package/package.json +43 -19
- package/types/application.d.ts +3 -10
- package/types/browser.d.ts +4 -4
- package/types/callable.d.ts +3 -0
- package/types/calls.d.ts +43 -49
- package/types/cancellable.d.ts +434 -0
- package/types/clipboard.d.ts +6 -5
- package/types/contextmenu.d.ts +1 -0
- package/types/create.d.ts +6 -27
- package/types/dialogs.d.ts +99 -143
- package/types/drag.d.ts +1 -0
- package/types/event_types.d.ts +218 -219
- package/types/events.d.ts +45 -250
- package/types/flags.d.ts +3 -3
- package/types/index.d.ts +16 -14
- package/types/listener.d.ts +9 -0
- package/types/nanoid.d.ts +1 -1
- package/types/runtime.d.ts +18 -26
- package/types/screens.d.ts +42 -76
- package/types/system.d.ts +50 -79
- package/types/utils.d.ts +15 -8
- package/types/window.d.ts +110 -225
- package/types/wml.d.ts +2 -6
- package/docs/.nojekyll +0 -1
- package/docs/assets/highlight.css +0 -22
- package/docs/assets/icons.js +0 -15
- package/docs/assets/icons.svg +0 -1
- package/docs/assets/main.js +0 -59
- package/docs/assets/navigation.js +0 -1
- package/docs/assets/search.js +0 -1
- package/docs/assets/style.css +0 -1415
- package/docs/classes/Call.RuntimeError.html +0 -11
- package/docs/classes/Events.WailsEvent.html +0 -4
- package/docs/functions/Application.Hide.html +0 -2
- package/docs/functions/Application.Quit.html +0 -2
- package/docs/functions/Application.Show.html +0 -2
- package/docs/functions/Browser.OpenURL.html +0 -3
- package/docs/functions/Call.ByID.html +0 -8
- package/docs/functions/Call.ByName.html +0 -6
- package/docs/functions/Call.Call.html +0 -11
- package/docs/functions/Clipboard.SetText.html +0 -6
- package/docs/functions/Clipboard.Text.html +0 -3
- package/docs/functions/Create.Any.html +0 -2
- package/docs/functions/Create.Array.html +0 -4
- package/docs/functions/Create.ByteSlice.html +0 -3
- package/docs/functions/Create.Map.html +0 -4
- package/docs/functions/Create.Nullable.html +0 -3
- package/docs/functions/Create.Struct.html +0 -3
- package/docs/functions/Dialogs.Error.html +0 -5
- package/docs/functions/Dialogs.Info.html +0 -5
- package/docs/functions/Dialogs.OpenFile.html +0 -3
- package/docs/functions/Dialogs.Question.html +0 -5
- package/docs/functions/Dialogs.SaveFile.html +0 -3
- package/docs/functions/Dialogs.Warning.html +0 -5
- package/docs/functions/Events.Emit.html +0 -6
- package/docs/functions/Events.Off.html +0 -4
- package/docs/functions/Events.OffAll.html +0 -3
- package/docs/functions/Events.On.html +0 -7
- package/docs/functions/Events.OnMultiple.html +0 -8
- package/docs/functions/Events.Once.html +0 -7
- package/docs/functions/Events.setup.html +0 -1
- package/docs/functions/Flags.GetFlag.html +0 -6
- package/docs/functions/Screens.GetAll.html +0 -3
- package/docs/functions/Screens.GetCurrent.html +0 -3
- package/docs/functions/Screens.GetPrimary.html +0 -3
- package/docs/functions/System.Capabilities.html +0 -4
- package/docs/functions/System.Environment.html +0 -5
- package/docs/functions/System.IsAMD64.html +0 -3
- package/docs/functions/System.IsARM.html +0 -3
- package/docs/functions/System.IsARM64.html +0 -5
- package/docs/functions/System.IsDarkMode.html +0 -5
- package/docs/functions/System.IsDebug.html +0 -1
- package/docs/functions/System.IsLinux.html +0 -3
- package/docs/functions/System.IsMac.html +0 -3
- package/docs/functions/System.IsWindows.html +0 -3
- package/docs/functions/System.invoke.html +0 -1
- package/docs/functions/WML.Enable.html +0 -2
- package/docs/functions/WML.Reload.html +0 -2
- package/docs/functions/init.html +0 -1
- package/docs/index.html +0 -5
- package/docs/interfaces/Call.CallOptions.html +0 -7
- package/docs/interfaces/Dialogs.Button.html +0 -7
- package/docs/interfaces/Dialogs.FileFilter.html +0 -5
- package/docs/interfaces/Dialogs.MessageDialogOptions.html +0 -9
- package/docs/interfaces/Dialogs.OpenFileDialogOptions.html +0 -33
- package/docs/interfaces/Dialogs.SaveFileDialogOptions.html +0 -35
- package/docs/interfaces/Screens.Rect.html +0 -9
- package/docs/interfaces/Screens.Screen.html +0 -25
- package/docs/interfaces/Screens.Size.html +0 -5
- package/docs/interfaces/System.EnvironmentInfo.html +0 -11
- package/docs/interfaces/System.OSInfo.html +0 -9
- package/docs/modules/Application.html +0 -4
- package/docs/modules/Browser.html +0 -2
- package/docs/modules/Call.html +0 -6
- package/docs/modules/Clipboard.html +0 -3
- package/docs/modules/Create.html +0 -7
- package/docs/modules/Dialogs.html +0 -12
- package/docs/modules/Events.html +0 -10
- package/docs/modules/Flags.html +0 -2
- package/docs/modules/Screens.html +0 -7
- package/docs/modules/System.html +0 -14
- package/docs/modules/WML.html +0 -3
- package/docs/modules.html +0 -14
- package/docs/variables/Events.Types.html +0 -1
- package/docs/variables/Window.html +0 -2
- package/src/browser.js +0 -24
- package/src/calls.js +0 -221
- package/src/clipboard.js +0 -35
- package/src/contextmenu.js +0 -97
- package/src/dialogs.js +0 -200
- package/src/drag.js +0 -119
- package/src/event_types.js +0 -219
- package/src/events.js +0 -140
- package/src/flags.js +0 -25
- package/src/index.js +0 -60
- package/src/runtime.js +0 -92
- package/src/screens.js +0 -71
- package/src/system.js +0 -143
- package/src/window.js +0 -638
- package/tsconfig.json +0 -20
|
@@ -0,0 +1,229 @@
|
|
|
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
|
+
ThemeChanged: "common:ThemeChanged",
|
|
207
|
+
WindowClosing: "common:WindowClosing",
|
|
208
|
+
WindowDidMove: "common:WindowDidMove",
|
|
209
|
+
WindowDidResize: "common:WindowDidResize",
|
|
210
|
+
WindowDPIChanged: "common:WindowDPIChanged",
|
|
211
|
+
WindowFilesDropped: "common:WindowFilesDropped",
|
|
212
|
+
WindowFocus: "common:WindowFocus",
|
|
213
|
+
WindowFullscreen: "common:WindowFullscreen",
|
|
214
|
+
WindowHide: "common:WindowHide",
|
|
215
|
+
WindowLostFocus: "common:WindowLostFocus",
|
|
216
|
+
WindowMaximise: "common:WindowMaximise",
|
|
217
|
+
WindowMinimise: "common:WindowMinimise",
|
|
218
|
+
WindowRestore: "common:WindowRestore",
|
|
219
|
+
WindowRuntimeReady: "common:WindowRuntimeReady",
|
|
220
|
+
WindowShow: "common:WindowShow",
|
|
221
|
+
WindowUnFullscreen: "common:WindowUnFullscreen",
|
|
222
|
+
WindowUnMaximise: "common:WindowUnMaximise",
|
|
223
|
+
WindowUnMinimise: "common:WindowUnMinimise",
|
|
224
|
+
WindowZoom: "common:WindowZoom",
|
|
225
|
+
WindowZoomIn: "common:WindowZoomIn",
|
|
226
|
+
WindowZoomOut: "common:WindowZoomOut",
|
|
227
|
+
WindowZoomReset: "common:WindowZoomReset",
|
|
228
|
+
}),
|
|
229
|
+
});
|
package/dist/events.js
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
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 the given event.
|
|
95
|
+
*
|
|
96
|
+
* @param event - The name of the event to emit.
|
|
97
|
+
* @returns A promise that will be fulfilled once the event has been emitted.
|
|
98
|
+
*/
|
|
99
|
+
export function Emit(event) {
|
|
100
|
+
return call(EmitMethod, event);
|
|
101
|
+
}
|
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");
|
package/dist/listener.js
ADDED
|
@@ -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/{src → dist}/nanoid.js
RENAMED
|
@@ -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
|
-
|
|
31
|
-
|
|
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
|
+
}
|
package/dist/runtime.js
ADDED
|
@@ -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
|
+
}
|
package/dist/screens.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
|
+
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
|
+
}
|