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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/dist/android.js +39 -0
  2. package/{src → dist}/application.js +32 -46
  3. package/dist/browser.js +20 -0
  4. package/dist/callable.js +144 -0
  5. package/dist/calls.js +114 -0
  6. package/dist/cancellable.js +792 -0
  7. package/dist/clipboard.js +30 -0
  8. package/dist/contextmenu.js +83 -0
  9. package/dist/create.js +99 -0
  10. package/dist/dialogs.js +69 -0
  11. package/dist/drag.js +268 -0
  12. package/dist/environment.js +17 -0
  13. package/dist/event_types.js +292 -0
  14. package/dist/events.js +119 -0
  15. package/dist/flags.js +23 -0
  16. package/dist/index.js +88 -0
  17. package/dist/ios.js +28 -0
  18. package/dist/listener.js +44 -0
  19. package/dist/nanoid.js +38 -0
  20. package/dist/plugins/vite.js +64 -0
  21. package/dist/runtime.js +198 -0
  22. package/dist/screens.js +58 -0
  23. package/dist/system.js +158 -0
  24. package/dist/updater.js +74 -0
  25. package/dist/utils.js +98 -0
  26. package/dist/window.js +734 -0
  27. package/dist/wml.js +179 -0
  28. package/package.json +71 -26
  29. package/types/android.d.ts +21 -0
  30. package/types/application.d.ts +3 -10
  31. package/types/browser.d.ts +4 -4
  32. package/types/callable.d.ts +3 -0
  33. package/types/calls.d.ts +52 -24
  34. package/types/cancellable.d.ts +433 -0
  35. package/types/clipboard.d.ts +6 -5
  36. package/types/contextmenu.d.ts +1 -1
  37. package/types/create.d.ts +36 -0
  38. package/types/dialogs.d.ts +132 -20
  39. package/types/drag.d.ts +1 -4
  40. package/types/environment.d.ts +8 -0
  41. package/types/event_types.d.ts +281 -0
  42. package/types/events.d.ts +70 -33
  43. package/types/flags.d.ts +3 -3
  44. package/types/index.d.ts +32 -48
  45. package/types/ios.d.ts +13 -0
  46. package/types/listener.d.ts +9 -0
  47. package/types/nanoid.d.ts +1 -0
  48. package/types/plugins/vite.d.ts +10 -0
  49. package/types/runtime.d.ts +61 -22
  50. package/types/screens.d.ts +64 -7
  51. package/types/system.d.ts +74 -39
  52. package/types/updater.d.ts +65 -0
  53. package/types/utils.d.ts +21 -0
  54. package/types/window.d.ts +327 -13
  55. package/types/wml.d.ts +5 -3
  56. package/src/browser.js +0 -24
  57. package/src/calls.js +0 -123
  58. package/src/clipboard.js +0 -35
  59. package/src/contextmenu.js +0 -98
  60. package/src/dialogs.js +0 -138
  61. package/src/drag.js +0 -125
  62. package/src/events.js +0 -134
  63. package/src/flags.js +0 -63
  64. package/src/index.d.ts +0 -136
  65. package/src/index.js +0 -58
  66. package/src/runtime.js +0 -122
  67. package/src/screens.js +0 -45
  68. package/src/system.js +0 -122
  69. package/src/window.js +0 -122
  70. package/src/wml.js +0 -151
  71. package/tsconfig.json +0 -20
@@ -0,0 +1,281 @@
1
+ export declare const Types: Readonly<{
2
+ Windows: Readonly<{
3
+ APMPowerSettingChange: "windows:APMPowerSettingChange";
4
+ APMPowerStatusChange: "windows:APMPowerStatusChange";
5
+ APMResumeAutomatic: "windows:APMResumeAutomatic";
6
+ APMResumeSuspend: "windows:APMResumeSuspend";
7
+ APMSuspend: "windows:APMSuspend";
8
+ ApplicationStarted: "windows:ApplicationStarted";
9
+ SystemThemeChanged: "windows:SystemThemeChanged";
10
+ WebViewNavigationCompleted: "windows:WebViewNavigationCompleted";
11
+ WindowActive: "windows:WindowActive";
12
+ WindowBackgroundErase: "windows:WindowBackgroundErase";
13
+ WindowClickActive: "windows:WindowClickActive";
14
+ WindowClosing: "windows:WindowClosing";
15
+ WindowDidMove: "windows:WindowDidMove";
16
+ WindowDidResize: "windows:WindowDidResize";
17
+ WindowDPIChanged: "windows:WindowDPIChanged";
18
+ WindowDragDrop: "windows:WindowDragDrop";
19
+ WindowDragEnter: "windows:WindowDragEnter";
20
+ WindowDragLeave: "windows:WindowDragLeave";
21
+ WindowDragOver: "windows:WindowDragOver";
22
+ WindowEndMove: "windows:WindowEndMove";
23
+ WindowEndResize: "windows:WindowEndResize";
24
+ WindowFullscreen: "windows:WindowFullscreen";
25
+ WindowHide: "windows:WindowHide";
26
+ WindowInactive: "windows:WindowInactive";
27
+ WindowKeyDown: "windows:WindowKeyDown";
28
+ WindowKeyUp: "windows:WindowKeyUp";
29
+ WindowKillFocus: "windows:WindowKillFocus";
30
+ WindowNonClientHit: "windows:WindowNonClientHit";
31
+ WindowNonClientMouseDown: "windows:WindowNonClientMouseDown";
32
+ WindowNonClientMouseLeave: "windows:WindowNonClientMouseLeave";
33
+ WindowNonClientMouseMove: "windows:WindowNonClientMouseMove";
34
+ WindowNonClientMouseUp: "windows:WindowNonClientMouseUp";
35
+ WindowPaint: "windows:WindowPaint";
36
+ WindowRestore: "windows:WindowRestore";
37
+ WindowSetFocus: "windows:WindowSetFocus";
38
+ WindowShow: "windows:WindowShow";
39
+ WindowStartMove: "windows:WindowStartMove";
40
+ WindowStartResize: "windows:WindowStartResize";
41
+ WindowUnFullscreen: "windows:WindowUnFullscreen";
42
+ WindowZOrderChanged: "windows:WindowZOrderChanged";
43
+ WindowMinimise: "windows:WindowMinimise";
44
+ WindowUnMinimise: "windows:WindowUnMinimise";
45
+ WindowMaximise: "windows:WindowMaximise";
46
+ WindowUnMaximise: "windows:WindowUnMaximise";
47
+ }>;
48
+ Mac: Readonly<{
49
+ ApplicationDidBecomeActive: "mac:ApplicationDidBecomeActive";
50
+ ApplicationDidChangeBackingProperties: "mac:ApplicationDidChangeBackingProperties";
51
+ ApplicationDidChangeEffectiveAppearance: "mac:ApplicationDidChangeEffectiveAppearance";
52
+ ApplicationDidChangeIcon: "mac:ApplicationDidChangeIcon";
53
+ ApplicationDidChangeOcclusionState: "mac:ApplicationDidChangeOcclusionState";
54
+ ApplicationDidChangeScreenParameters: "mac:ApplicationDidChangeScreenParameters";
55
+ ApplicationDidChangeStatusBarFrame: "mac:ApplicationDidChangeStatusBarFrame";
56
+ ApplicationDidChangeStatusBarOrientation: "mac:ApplicationDidChangeStatusBarOrientation";
57
+ ApplicationDidChangeTheme: "mac:ApplicationDidChangeTheme";
58
+ ApplicationDidFinishLaunching: "mac:ApplicationDidFinishLaunching";
59
+ ApplicationDidHide: "mac:ApplicationDidHide";
60
+ ApplicationDidResignActive: "mac:ApplicationDidResignActive";
61
+ ApplicationDidUnhide: "mac:ApplicationDidUnhide";
62
+ ApplicationDidUpdate: "mac:ApplicationDidUpdate";
63
+ ApplicationDidWake: "mac:ApplicationDidWake";
64
+ ApplicationScreensDidSleep: "mac:ApplicationScreensDidSleep";
65
+ ApplicationScreensDidWake: "mac:ApplicationScreensDidWake";
66
+ ApplicationShouldHandleReopen: "mac:ApplicationShouldHandleReopen";
67
+ ApplicationWillBecomeActive: "mac:ApplicationWillBecomeActive";
68
+ ApplicationWillFinishLaunching: "mac:ApplicationWillFinishLaunching";
69
+ ApplicationWillHide: "mac:ApplicationWillHide";
70
+ ApplicationWillResignActive: "mac:ApplicationWillResignActive";
71
+ ApplicationWillSleep: "mac:ApplicationWillSleep";
72
+ ApplicationWillTerminate: "mac:ApplicationWillTerminate";
73
+ ApplicationWillUnhide: "mac:ApplicationWillUnhide";
74
+ ApplicationWillUpdate: "mac:ApplicationWillUpdate";
75
+ MenuDidAddItem: "mac:MenuDidAddItem";
76
+ MenuDidBeginTracking: "mac:MenuDidBeginTracking";
77
+ MenuDidClose: "mac:MenuDidClose";
78
+ MenuDidDisplayItem: "mac:MenuDidDisplayItem";
79
+ MenuDidEndTracking: "mac:MenuDidEndTracking";
80
+ MenuDidHighlightItem: "mac:MenuDidHighlightItem";
81
+ MenuDidOpen: "mac:MenuDidOpen";
82
+ MenuDidPopUp: "mac:MenuDidPopUp";
83
+ MenuDidRemoveItem: "mac:MenuDidRemoveItem";
84
+ MenuDidSendAction: "mac:MenuDidSendAction";
85
+ MenuDidSendActionToItem: "mac:MenuDidSendActionToItem";
86
+ MenuDidUpdate: "mac:MenuDidUpdate";
87
+ MenuWillAddItem: "mac:MenuWillAddItem";
88
+ MenuWillBeginTracking: "mac:MenuWillBeginTracking";
89
+ MenuWillDisplayItem: "mac:MenuWillDisplayItem";
90
+ MenuWillEndTracking: "mac:MenuWillEndTracking";
91
+ MenuWillHighlightItem: "mac:MenuWillHighlightItem";
92
+ MenuWillOpen: "mac:MenuWillOpen";
93
+ MenuWillPopUp: "mac:MenuWillPopUp";
94
+ MenuWillRemoveItem: "mac:MenuWillRemoveItem";
95
+ MenuWillSendAction: "mac:MenuWillSendAction";
96
+ MenuWillSendActionToItem: "mac:MenuWillSendActionToItem";
97
+ MenuWillUpdate: "mac:MenuWillUpdate";
98
+ WebViewDidCommitNavigation: "mac:WebViewDidCommitNavigation";
99
+ WebViewDidFinishNavigation: "mac:WebViewDidFinishNavigation";
100
+ WebViewDidReceiveServerRedirectForProvisionalNavigation: "mac:WebViewDidReceiveServerRedirectForProvisionalNavigation";
101
+ WebViewDidStartProvisionalNavigation: "mac:WebViewDidStartProvisionalNavigation";
102
+ WindowDidBecomeKey: "mac:WindowDidBecomeKey";
103
+ WindowDidBecomeMain: "mac:WindowDidBecomeMain";
104
+ WindowDidBeginSheet: "mac:WindowDidBeginSheet";
105
+ WindowDidChangeAlpha: "mac:WindowDidChangeAlpha";
106
+ WindowDidChangeBackingLocation: "mac:WindowDidChangeBackingLocation";
107
+ WindowDidChangeBackingProperties: "mac:WindowDidChangeBackingProperties";
108
+ WindowDidChangeCollectionBehavior: "mac:WindowDidChangeCollectionBehavior";
109
+ WindowDidChangeEffectiveAppearance: "mac:WindowDidChangeEffectiveAppearance";
110
+ WindowDidChangeOcclusionState: "mac:WindowDidChangeOcclusionState";
111
+ WindowDidChangeOrderingMode: "mac:WindowDidChangeOrderingMode";
112
+ WindowDidChangeScreen: "mac:WindowDidChangeScreen";
113
+ WindowDidChangeScreenParameters: "mac:WindowDidChangeScreenParameters";
114
+ WindowDidChangeScreenProfile: "mac:WindowDidChangeScreenProfile";
115
+ WindowDidChangeScreenSpace: "mac:WindowDidChangeScreenSpace";
116
+ WindowDidChangeScreenSpaceProperties: "mac:WindowDidChangeScreenSpaceProperties";
117
+ WindowDidChangeSharingType: "mac:WindowDidChangeSharingType";
118
+ WindowDidChangeSpace: "mac:WindowDidChangeSpace";
119
+ WindowDidChangeSpaceOrderingMode: "mac:WindowDidChangeSpaceOrderingMode";
120
+ WindowDidChangeTitle: "mac:WindowDidChangeTitle";
121
+ WindowDidChangeToolbar: "mac:WindowDidChangeToolbar";
122
+ WindowDidDeminiaturize: "mac:WindowDidDeminiaturize";
123
+ WindowDidEndSheet: "mac:WindowDidEndSheet";
124
+ WindowDidEnterFullScreen: "mac:WindowDidEnterFullScreen";
125
+ WindowDidEnterVersionBrowser: "mac:WindowDidEnterVersionBrowser";
126
+ WindowDidExitFullScreen: "mac:WindowDidExitFullScreen";
127
+ WindowDidExitVersionBrowser: "mac:WindowDidExitVersionBrowser";
128
+ WindowDidExpose: "mac:WindowDidExpose";
129
+ WindowDidFocus: "mac:WindowDidFocus";
130
+ WindowDidMiniaturize: "mac:WindowDidMiniaturize";
131
+ WindowDidMove: "mac:WindowDidMove";
132
+ WindowDidOrderOffScreen: "mac:WindowDidOrderOffScreen";
133
+ WindowDidOrderOnScreen: "mac:WindowDidOrderOnScreen";
134
+ WindowDidResignKey: "mac:WindowDidResignKey";
135
+ WindowDidResignMain: "mac:WindowDidResignMain";
136
+ WindowDidResize: "mac:WindowDidResize";
137
+ WindowDidUpdate: "mac:WindowDidUpdate";
138
+ WindowDidUpdateAlpha: "mac:WindowDidUpdateAlpha";
139
+ WindowDidUpdateCollectionBehavior: "mac:WindowDidUpdateCollectionBehavior";
140
+ WindowDidUpdateCollectionProperties: "mac:WindowDidUpdateCollectionProperties";
141
+ WindowDidUpdateShadow: "mac:WindowDidUpdateShadow";
142
+ WindowDidUpdateTitle: "mac:WindowDidUpdateTitle";
143
+ WindowDidUpdateToolbar: "mac:WindowDidUpdateToolbar";
144
+ WindowDidZoom: "mac:WindowDidZoom";
145
+ WindowFileDraggingEntered: "mac:WindowFileDraggingEntered";
146
+ WindowFileDraggingExited: "mac:WindowFileDraggingExited";
147
+ WindowFileDraggingPerformed: "mac:WindowFileDraggingPerformed";
148
+ WindowHide: "mac:WindowHide";
149
+ WindowMaximise: "mac:WindowMaximise";
150
+ WindowUnMaximise: "mac:WindowUnMaximise";
151
+ WindowMinimise: "mac:WindowMinimise";
152
+ WindowUnMinimise: "mac:WindowUnMinimise";
153
+ WindowShouldClose: "mac:WindowShouldClose";
154
+ WindowShow: "mac:WindowShow";
155
+ WindowWillBecomeKey: "mac:WindowWillBecomeKey";
156
+ WindowWillBecomeMain: "mac:WindowWillBecomeMain";
157
+ WindowWillBeginSheet: "mac:WindowWillBeginSheet";
158
+ WindowWillChangeOrderingMode: "mac:WindowWillChangeOrderingMode";
159
+ WindowWillClose: "mac:WindowWillClose";
160
+ WindowWillDeminiaturize: "mac:WindowWillDeminiaturize";
161
+ WindowWillEnterFullScreen: "mac:WindowWillEnterFullScreen";
162
+ WindowWillEnterVersionBrowser: "mac:WindowWillEnterVersionBrowser";
163
+ WindowWillExitFullScreen: "mac:WindowWillExitFullScreen";
164
+ WindowWillExitVersionBrowser: "mac:WindowWillExitVersionBrowser";
165
+ WindowWillFocus: "mac:WindowWillFocus";
166
+ WindowWillMiniaturize: "mac:WindowWillMiniaturize";
167
+ WindowWillMove: "mac:WindowWillMove";
168
+ WindowWillOrderOffScreen: "mac:WindowWillOrderOffScreen";
169
+ WindowWillOrderOnScreen: "mac:WindowWillOrderOnScreen";
170
+ WindowWillResignMain: "mac:WindowWillResignMain";
171
+ WindowWillResize: "mac:WindowWillResize";
172
+ WindowWillUnfocus: "mac:WindowWillUnfocus";
173
+ WindowWillUpdate: "mac:WindowWillUpdate";
174
+ WindowWillUpdateAlpha: "mac:WindowWillUpdateAlpha";
175
+ WindowWillUpdateCollectionBehavior: "mac:WindowWillUpdateCollectionBehavior";
176
+ WindowWillUpdateCollectionProperties: "mac:WindowWillUpdateCollectionProperties";
177
+ WindowWillUpdateShadow: "mac:WindowWillUpdateShadow";
178
+ WindowWillUpdateTitle: "mac:WindowWillUpdateTitle";
179
+ WindowWillUpdateToolbar: "mac:WindowWillUpdateToolbar";
180
+ WindowWillUpdateVisibility: "mac:WindowWillUpdateVisibility";
181
+ WindowWillUseStandardFrame: "mac:WindowWillUseStandardFrame";
182
+ WindowZoomIn: "mac:WindowZoomIn";
183
+ WindowZoomOut: "mac:WindowZoomOut";
184
+ WindowZoomReset: "mac:WindowZoomReset";
185
+ }>;
186
+ Linux: Readonly<{
187
+ ApplicationStartup: "linux:ApplicationStartup";
188
+ SystemDidWake: "linux:SystemDidWake";
189
+ SystemThemeChanged: "linux:SystemThemeChanged";
190
+ SystemWillSleep: "linux:SystemWillSleep";
191
+ WindowDeleteEvent: "linux:WindowDeleteEvent";
192
+ WindowDidMove: "linux:WindowDidMove";
193
+ WindowDidResize: "linux:WindowDidResize";
194
+ WindowFocusIn: "linux:WindowFocusIn";
195
+ WindowFocusOut: "linux:WindowFocusOut";
196
+ WindowLoadStarted: "linux:WindowLoadStarted";
197
+ WindowLoadRedirected: "linux:WindowLoadRedirected";
198
+ WindowLoadCommitted: "linux:WindowLoadCommitted";
199
+ WindowLoadFinished: "linux:WindowLoadFinished";
200
+ }>;
201
+ iOS: Readonly<{
202
+ ApplicationDidBecomeActive: "ios:ApplicationDidBecomeActive";
203
+ ApplicationDidEnterBackground: "ios:ApplicationDidEnterBackground";
204
+ ApplicationDidFinishLaunching: "ios:ApplicationDidFinishLaunching";
205
+ ApplicationDidReceiveMemoryWarning: "ios:ApplicationDidReceiveMemoryWarning";
206
+ ApplicationWillEnterForeground: "ios:ApplicationWillEnterForeground";
207
+ ApplicationWillResignActive: "ios:ApplicationWillResignActive";
208
+ ApplicationWillTerminate: "ios:ApplicationWillTerminate";
209
+ WindowDidLoad: "ios:WindowDidLoad";
210
+ WindowWillAppear: "ios:WindowWillAppear";
211
+ WindowDidAppear: "ios:WindowDidAppear";
212
+ WindowWillDisappear: "ios:WindowWillDisappear";
213
+ WindowDidDisappear: "ios:WindowDidDisappear";
214
+ WindowSafeAreaInsetsChanged: "ios:WindowSafeAreaInsetsChanged";
215
+ WindowOrientationChanged: "ios:WindowOrientationChanged";
216
+ WindowTouchBegan: "ios:WindowTouchBegan";
217
+ WindowTouchMoved: "ios:WindowTouchMoved";
218
+ WindowTouchEnded: "ios:WindowTouchEnded";
219
+ WindowTouchCancelled: "ios:WindowTouchCancelled";
220
+ WebViewDidStartNavigation: "ios:WebViewDidStartNavigation";
221
+ WebViewDidFinishNavigation: "ios:WebViewDidFinishNavigation";
222
+ WebViewDidFailNavigation: "ios:WebViewDidFailNavigation";
223
+ WebViewDecidePolicyForNavigationAction: "ios:WebViewDecidePolicyForNavigationAction";
224
+ BatteryChanged: "ios:BatteryChanged";
225
+ NetworkChanged: "ios:NetworkChanged";
226
+ ThemeChanged: "ios:ThemeChanged";
227
+ ScreenLocked: "ios:ScreenLocked";
228
+ ScreenUnlocked: "ios:ScreenUnlocked";
229
+ }>;
230
+ Android: Readonly<{
231
+ ActivityCreated: "android:ActivityCreated";
232
+ ActivityStarted: "android:ActivityStarted";
233
+ ActivityResumed: "android:ActivityResumed";
234
+ ActivityPaused: "android:ActivityPaused";
235
+ ActivityStopped: "android:ActivityStopped";
236
+ ActivityDestroyed: "android:ActivityDestroyed";
237
+ ApplicationLowMemory: "android:ApplicationLowMemory";
238
+ WebViewPageStarted: "android:WebViewPageStarted";
239
+ WebViewPageFinished: "android:WebViewPageFinished";
240
+ BatteryChanged: "android:BatteryChanged";
241
+ NetworkChanged: "android:NetworkChanged";
242
+ ThemeChanged: "android:ThemeChanged";
243
+ ScreenLocked: "android:ScreenLocked";
244
+ ScreenUnlocked: "android:ScreenUnlocked";
245
+ }>;
246
+ Common: Readonly<{
247
+ ApplicationOpenedWithFile: "common:ApplicationOpenedWithFile";
248
+ ApplicationStarted: "common:ApplicationStarted";
249
+ ApplicationLaunchedWithUrl: "common:ApplicationLaunchedWithUrl";
250
+ ThemeChanged: "common:ThemeChanged";
251
+ SystemDidWake: "common:SystemDidWake";
252
+ SystemWillSleep: "common:SystemWillSleep";
253
+ WindowClosing: "common:WindowClosing";
254
+ WindowDidMove: "common:WindowDidMove";
255
+ WindowDidResize: "common:WindowDidResize";
256
+ WindowDPIChanged: "common:WindowDPIChanged";
257
+ WindowFilesDropped: "common:WindowFilesDropped";
258
+ WindowFocus: "common:WindowFocus";
259
+ WindowFullscreen: "common:WindowFullscreen";
260
+ WindowHide: "common:WindowHide";
261
+ WindowLostFocus: "common:WindowLostFocus";
262
+ WindowMaximise: "common:WindowMaximise";
263
+ WindowMinimise: "common:WindowMinimise";
264
+ WindowToggleFrameless: "common:WindowToggleFrameless";
265
+ WindowRestore: "common:WindowRestore";
266
+ WindowRuntimeReady: "common:WindowRuntimeReady";
267
+ WindowShow: "common:WindowShow";
268
+ WindowUnFullscreen: "common:WindowUnFullscreen";
269
+ WindowUnMaximise: "common:WindowUnMaximise";
270
+ WindowUnMinimise: "common:WindowUnMinimise";
271
+ WindowZoom: "common:WindowZoom";
272
+ WindowZoomIn: "common:WindowZoomIn";
273
+ WindowZoomOut: "common:WindowZoomOut";
274
+ WindowZoomReset: "common:WindowZoomReset";
275
+ BatteryChanged: "common:BatteryChanged";
276
+ NetworkChanged: "common:NetworkChanged";
277
+ ScreenLocked: "common:ScreenLocked";
278
+ ScreenUnlocked: "common:ScreenUnlocked";
279
+ LowMemory: "common:LowMemory";
280
+ }>;
281
+ }>;
package/types/events.d.ts CHANGED
@@ -1,53 +1,90 @@
1
- export function dispatchWailsEvent(event: any): void;
1
+ import { Types } from "./event_types.js";
2
+ export * from "./event_types.js";
3
+ /**
4
+ * A table of data types for all known events.
5
+ * Will be monkey-patched by the binding generator.
6
+ */
7
+ export interface CustomEvents {
8
+ }
9
+ /**
10
+ * Either a known event name or an arbitrary string.
11
+ */
12
+ export type WailsEventName<E extends keyof CustomEvents = keyof CustomEvents> = E | (string & {});
13
+ /**
14
+ * Union of all known system event names.
15
+ */
16
+ type SystemEventName = {
17
+ [K in keyof (typeof Types)]: (typeof Types)[K][keyof ((typeof Types)[K])];
18
+ } extends (infer M) ? M[keyof M] : never;
19
+ /**
20
+ * The data type associated to a given event.
21
+ */
22
+ export type WailsEventData<E extends WailsEventName = WailsEventName> = E extends keyof CustomEvents ? CustomEvents[E] : (E extends SystemEventName ? void : any);
23
+ /**
24
+ * The type of handlers for a given event.
25
+ */
26
+ export type WailsEventCallback<E extends WailsEventName = WailsEventName> = (ev: WailsEvent<E>) => void;
27
+ /**
28
+ * Represents a system event or a custom event emitted through wails-provided facilities.
29
+ */
30
+ export declare class WailsEvent<E extends WailsEventName = WailsEventName> {
31
+ /**
32
+ * The name of the event.
33
+ */
34
+ name: E;
35
+ /**
36
+ * Optional data associated with the emitted event.
37
+ */
38
+ data: WailsEventData<E>;
39
+ /**
40
+ * Name of the originating window. Omitted for application events.
41
+ * Will be overridden if set manually.
42
+ */
43
+ sender?: string;
44
+ constructor(name: E, data: WailsEventData<E>);
45
+ constructor(name: WailsEventData<E> extends null | void ? E : never);
46
+ }
2
47
  /**
3
48
  * Register a callback function to be called multiple times for a specific event.
4
49
  *
5
- * @param {string} eventName - The name of the event to register the callback for.
6
- * @param {function} callback - The callback function to be called when the event is triggered.
7
- * @param {number} 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.
8
- *
9
- @return {function} - A function that, when called, will unregister the callback from the event.
50
+ * @param eventName - The name of the event to register the callback for.
51
+ * @param callback - The callback function to be called when the event is triggered.
52
+ * @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.
53
+ * @returns A function that, when called, will unregister the callback from the event.
10
54
  */
11
- export function OnMultiple(eventName: string, callback: Function, maxCallbacks: number): Function;
55
+ export declare function OnMultiple<E extends WailsEventName = WailsEventName>(eventName: E, callback: WailsEventCallback<E>, maxCallbacks: number): () => void;
12
56
  /**
13
57
  * Registers a callback function to be executed when the specified event occurs.
14
58
  *
15
- * @param {string} eventName - The name of the event.
16
- * @param {function} callback - The callback function to be executed. It takes no parameters.
17
- * @return {function} - A function that, when called, will unregister the callback from the event. */
18
- export function On(eventName: string, callback: Function): Function;
59
+ * @param eventName - The name of the event to register the callback for.
60
+ * @param callback - The callback function to be called when the event is triggered.
61
+ * @returns A function that, when called, will unregister the callback from the event.
62
+ */
63
+ export declare function On<E extends WailsEventName = WailsEventName>(eventName: E, callback: WailsEventCallback<E>): () => void;
19
64
  /**
20
65
  * Registers a callback function to be executed only once for the specified event.
21
66
  *
22
- * @param {string} eventName - The name of the event.
23
- * @param {function} callback - The function to be executed when the event occurs.
24
- * @return {void@return {function} - A function that, when called, will unregister the callback from the event.
67
+ * @param eventName - The name of the event to register the callback for.
68
+ * @param callback - The callback function to be called when the event is triggered.
69
+ * @returns A function that, when called, will unregister the callback from the event.
25
70
  */
26
- export function Once(eventName: string, callback: Function): void;
71
+ export declare function Once<E extends WailsEventName = WailsEventName>(eventName: E, callback: WailsEventCallback<E>): () => void;
27
72
  /**
28
73
  * Removes event listeners for the specified event names.
29
74
  *
30
- * @param {string} eventName - The name of the event to remove listeners for.
31
- * @param {...string} additionalEventNames - Additional event names to remove listeners for.
32
- * @return {undefined}
75
+ * @param eventNames - The name of the events to remove listeners for.
33
76
  */
34
- export function Off(eventName: string, ...additionalEventNames: string[]): undefined;
77
+ export declare function Off(...eventNames: [WailsEventName, ...WailsEventName[]]): void;
35
78
  /**
36
79
  * Removes all event listeners.
37
- *
38
- * @function OffAll
39
- * @returns {void}
40
80
  */
41
- export function OffAll(): void;
81
+ export declare function OffAll(): void;
42
82
  /**
43
- * Emits an event using the given event name.
83
+ * Emits an event.
44
84
  *
45
- * @param {WailsEvent} event - The name of the event to emit.
46
- * @returns {any} - The result of the emitted event.
47
- */
48
- export function Emit(event: WailsEvent): any;
49
- export class WailsEvent {
50
- constructor(name: any, data?: any);
51
- name: any;
52
- data: any;
53
- }
85
+ * @returns A promise that will be fulfilled once the event has been emitted. Resolves to true if the event was cancelled.
86
+ * @param name - The name of the event to emit
87
+ * @param data - The data that will be sent with the event
88
+ */
89
+ export declare function Emit<E extends WailsEventName = WailsEventName>(name: E, data: WailsEventData<E>): Promise<boolean>;
90
+ export declare function Emit<E extends WailsEventName = WailsEventName>(name: WailsEventData<E> extends null | void ? E : never): Promise<boolean>;
package/types/flags.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Retrieves the value associated with the specified key from the flag map.
3
3
  *
4
- * @param {string} keyString - The key to retrieve the value for.
5
- * @return {*} - The value associated with the specified key.
4
+ * @param key - The key to retrieve the value for.
5
+ * @return The value associated with the specified key.
6
6
  */
7
- export function GetFlag(keyString: string): any;
7
+ export declare function GetFlag(key: string): any;
package/types/index.d.ts CHANGED
@@ -1,48 +1,32 @@
1
- export namespace Events {
2
- export { On };
3
- export { Off };
4
- export { OnMultiple };
5
- export { WailsEvent };
6
- export { OffAll };
7
- export { Emit };
8
- export { Once };
9
- }
10
- export namespace Call {
11
- export { Plugin };
12
- export { ByID };
13
- export { ByName };
14
- }
15
- export namespace Dialogs {
16
- export { Info };
17
- export { Error };
18
- export { OpenFile };
19
- export { Question };
20
- export { Warning };
21
- export { SaveFile };
22
- }
23
- import * as Application from "./application";
24
- import * as Browser from "./browser";
25
- import * as Clipboard from "./clipboard";
26
- import * as ContextMenu from "./contextmenu";
27
- import * as Flags from "./flags";
28
- import * as Runtime from "./runtime";
29
- import * as Screens from "./screens";
30
- import * as System from "./system";
31
- import * as Window from "./window";
32
- import { On } from './events';
33
- import { Off } from './events';
34
- import { OnMultiple } from './events';
35
- import { WailsEvent } from './events';
36
- import { OffAll } from './events';
37
- import { Emit } from './events';
38
- import { Once } from './events';
39
- import { Plugin } from "./calls";
40
- import { ByID } from "./calls";
41
- import { ByName } from "./calls";
42
- import { Info } from "./dialogs";
43
- import { Error } from "./dialogs";
44
- import { OpenFile } from "./dialogs";
45
- import { Question } from "./dialogs";
46
- import { Warning } from "./dialogs";
47
- import { SaveFile } from "./dialogs";
48
- export { Application, Browser, Clipboard, ContextMenu, Flags, Runtime, Screens, System, Window };
1
+ import "./contextmenu.js";
2
+ import "./drag.js";
3
+ import * as Application from "./application.js";
4
+ import * as Browser from "./browser.js";
5
+ import * as Call from "./calls.js";
6
+ import * as Clipboard from "./clipboard.js";
7
+ import * as Create from "./create.js";
8
+ import * as Dialogs from "./dialogs.js";
9
+ import * as Events from "./events.js";
10
+ import * as Flags from "./flags.js";
11
+ import * as Screens from "./screens.js";
12
+ import * as System from "./system.js";
13
+ import * as IOS from "./ios.js";
14
+ import * as Android from "./android.js";
15
+ import * as Updater from "./updater.js";
16
+ import Window from "./window.js";
17
+ import * as WML from "./wml.js";
18
+ export { Application, Browser, Call, Clipboard, Dialogs, Events, Flags, Screens, System, IOS, Android, Updater, Window, WML };
19
+ /**
20
+ * An internal utility consumed by the binding generator.
21
+ *
22
+ * @ignore
23
+ */
24
+ export { Create };
25
+ export * from "./cancellable.js";
26
+ export { setTransport, getTransport, type RuntimeTransport, objectNames, clientId, } from "./runtime.js";
27
+ /**
28
+ * Loads a script from the given URL if it exists.
29
+ * Uses HEAD request to check existence, then injects a script tag.
30
+ * Silently ignores if the script doesn't exist.
31
+ */
32
+ export declare function loadOptionalScript(url: string): Promise<void>;
package/types/ios.d.ts ADDED
@@ -0,0 +1,13 @@
1
+ export declare namespace Haptics {
2
+ type ImpactStyle = "light" | "medium" | "heavy" | "soft" | "rigid";
3
+ function Impact(style?: ImpactStyle): Promise<void>;
4
+ }
5
+ export declare namespace Device {
6
+ interface Info {
7
+ model: string;
8
+ systemName: string;
9
+ systemVersion: string;
10
+ isSimulator: boolean;
11
+ }
12
+ function Info(): Promise<Info>;
13
+ }
@@ -0,0 +1,9 @@
1
+ export declare const eventListeners: Map<string, Listener[]>;
2
+ export declare class Listener {
3
+ eventName: string;
4
+ callback: (data: any) => void;
5
+ maxCallbacks: number;
6
+ constructor(eventName: string, callback: (data: any) => void, maxCallbacks: number);
7
+ dispatch(data: any): boolean;
8
+ }
9
+ export declare function listenerOff(listener: Listener): void;
@@ -0,0 +1 @@
1
+ export declare function nanoid(size?: number): string;
@@ -0,0 +1,10 @@
1
+ import type { Plugin } from 'vite';
2
+ /**
3
+ * A plugin that extends the wails runtime with locally generated code
4
+ * to provide support for typed custom events.
5
+ * With the plugin installed, vite will fail to build the project
6
+ * unless wails bindings have been generated first.
7
+ *
8
+ * @param {string} [bindingsRoot] - The root import path for generated bindings
9
+ */
10
+ export default function WailsTypedEvents(bindingsRoot: string): Plugin;
@@ -1,29 +1,68 @@
1
+ import { nanoid } from "./nanoid.js";
2
+ export { nanoid };
3
+ export declare const objectNames: Readonly<{
4
+ Call: 0;
5
+ Clipboard: 1;
6
+ Application: 2;
7
+ Events: 3;
8
+ ContextMenu: 4;
9
+ Dialog: 5;
10
+ Window: 6;
11
+ Screens: 7;
12
+ System: 8;
13
+ Browser: 9;
14
+ CancelCall: 10;
15
+ IOS: 11;
16
+ Android: 12;
17
+ }>;
18
+ export declare let clientId: string;
1
19
  /**
2
- * Creates a runtime caller function that invokes a specified method on a given object within a specified window context.
20
+ * RuntimeTransport defines the interface for custom IPC transport implementations.
21
+ * Implement this interface to use WebSockets, custom protocols, or any other
22
+ * transport mechanism instead of the default HTTP fetch.
23
+ */
24
+ export interface RuntimeTransport {
25
+ /**
26
+ * Send a runtime call and return the response.
27
+ *
28
+ * @param objectID - The Wails object ID (0=Call, 1=Clipboard, etc.)
29
+ * @param method - The method ID to call
30
+ * @param windowName - Optional window name
31
+ * @param args - Arguments to pass (will be JSON stringified if present)
32
+ * @returns Promise that resolves with the response data
33
+ */
34
+ call(objectID: number, method: number, windowName: string, args: any): Promise<any>;
35
+ }
36
+ /**
37
+ * Set a custom transport for all Wails runtime calls.
38
+ * This allows you to replace the default HTTP fetch transport with
39
+ * WebSockets, custom protocols, or any other mechanism.
40
+ *
41
+ * @param transport - Your custom transport implementation
42
+ *
43
+ * @example
44
+ * ```typescript
45
+ * import { setTransport } from '/wails/runtime.js';
3
46
  *
4
- * @param {Object} object - The object on which the method is to be invoked.
5
- * @param {string} windowName - The name of the window context in which the method should be called.
6
- * @returns {Function} A runtime caller function that takes the method name and optionally arguments and invokes the method within the specified window context.
47
+ * const wsTransport = {
48
+ * call: async (objectID, method, windowName, args) => {
49
+ * // Your WebSocket implementation
50
+ * }
51
+ * };
52
+ *
53
+ * setTransport(wsTransport);
54
+ * ```
55
+ */
56
+ export declare function setTransport(transport: RuntimeTransport | null): void;
57
+ /**
58
+ * Get the current transport (useful for extending/wrapping)
7
59
  */
8
- export function newRuntimeCaller(object: any, windowName: string): Function;
60
+ export declare function getTransport(): RuntimeTransport | null;
9
61
  /**
10
62
  * Creates a new runtime caller with specified ID.
11
63
  *
12
- * @param {object} object - The object to invoke the method on.
13
- * @param {string} windowName - The name of the window.
14
- * @return {Function} - The new runtime caller function.
64
+ * @param object - The object to invoke the method on.
65
+ * @param windowName - The name of the window.
66
+ * @return The new runtime caller function.
15
67
  */
16
- export function newRuntimeCallerWithID(object: object, windowName: string): Function;
17
- export namespace objectNames {
18
- let Call: number;
19
- let Clipboard: number;
20
- let Application: number;
21
- let Events: number;
22
- let ContextMenu: number;
23
- let Dialog: number;
24
- let Window: number;
25
- let Screens: number;
26
- let System: number;
27
- let Browser: number;
28
- }
29
- export let clientId: string;
68
+ export declare function newRuntimeCaller(object: number, windowName?: string): (method: number, args?: any) => Promise<any>;