@wailsio/runtime 3.0.0-alpha.72 → 3.0.0-alpha.73

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/dist/create.js CHANGED
@@ -92,3 +92,8 @@ export function Struct(createField) {
92
92
  return source;
93
93
  };
94
94
  }
95
+ /**
96
+ * Maps known event names to creation functions for their data types.
97
+ * Will be monkey-patched by the binding generator.
98
+ */
99
+ export const Events = {};
@@ -230,3 +230,7 @@ export const Types = Object.freeze({
230
230
  WindowDropZoneFilesDropped: "common:WindowDropZoneFilesDropped",
231
231
  }),
232
232
  });
233
+ export const Windows = Types.Windows;
234
+ export const Mac = Types.Mac;
235
+ export const Linux = Types.Linux;
236
+ export const Common = Types.Common;
package/dist/events.js CHANGED
@@ -9,19 +9,21 @@ The electron alternative for Go
9
9
  */
10
10
  import { newRuntimeCaller, objectNames } from "./runtime.js";
11
11
  import { eventListeners, Listener, listenerOff } from "./listener.js";
12
+ import { Events as Create } from "./create.js";
13
+ import { Types } from "./event_types.js";
12
14
  // Setup
13
15
  window._wails = window._wails || {};
14
16
  window._wails.dispatchWailsEvent = dispatchWailsEvent;
15
17
  const call = newRuntimeCaller(objectNames.Events);
16
18
  const EmitMethod = 0;
17
- export { Types } from "./event_types.js";
19
+ export * from "./event_types.js";
18
20
  /**
19
21
  * Represents a system event or a custom event emitted through wails-provided facilities.
20
22
  */
21
23
  export class WailsEvent {
22
- constructor(name, data = null) {
24
+ constructor(name, data) {
23
25
  this.name = name;
24
- this.data = data;
26
+ this.data = data !== null && data !== void 0 ? data : null;
25
27
  }
26
28
  }
27
29
  function dispatchWailsEvent(event) {
@@ -29,7 +31,7 @@ function dispatchWailsEvent(event) {
29
31
  if (!listeners) {
30
32
  return;
31
33
  }
32
- let wailsEvent = new WailsEvent(event.name, event.data);
34
+ let wailsEvent = new WailsEvent(event.name, (event.name in Create) ? Create[event.name](event.data) : event.data);
33
35
  if ('sender' in event) {
34
36
  wailsEvent.sender = event.sender;
35
37
  }
@@ -90,25 +92,6 @@ export function Off(...eventNames) {
90
92
  export function OffAll() {
91
93
  eventListeners.clear();
92
94
  }
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
95
  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 });
96
+ return call(EmitMethod, new WailsEvent(name, data));
114
97
  }
package/dist/index.js CHANGED
@@ -29,7 +29,6 @@ export { Application, Browser, Call, Clipboard, Dialogs, Events, Flags, Screens,
29
29
  * An internal utility consumed by the binding generator.
30
30
  *
31
31
  * @ignore
32
- * @internal
33
32
  */
34
33
  export { Create };
35
34
  export * from "./cancellable.js";
@@ -0,0 +1,64 @@
1
+ /*
2
+ _ __ _ __
3
+ | | / /___ _(_) /____
4
+ | | /| / / __ `/ / / ___/
5
+ | |/ |/ / /_/ / / (__ )
6
+ |__/|__/\__,_/_/_/____/
7
+ The electron alternative for Go
8
+ (c) Lea Anthony 2019-present
9
+ */
10
+ const TYPED_EVENTS_MODULE = "\0wailsio_runtime_events_typed";
11
+ /**
12
+ * A plugin that extends the wails runtime with locally generated code
13
+ * to provide support for typed custom events.
14
+ * With the plugin installed, vite will fail to build the project
15
+ * unless wails bindings have been generated first.
16
+ *
17
+ * @param {string} [bindingsRoot] - The root import path for generated bindings
18
+ */
19
+ export default function WailsTypedEvents(bindingsRoot) {
20
+ let bindingsId, runtimeId, eventsId;
21
+ return {
22
+ name: "wails-typed-events",
23
+ async buildStart() {
24
+ const bindingsPath = `${bindingsRoot}/github.com/wailsapp/wails/v3/internal/eventcreate`;
25
+ let resolution = await this.resolve(bindingsPath);
26
+ if (!resolution || resolution.external) {
27
+ this.error(`Event bindings module not found at import specifier '${bindingsPath}'. Please verify that the wails tool is up to date and the binding generator runs successfully. If you moved the bindings to a custom location, ensure you supplied the correct root path as the first argument to \`wailsTypedEventsPlugin\``);
28
+ return;
29
+ }
30
+ bindingsId = resolution.id;
31
+ resolution = await this.resolve("@wailsio/runtime");
32
+ if (!resolution || resolution.external) {
33
+ return;
34
+ }
35
+ runtimeId = resolution.id;
36
+ resolution = await this.resolve("./events.js", runtimeId);
37
+ if (!resolution || resolution.external) {
38
+ this.error("Could not resolve events module within @wailsio/runtime package. Please verify that the module is correctly installed and up to date.");
39
+ return;
40
+ }
41
+ eventsId = resolution.id;
42
+ },
43
+ resolveId: {
44
+ order: 'pre',
45
+ handler(id, importer) {
46
+ if (bindingsId !== null
47
+ && runtimeId !== null
48
+ && eventsId !== null
49
+ && importer === runtimeId
50
+ && id === "./events.js") {
51
+ return TYPED_EVENTS_MODULE;
52
+ }
53
+ return undefined;
54
+ }
55
+ },
56
+ load(id) {
57
+ if (id === TYPED_EVENTS_MODULE) {
58
+ return (`import ${JSON.stringify(bindingsId)};\n`
59
+ + `export * from ${JSON.stringify(eventsId)};`);
60
+ }
61
+ return undefined;
62
+ }
63
+ };
64
+ }
package/package.json CHANGED
@@ -1,12 +1,18 @@
1
1
  {
2
2
  "name": "@wailsio/runtime",
3
3
  "type": "module",
4
- "version": "3.0.0-alpha.72",
4
+ "version": "3.0.0-alpha.73",
5
5
  "description": "Wails Runtime",
6
6
  "types": "types/index.d.ts",
7
7
  "exports": {
8
- "types": "./types/index.d.ts",
9
- "import": "./dist/index.js"
8
+ ".": {
9
+ "types": "./types/index.d.ts",
10
+ "default": "./dist/index.js"
11
+ },
12
+ "./plugins/*": {
13
+ "types": "./types/plugins/*.d.ts",
14
+ "default": "./dist/plugins/*.js"
15
+ }
10
16
  },
11
17
  "repository": {
12
18
  "type": "git",
@@ -50,6 +56,7 @@
50
56
  "typedoc-plugin-mdn-links": "^4.0.13",
51
57
  "typedoc-plugin-missing-exports": "^3.1.0",
52
58
  "typescript": "^5.7.3",
59
+ "vite": "^5.2.0",
53
60
  "vitest": "^3.0.6"
54
61
  },
55
62
  "overrides": {
@@ -108,7 +108,6 @@ export interface CancellablePromiseWithResolvers<T> {
108
108
  * if so is the underlying implementation.
109
109
  */
110
110
  export declare class CancellablePromise<T> extends Promise<T> implements PromiseLike<T>, CancellablePromiseLike<T> {
111
- static [x: symbol]: PromiseConstructor;
112
111
  /**
113
112
  * Creates a new `CancellablePromise`.
114
113
  *
package/types/create.d.ts CHANGED
@@ -29,3 +29,8 @@ export declare function Nullable<T = any>(element: (source: any) => T): (source:
29
29
  * and returns an in-place creation function for a struct.
30
30
  */
31
31
  export declare function Struct(createField: Record<string, (source: any) => any>): <U extends Record<string, any> = any>(source: any) => U;
32
+ /**
33
+ * Maps known event names to creation functions for their data types.
34
+ * Will be monkey-patched by the binding generator.
35
+ */
36
+ export declare const Events: Record<string, (source: any) => any>;
@@ -1,221 +1,440 @@
1
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";
2
+ readonly Windows: Readonly<{
3
+ readonly APMPowerSettingChange: "windows:APMPowerSettingChange";
4
+ readonly APMPowerStatusChange: "windows:APMPowerStatusChange";
5
+ readonly APMResumeAutomatic: "windows:APMResumeAutomatic";
6
+ readonly APMResumeSuspend: "windows:APMResumeSuspend";
7
+ readonly APMSuspend: "windows:APMSuspend";
8
+ readonly ApplicationStarted: "windows:ApplicationStarted";
9
+ readonly SystemThemeChanged: "windows:SystemThemeChanged";
10
+ readonly WebViewNavigationCompleted: "windows:WebViewNavigationCompleted";
11
+ readonly WindowActive: "windows:WindowActive";
12
+ readonly WindowBackgroundErase: "windows:WindowBackgroundErase";
13
+ readonly WindowClickActive: "windows:WindowClickActive";
14
+ readonly WindowClosing: "windows:WindowClosing";
15
+ readonly WindowDidMove: "windows:WindowDidMove";
16
+ readonly WindowDidResize: "windows:WindowDidResize";
17
+ readonly WindowDPIChanged: "windows:WindowDPIChanged";
18
+ readonly WindowDragDrop: "windows:WindowDragDrop";
19
+ readonly WindowDragEnter: "windows:WindowDragEnter";
20
+ readonly WindowDragLeave: "windows:WindowDragLeave";
21
+ readonly WindowDragOver: "windows:WindowDragOver";
22
+ readonly WindowEndMove: "windows:WindowEndMove";
23
+ readonly WindowEndResize: "windows:WindowEndResize";
24
+ readonly WindowFullscreen: "windows:WindowFullscreen";
25
+ readonly WindowHide: "windows:WindowHide";
26
+ readonly WindowInactive: "windows:WindowInactive";
27
+ readonly WindowKeyDown: "windows:WindowKeyDown";
28
+ readonly WindowKeyUp: "windows:WindowKeyUp";
29
+ readonly WindowKillFocus: "windows:WindowKillFocus";
30
+ readonly WindowNonClientHit: "windows:WindowNonClientHit";
31
+ readonly WindowNonClientMouseDown: "windows:WindowNonClientMouseDown";
32
+ readonly WindowNonClientMouseLeave: "windows:WindowNonClientMouseLeave";
33
+ readonly WindowNonClientMouseMove: "windows:WindowNonClientMouseMove";
34
+ readonly WindowNonClientMouseUp: "windows:WindowNonClientMouseUp";
35
+ readonly WindowPaint: "windows:WindowPaint";
36
+ readonly WindowRestore: "windows:WindowRestore";
37
+ readonly WindowSetFocus: "windows:WindowSetFocus";
38
+ readonly WindowShow: "windows:WindowShow";
39
+ readonly WindowStartMove: "windows:WindowStartMove";
40
+ readonly WindowStartResize: "windows:WindowStartResize";
41
+ readonly WindowUnFullscreen: "windows:WindowUnFullscreen";
42
+ readonly WindowZOrderChanged: "windows:WindowZOrderChanged";
43
+ readonly WindowMinimise: "windows:WindowMinimise";
44
+ readonly WindowUnMinimise: "windows:WindowUnMinimise";
45
+ readonly WindowMaximise: "windows:WindowMaximise";
46
+ readonly WindowUnMaximise: "windows:WindowUnMaximise";
47
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
- ApplicationShouldHandleReopen: "mac:ApplicationShouldHandleReopen";
64
- ApplicationWillBecomeActive: "mac:ApplicationWillBecomeActive";
65
- ApplicationWillFinishLaunching: "mac:ApplicationWillFinishLaunching";
66
- ApplicationWillHide: "mac:ApplicationWillHide";
67
- ApplicationWillResignActive: "mac:ApplicationWillResignActive";
68
- ApplicationWillTerminate: "mac:ApplicationWillTerminate";
69
- ApplicationWillUnhide: "mac:ApplicationWillUnhide";
70
- ApplicationWillUpdate: "mac:ApplicationWillUpdate";
71
- MenuDidAddItem: "mac:MenuDidAddItem";
72
- MenuDidBeginTracking: "mac:MenuDidBeginTracking";
73
- MenuDidClose: "mac:MenuDidClose";
74
- MenuDidDisplayItem: "mac:MenuDidDisplayItem";
75
- MenuDidEndTracking: "mac:MenuDidEndTracking";
76
- MenuDidHighlightItem: "mac:MenuDidHighlightItem";
77
- MenuDidOpen: "mac:MenuDidOpen";
78
- MenuDidPopUp: "mac:MenuDidPopUp";
79
- MenuDidRemoveItem: "mac:MenuDidRemoveItem";
80
- MenuDidSendAction: "mac:MenuDidSendAction";
81
- MenuDidSendActionToItem: "mac:MenuDidSendActionToItem";
82
- MenuDidUpdate: "mac:MenuDidUpdate";
83
- MenuWillAddItem: "mac:MenuWillAddItem";
84
- MenuWillBeginTracking: "mac:MenuWillBeginTracking";
85
- MenuWillDisplayItem: "mac:MenuWillDisplayItem";
86
- MenuWillEndTracking: "mac:MenuWillEndTracking";
87
- MenuWillHighlightItem: "mac:MenuWillHighlightItem";
88
- MenuWillOpen: "mac:MenuWillOpen";
89
- MenuWillPopUp: "mac:MenuWillPopUp";
90
- MenuWillRemoveItem: "mac:MenuWillRemoveItem";
91
- MenuWillSendAction: "mac:MenuWillSendAction";
92
- MenuWillSendActionToItem: "mac:MenuWillSendActionToItem";
93
- MenuWillUpdate: "mac:MenuWillUpdate";
94
- WebViewDidCommitNavigation: "mac:WebViewDidCommitNavigation";
95
- WebViewDidFinishNavigation: "mac:WebViewDidFinishNavigation";
96
- WebViewDidReceiveServerRedirectForProvisionalNavigation: "mac:WebViewDidReceiveServerRedirectForProvisionalNavigation";
97
- WebViewDidStartProvisionalNavigation: "mac:WebViewDidStartProvisionalNavigation";
98
- WindowDidBecomeKey: "mac:WindowDidBecomeKey";
99
- WindowDidBecomeMain: "mac:WindowDidBecomeMain";
100
- WindowDidBeginSheet: "mac:WindowDidBeginSheet";
101
- WindowDidChangeAlpha: "mac:WindowDidChangeAlpha";
102
- WindowDidChangeBackingLocation: "mac:WindowDidChangeBackingLocation";
103
- WindowDidChangeBackingProperties: "mac:WindowDidChangeBackingProperties";
104
- WindowDidChangeCollectionBehavior: "mac:WindowDidChangeCollectionBehavior";
105
- WindowDidChangeEffectiveAppearance: "mac:WindowDidChangeEffectiveAppearance";
106
- WindowDidChangeOcclusionState: "mac:WindowDidChangeOcclusionState";
107
- WindowDidChangeOrderingMode: "mac:WindowDidChangeOrderingMode";
108
- WindowDidChangeScreen: "mac:WindowDidChangeScreen";
109
- WindowDidChangeScreenParameters: "mac:WindowDidChangeScreenParameters";
110
- WindowDidChangeScreenProfile: "mac:WindowDidChangeScreenProfile";
111
- WindowDidChangeScreenSpace: "mac:WindowDidChangeScreenSpace";
112
- WindowDidChangeScreenSpaceProperties: "mac:WindowDidChangeScreenSpaceProperties";
113
- WindowDidChangeSharingType: "mac:WindowDidChangeSharingType";
114
- WindowDidChangeSpace: "mac:WindowDidChangeSpace";
115
- WindowDidChangeSpaceOrderingMode: "mac:WindowDidChangeSpaceOrderingMode";
116
- WindowDidChangeTitle: "mac:WindowDidChangeTitle";
117
- WindowDidChangeToolbar: "mac:WindowDidChangeToolbar";
118
- WindowDidDeminiaturize: "mac:WindowDidDeminiaturize";
119
- WindowDidEndSheet: "mac:WindowDidEndSheet";
120
- WindowDidEnterFullScreen: "mac:WindowDidEnterFullScreen";
121
- WindowDidEnterVersionBrowser: "mac:WindowDidEnterVersionBrowser";
122
- WindowDidExitFullScreen: "mac:WindowDidExitFullScreen";
123
- WindowDidExitVersionBrowser: "mac:WindowDidExitVersionBrowser";
124
- WindowDidExpose: "mac:WindowDidExpose";
125
- WindowDidFocus: "mac:WindowDidFocus";
126
- WindowDidMiniaturize: "mac:WindowDidMiniaturize";
127
- WindowDidMove: "mac:WindowDidMove";
128
- WindowDidOrderOffScreen: "mac:WindowDidOrderOffScreen";
129
- WindowDidOrderOnScreen: "mac:WindowDidOrderOnScreen";
130
- WindowDidResignKey: "mac:WindowDidResignKey";
131
- WindowDidResignMain: "mac:WindowDidResignMain";
132
- WindowDidResize: "mac:WindowDidResize";
133
- WindowDidUpdate: "mac:WindowDidUpdate";
134
- WindowDidUpdateAlpha: "mac:WindowDidUpdateAlpha";
135
- WindowDidUpdateCollectionBehavior: "mac:WindowDidUpdateCollectionBehavior";
136
- WindowDidUpdateCollectionProperties: "mac:WindowDidUpdateCollectionProperties";
137
- WindowDidUpdateShadow: "mac:WindowDidUpdateShadow";
138
- WindowDidUpdateTitle: "mac:WindowDidUpdateTitle";
139
- WindowDidUpdateToolbar: "mac:WindowDidUpdateToolbar";
140
- WindowDidZoom: "mac:WindowDidZoom";
141
- WindowFileDraggingEntered: "mac:WindowFileDraggingEntered";
142
- WindowFileDraggingExited: "mac:WindowFileDraggingExited";
143
- WindowFileDraggingPerformed: "mac:WindowFileDraggingPerformed";
144
- WindowHide: "mac:WindowHide";
145
- WindowMaximise: "mac:WindowMaximise";
146
- WindowUnMaximise: "mac:WindowUnMaximise";
147
- WindowMinimise: "mac:WindowMinimise";
148
- WindowUnMinimise: "mac:WindowUnMinimise";
149
- WindowShouldClose: "mac:WindowShouldClose";
150
- WindowShow: "mac:WindowShow";
151
- WindowWillBecomeKey: "mac:WindowWillBecomeKey";
152
- WindowWillBecomeMain: "mac:WindowWillBecomeMain";
153
- WindowWillBeginSheet: "mac:WindowWillBeginSheet";
154
- WindowWillChangeOrderingMode: "mac:WindowWillChangeOrderingMode";
155
- WindowWillClose: "mac:WindowWillClose";
156
- WindowWillDeminiaturize: "mac:WindowWillDeminiaturize";
157
- WindowWillEnterFullScreen: "mac:WindowWillEnterFullScreen";
158
- WindowWillEnterVersionBrowser: "mac:WindowWillEnterVersionBrowser";
159
- WindowWillExitFullScreen: "mac:WindowWillExitFullScreen";
160
- WindowWillExitVersionBrowser: "mac:WindowWillExitVersionBrowser";
161
- WindowWillFocus: "mac:WindowWillFocus";
162
- WindowWillMiniaturize: "mac:WindowWillMiniaturize";
163
- WindowWillMove: "mac:WindowWillMove";
164
- WindowWillOrderOffScreen: "mac:WindowWillOrderOffScreen";
165
- WindowWillOrderOnScreen: "mac:WindowWillOrderOnScreen";
166
- WindowWillResignMain: "mac:WindowWillResignMain";
167
- WindowWillResize: "mac:WindowWillResize";
168
- WindowWillUnfocus: "mac:WindowWillUnfocus";
169
- WindowWillUpdate: "mac:WindowWillUpdate";
170
- WindowWillUpdateAlpha: "mac:WindowWillUpdateAlpha";
171
- WindowWillUpdateCollectionBehavior: "mac:WindowWillUpdateCollectionBehavior";
172
- WindowWillUpdateCollectionProperties: "mac:WindowWillUpdateCollectionProperties";
173
- WindowWillUpdateShadow: "mac:WindowWillUpdateShadow";
174
- WindowWillUpdateTitle: "mac:WindowWillUpdateTitle";
175
- WindowWillUpdateToolbar: "mac:WindowWillUpdateToolbar";
176
- WindowWillUpdateVisibility: "mac:WindowWillUpdateVisibility";
177
- WindowWillUseStandardFrame: "mac:WindowWillUseStandardFrame";
178
- WindowZoomIn: "mac:WindowZoomIn";
179
- WindowZoomOut: "mac:WindowZoomOut";
180
- WindowZoomReset: "mac:WindowZoomReset";
48
+ readonly Mac: Readonly<{
49
+ readonly ApplicationDidBecomeActive: "mac:ApplicationDidBecomeActive";
50
+ readonly ApplicationDidChangeBackingProperties: "mac:ApplicationDidChangeBackingProperties";
51
+ readonly ApplicationDidChangeEffectiveAppearance: "mac:ApplicationDidChangeEffectiveAppearance";
52
+ readonly ApplicationDidChangeIcon: "mac:ApplicationDidChangeIcon";
53
+ readonly ApplicationDidChangeOcclusionState: "mac:ApplicationDidChangeOcclusionState";
54
+ readonly ApplicationDidChangeScreenParameters: "mac:ApplicationDidChangeScreenParameters";
55
+ readonly ApplicationDidChangeStatusBarFrame: "mac:ApplicationDidChangeStatusBarFrame";
56
+ readonly ApplicationDidChangeStatusBarOrientation: "mac:ApplicationDidChangeStatusBarOrientation";
57
+ readonly ApplicationDidChangeTheme: "mac:ApplicationDidChangeTheme";
58
+ readonly ApplicationDidFinishLaunching: "mac:ApplicationDidFinishLaunching";
59
+ readonly ApplicationDidHide: "mac:ApplicationDidHide";
60
+ readonly ApplicationDidResignActive: "mac:ApplicationDidResignActive";
61
+ readonly ApplicationDidUnhide: "mac:ApplicationDidUnhide";
62
+ readonly ApplicationDidUpdate: "mac:ApplicationDidUpdate";
63
+ readonly ApplicationShouldHandleReopen: "mac:ApplicationShouldHandleReopen";
64
+ readonly ApplicationWillBecomeActive: "mac:ApplicationWillBecomeActive";
65
+ readonly ApplicationWillFinishLaunching: "mac:ApplicationWillFinishLaunching";
66
+ readonly ApplicationWillHide: "mac:ApplicationWillHide";
67
+ readonly ApplicationWillResignActive: "mac:ApplicationWillResignActive";
68
+ readonly ApplicationWillTerminate: "mac:ApplicationWillTerminate";
69
+ readonly ApplicationWillUnhide: "mac:ApplicationWillUnhide";
70
+ readonly ApplicationWillUpdate: "mac:ApplicationWillUpdate";
71
+ readonly MenuDidAddItem: "mac:MenuDidAddItem";
72
+ readonly MenuDidBeginTracking: "mac:MenuDidBeginTracking";
73
+ readonly MenuDidClose: "mac:MenuDidClose";
74
+ readonly MenuDidDisplayItem: "mac:MenuDidDisplayItem";
75
+ readonly MenuDidEndTracking: "mac:MenuDidEndTracking";
76
+ readonly MenuDidHighlightItem: "mac:MenuDidHighlightItem";
77
+ readonly MenuDidOpen: "mac:MenuDidOpen";
78
+ readonly MenuDidPopUp: "mac:MenuDidPopUp";
79
+ readonly MenuDidRemoveItem: "mac:MenuDidRemoveItem";
80
+ readonly MenuDidSendAction: "mac:MenuDidSendAction";
81
+ readonly MenuDidSendActionToItem: "mac:MenuDidSendActionToItem";
82
+ readonly MenuDidUpdate: "mac:MenuDidUpdate";
83
+ readonly MenuWillAddItem: "mac:MenuWillAddItem";
84
+ readonly MenuWillBeginTracking: "mac:MenuWillBeginTracking";
85
+ readonly MenuWillDisplayItem: "mac:MenuWillDisplayItem";
86
+ readonly MenuWillEndTracking: "mac:MenuWillEndTracking";
87
+ readonly MenuWillHighlightItem: "mac:MenuWillHighlightItem";
88
+ readonly MenuWillOpen: "mac:MenuWillOpen";
89
+ readonly MenuWillPopUp: "mac:MenuWillPopUp";
90
+ readonly MenuWillRemoveItem: "mac:MenuWillRemoveItem";
91
+ readonly MenuWillSendAction: "mac:MenuWillSendAction";
92
+ readonly MenuWillSendActionToItem: "mac:MenuWillSendActionToItem";
93
+ readonly MenuWillUpdate: "mac:MenuWillUpdate";
94
+ readonly WebViewDidCommitNavigation: "mac:WebViewDidCommitNavigation";
95
+ readonly WebViewDidFinishNavigation: "mac:WebViewDidFinishNavigation";
96
+ readonly WebViewDidReceiveServerRedirectForProvisionalNavigation: "mac:WebViewDidReceiveServerRedirectForProvisionalNavigation";
97
+ readonly WebViewDidStartProvisionalNavigation: "mac:WebViewDidStartProvisionalNavigation";
98
+ readonly WindowDidBecomeKey: "mac:WindowDidBecomeKey";
99
+ readonly WindowDidBecomeMain: "mac:WindowDidBecomeMain";
100
+ readonly WindowDidBeginSheet: "mac:WindowDidBeginSheet";
101
+ readonly WindowDidChangeAlpha: "mac:WindowDidChangeAlpha";
102
+ readonly WindowDidChangeBackingLocation: "mac:WindowDidChangeBackingLocation";
103
+ readonly WindowDidChangeBackingProperties: "mac:WindowDidChangeBackingProperties";
104
+ readonly WindowDidChangeCollectionBehavior: "mac:WindowDidChangeCollectionBehavior";
105
+ readonly WindowDidChangeEffectiveAppearance: "mac:WindowDidChangeEffectiveAppearance";
106
+ readonly WindowDidChangeOcclusionState: "mac:WindowDidChangeOcclusionState";
107
+ readonly WindowDidChangeOrderingMode: "mac:WindowDidChangeOrderingMode";
108
+ readonly WindowDidChangeScreen: "mac:WindowDidChangeScreen";
109
+ readonly WindowDidChangeScreenParameters: "mac:WindowDidChangeScreenParameters";
110
+ readonly WindowDidChangeScreenProfile: "mac:WindowDidChangeScreenProfile";
111
+ readonly WindowDidChangeScreenSpace: "mac:WindowDidChangeScreenSpace";
112
+ readonly WindowDidChangeScreenSpaceProperties: "mac:WindowDidChangeScreenSpaceProperties";
113
+ readonly WindowDidChangeSharingType: "mac:WindowDidChangeSharingType";
114
+ readonly WindowDidChangeSpace: "mac:WindowDidChangeSpace";
115
+ readonly WindowDidChangeSpaceOrderingMode: "mac:WindowDidChangeSpaceOrderingMode";
116
+ readonly WindowDidChangeTitle: "mac:WindowDidChangeTitle";
117
+ readonly WindowDidChangeToolbar: "mac:WindowDidChangeToolbar";
118
+ readonly WindowDidDeminiaturize: "mac:WindowDidDeminiaturize";
119
+ readonly WindowDidEndSheet: "mac:WindowDidEndSheet";
120
+ readonly WindowDidEnterFullScreen: "mac:WindowDidEnterFullScreen";
121
+ readonly WindowDidEnterVersionBrowser: "mac:WindowDidEnterVersionBrowser";
122
+ readonly WindowDidExitFullScreen: "mac:WindowDidExitFullScreen";
123
+ readonly WindowDidExitVersionBrowser: "mac:WindowDidExitVersionBrowser";
124
+ readonly WindowDidExpose: "mac:WindowDidExpose";
125
+ readonly WindowDidFocus: "mac:WindowDidFocus";
126
+ readonly WindowDidMiniaturize: "mac:WindowDidMiniaturize";
127
+ readonly WindowDidMove: "mac:WindowDidMove";
128
+ readonly WindowDidOrderOffScreen: "mac:WindowDidOrderOffScreen";
129
+ readonly WindowDidOrderOnScreen: "mac:WindowDidOrderOnScreen";
130
+ readonly WindowDidResignKey: "mac:WindowDidResignKey";
131
+ readonly WindowDidResignMain: "mac:WindowDidResignMain";
132
+ readonly WindowDidResize: "mac:WindowDidResize";
133
+ readonly WindowDidUpdate: "mac:WindowDidUpdate";
134
+ readonly WindowDidUpdateAlpha: "mac:WindowDidUpdateAlpha";
135
+ readonly WindowDidUpdateCollectionBehavior: "mac:WindowDidUpdateCollectionBehavior";
136
+ readonly WindowDidUpdateCollectionProperties: "mac:WindowDidUpdateCollectionProperties";
137
+ readonly WindowDidUpdateShadow: "mac:WindowDidUpdateShadow";
138
+ readonly WindowDidUpdateTitle: "mac:WindowDidUpdateTitle";
139
+ readonly WindowDidUpdateToolbar: "mac:WindowDidUpdateToolbar";
140
+ readonly WindowDidZoom: "mac:WindowDidZoom";
141
+ readonly WindowFileDraggingEntered: "mac:WindowFileDraggingEntered";
142
+ readonly WindowFileDraggingExited: "mac:WindowFileDraggingExited";
143
+ readonly WindowFileDraggingPerformed: "mac:WindowFileDraggingPerformed";
144
+ readonly WindowHide: "mac:WindowHide";
145
+ readonly WindowMaximise: "mac:WindowMaximise";
146
+ readonly WindowUnMaximise: "mac:WindowUnMaximise";
147
+ readonly WindowMinimise: "mac:WindowMinimise";
148
+ readonly WindowUnMinimise: "mac:WindowUnMinimise";
149
+ readonly WindowShouldClose: "mac:WindowShouldClose";
150
+ readonly WindowShow: "mac:WindowShow";
151
+ readonly WindowWillBecomeKey: "mac:WindowWillBecomeKey";
152
+ readonly WindowWillBecomeMain: "mac:WindowWillBecomeMain";
153
+ readonly WindowWillBeginSheet: "mac:WindowWillBeginSheet";
154
+ readonly WindowWillChangeOrderingMode: "mac:WindowWillChangeOrderingMode";
155
+ readonly WindowWillClose: "mac:WindowWillClose";
156
+ readonly WindowWillDeminiaturize: "mac:WindowWillDeminiaturize";
157
+ readonly WindowWillEnterFullScreen: "mac:WindowWillEnterFullScreen";
158
+ readonly WindowWillEnterVersionBrowser: "mac:WindowWillEnterVersionBrowser";
159
+ readonly WindowWillExitFullScreen: "mac:WindowWillExitFullScreen";
160
+ readonly WindowWillExitVersionBrowser: "mac:WindowWillExitVersionBrowser";
161
+ readonly WindowWillFocus: "mac:WindowWillFocus";
162
+ readonly WindowWillMiniaturize: "mac:WindowWillMiniaturize";
163
+ readonly WindowWillMove: "mac:WindowWillMove";
164
+ readonly WindowWillOrderOffScreen: "mac:WindowWillOrderOffScreen";
165
+ readonly WindowWillOrderOnScreen: "mac:WindowWillOrderOnScreen";
166
+ readonly WindowWillResignMain: "mac:WindowWillResignMain";
167
+ readonly WindowWillResize: "mac:WindowWillResize";
168
+ readonly WindowWillUnfocus: "mac:WindowWillUnfocus";
169
+ readonly WindowWillUpdate: "mac:WindowWillUpdate";
170
+ readonly WindowWillUpdateAlpha: "mac:WindowWillUpdateAlpha";
171
+ readonly WindowWillUpdateCollectionBehavior: "mac:WindowWillUpdateCollectionBehavior";
172
+ readonly WindowWillUpdateCollectionProperties: "mac:WindowWillUpdateCollectionProperties";
173
+ readonly WindowWillUpdateShadow: "mac:WindowWillUpdateShadow";
174
+ readonly WindowWillUpdateTitle: "mac:WindowWillUpdateTitle";
175
+ readonly WindowWillUpdateToolbar: "mac:WindowWillUpdateToolbar";
176
+ readonly WindowWillUpdateVisibility: "mac:WindowWillUpdateVisibility";
177
+ readonly WindowWillUseStandardFrame: "mac:WindowWillUseStandardFrame";
178
+ readonly WindowZoomIn: "mac:WindowZoomIn";
179
+ readonly WindowZoomOut: "mac:WindowZoomOut";
180
+ readonly WindowZoomReset: "mac:WindowZoomReset";
181
181
  }>;
182
- Linux: Readonly<{
183
- ApplicationStartup: "linux:ApplicationStartup";
184
- SystemThemeChanged: "linux:SystemThemeChanged";
185
- WindowDeleteEvent: "linux:WindowDeleteEvent";
186
- WindowDidMove: "linux:WindowDidMove";
187
- WindowDidResize: "linux:WindowDidResize";
188
- WindowFocusIn: "linux:WindowFocusIn";
189
- WindowFocusOut: "linux:WindowFocusOut";
190
- WindowLoadChanged: "linux:WindowLoadChanged";
182
+ readonly Linux: Readonly<{
183
+ readonly ApplicationStartup: "linux:ApplicationStartup";
184
+ readonly SystemThemeChanged: "linux:SystemThemeChanged";
185
+ readonly WindowDeleteEvent: "linux:WindowDeleteEvent";
186
+ readonly WindowDidMove: "linux:WindowDidMove";
187
+ readonly WindowDidResize: "linux:WindowDidResize";
188
+ readonly WindowFocusIn: "linux:WindowFocusIn";
189
+ readonly WindowFocusOut: "linux:WindowFocusOut";
190
+ readonly WindowLoadChanged: "linux:WindowLoadChanged";
191
191
  }>;
192
- Common: Readonly<{
193
- ApplicationOpenedWithFile: "common:ApplicationOpenedWithFile";
194
- ApplicationStarted: "common:ApplicationStarted";
195
- ApplicationLaunchedWithUrl: "common:ApplicationLaunchedWithUrl";
196
- ThemeChanged: "common:ThemeChanged";
197
- WindowClosing: "common:WindowClosing";
198
- WindowDidMove: "common:WindowDidMove";
199
- WindowDidResize: "common:WindowDidResize";
200
- WindowDPIChanged: "common:WindowDPIChanged";
201
- WindowFilesDropped: "common:WindowFilesDropped";
202
- WindowFocus: "common:WindowFocus";
203
- WindowFullscreen: "common:WindowFullscreen";
204
- WindowHide: "common:WindowHide";
205
- WindowLostFocus: "common:WindowLostFocus";
206
- WindowMaximise: "common:WindowMaximise";
207
- WindowMinimise: "common:WindowMinimise";
208
- WindowToggleFrameless: "common:WindowToggleFrameless";
209
- WindowRestore: "common:WindowRestore";
210
- WindowRuntimeReady: "common:WindowRuntimeReady";
211
- WindowShow: "common:WindowShow";
212
- WindowUnFullscreen: "common:WindowUnFullscreen";
213
- WindowUnMaximise: "common:WindowUnMaximise";
214
- WindowUnMinimise: "common:WindowUnMinimise";
215
- WindowZoom: "common:WindowZoom";
216
- WindowZoomIn: "common:WindowZoomIn";
217
- WindowZoomOut: "common:WindowZoomOut";
218
- WindowZoomReset: "common:WindowZoomReset";
219
- WindowDropZoneFilesDropped: "common:WindowDropZoneFilesDropped";
192
+ readonly Common: Readonly<{
193
+ readonly ApplicationOpenedWithFile: "common:ApplicationOpenedWithFile";
194
+ readonly ApplicationStarted: "common:ApplicationStarted";
195
+ readonly ApplicationLaunchedWithUrl: "common:ApplicationLaunchedWithUrl";
196
+ readonly ThemeChanged: "common:ThemeChanged";
197
+ readonly WindowClosing: "common:WindowClosing";
198
+ readonly WindowDidMove: "common:WindowDidMove";
199
+ readonly WindowDidResize: "common:WindowDidResize";
200
+ readonly WindowDPIChanged: "common:WindowDPIChanged";
201
+ readonly WindowFilesDropped: "common:WindowFilesDropped";
202
+ readonly WindowFocus: "common:WindowFocus";
203
+ readonly WindowFullscreen: "common:WindowFullscreen";
204
+ readonly WindowHide: "common:WindowHide";
205
+ readonly WindowLostFocus: "common:WindowLostFocus";
206
+ readonly WindowMaximise: "common:WindowMaximise";
207
+ readonly WindowMinimise: "common:WindowMinimise";
208
+ readonly WindowToggleFrameless: "common:WindowToggleFrameless";
209
+ readonly WindowRestore: "common:WindowRestore";
210
+ readonly WindowRuntimeReady: "common:WindowRuntimeReady";
211
+ readonly WindowShow: "common:WindowShow";
212
+ readonly WindowUnFullscreen: "common:WindowUnFullscreen";
213
+ readonly WindowUnMaximise: "common:WindowUnMaximise";
214
+ readonly WindowUnMinimise: "common:WindowUnMinimise";
215
+ readonly WindowZoom: "common:WindowZoom";
216
+ readonly WindowZoomIn: "common:WindowZoomIn";
217
+ readonly WindowZoomOut: "common:WindowZoomOut";
218
+ readonly WindowZoomReset: "common:WindowZoomReset";
219
+ readonly WindowDropZoneFilesDropped: "common:WindowDropZoneFilesDropped";
220
220
  }>;
221
221
  }>;
222
+ export declare const Windows: Readonly<{
223
+ readonly APMPowerSettingChange: "windows:APMPowerSettingChange";
224
+ readonly APMPowerStatusChange: "windows:APMPowerStatusChange";
225
+ readonly APMResumeAutomatic: "windows:APMResumeAutomatic";
226
+ readonly APMResumeSuspend: "windows:APMResumeSuspend";
227
+ readonly APMSuspend: "windows:APMSuspend";
228
+ readonly ApplicationStarted: "windows:ApplicationStarted";
229
+ readonly SystemThemeChanged: "windows:SystemThemeChanged";
230
+ readonly WebViewNavigationCompleted: "windows:WebViewNavigationCompleted";
231
+ readonly WindowActive: "windows:WindowActive";
232
+ readonly WindowBackgroundErase: "windows:WindowBackgroundErase";
233
+ readonly WindowClickActive: "windows:WindowClickActive";
234
+ readonly WindowClosing: "windows:WindowClosing";
235
+ readonly WindowDidMove: "windows:WindowDidMove";
236
+ readonly WindowDidResize: "windows:WindowDidResize";
237
+ readonly WindowDPIChanged: "windows:WindowDPIChanged";
238
+ readonly WindowDragDrop: "windows:WindowDragDrop";
239
+ readonly WindowDragEnter: "windows:WindowDragEnter";
240
+ readonly WindowDragLeave: "windows:WindowDragLeave";
241
+ readonly WindowDragOver: "windows:WindowDragOver";
242
+ readonly WindowEndMove: "windows:WindowEndMove";
243
+ readonly WindowEndResize: "windows:WindowEndResize";
244
+ readonly WindowFullscreen: "windows:WindowFullscreen";
245
+ readonly WindowHide: "windows:WindowHide";
246
+ readonly WindowInactive: "windows:WindowInactive";
247
+ readonly WindowKeyDown: "windows:WindowKeyDown";
248
+ readonly WindowKeyUp: "windows:WindowKeyUp";
249
+ readonly WindowKillFocus: "windows:WindowKillFocus";
250
+ readonly WindowNonClientHit: "windows:WindowNonClientHit";
251
+ readonly WindowNonClientMouseDown: "windows:WindowNonClientMouseDown";
252
+ readonly WindowNonClientMouseLeave: "windows:WindowNonClientMouseLeave";
253
+ readonly WindowNonClientMouseMove: "windows:WindowNonClientMouseMove";
254
+ readonly WindowNonClientMouseUp: "windows:WindowNonClientMouseUp";
255
+ readonly WindowPaint: "windows:WindowPaint";
256
+ readonly WindowRestore: "windows:WindowRestore";
257
+ readonly WindowSetFocus: "windows:WindowSetFocus";
258
+ readonly WindowShow: "windows:WindowShow";
259
+ readonly WindowStartMove: "windows:WindowStartMove";
260
+ readonly WindowStartResize: "windows:WindowStartResize";
261
+ readonly WindowUnFullscreen: "windows:WindowUnFullscreen";
262
+ readonly WindowZOrderChanged: "windows:WindowZOrderChanged";
263
+ readonly WindowMinimise: "windows:WindowMinimise";
264
+ readonly WindowUnMinimise: "windows:WindowUnMinimise";
265
+ readonly WindowMaximise: "windows:WindowMaximise";
266
+ readonly WindowUnMaximise: "windows:WindowUnMaximise";
267
+ }>;
268
+ export declare const Mac: Readonly<{
269
+ readonly ApplicationDidBecomeActive: "mac:ApplicationDidBecomeActive";
270
+ readonly ApplicationDidChangeBackingProperties: "mac:ApplicationDidChangeBackingProperties";
271
+ readonly ApplicationDidChangeEffectiveAppearance: "mac:ApplicationDidChangeEffectiveAppearance";
272
+ readonly ApplicationDidChangeIcon: "mac:ApplicationDidChangeIcon";
273
+ readonly ApplicationDidChangeOcclusionState: "mac:ApplicationDidChangeOcclusionState";
274
+ readonly ApplicationDidChangeScreenParameters: "mac:ApplicationDidChangeScreenParameters";
275
+ readonly ApplicationDidChangeStatusBarFrame: "mac:ApplicationDidChangeStatusBarFrame";
276
+ readonly ApplicationDidChangeStatusBarOrientation: "mac:ApplicationDidChangeStatusBarOrientation";
277
+ readonly ApplicationDidChangeTheme: "mac:ApplicationDidChangeTheme";
278
+ readonly ApplicationDidFinishLaunching: "mac:ApplicationDidFinishLaunching";
279
+ readonly ApplicationDidHide: "mac:ApplicationDidHide";
280
+ readonly ApplicationDidResignActive: "mac:ApplicationDidResignActive";
281
+ readonly ApplicationDidUnhide: "mac:ApplicationDidUnhide";
282
+ readonly ApplicationDidUpdate: "mac:ApplicationDidUpdate";
283
+ readonly ApplicationShouldHandleReopen: "mac:ApplicationShouldHandleReopen";
284
+ readonly ApplicationWillBecomeActive: "mac:ApplicationWillBecomeActive";
285
+ readonly ApplicationWillFinishLaunching: "mac:ApplicationWillFinishLaunching";
286
+ readonly ApplicationWillHide: "mac:ApplicationWillHide";
287
+ readonly ApplicationWillResignActive: "mac:ApplicationWillResignActive";
288
+ readonly ApplicationWillTerminate: "mac:ApplicationWillTerminate";
289
+ readonly ApplicationWillUnhide: "mac:ApplicationWillUnhide";
290
+ readonly ApplicationWillUpdate: "mac:ApplicationWillUpdate";
291
+ readonly MenuDidAddItem: "mac:MenuDidAddItem";
292
+ readonly MenuDidBeginTracking: "mac:MenuDidBeginTracking";
293
+ readonly MenuDidClose: "mac:MenuDidClose";
294
+ readonly MenuDidDisplayItem: "mac:MenuDidDisplayItem";
295
+ readonly MenuDidEndTracking: "mac:MenuDidEndTracking";
296
+ readonly MenuDidHighlightItem: "mac:MenuDidHighlightItem";
297
+ readonly MenuDidOpen: "mac:MenuDidOpen";
298
+ readonly MenuDidPopUp: "mac:MenuDidPopUp";
299
+ readonly MenuDidRemoveItem: "mac:MenuDidRemoveItem";
300
+ readonly MenuDidSendAction: "mac:MenuDidSendAction";
301
+ readonly MenuDidSendActionToItem: "mac:MenuDidSendActionToItem";
302
+ readonly MenuDidUpdate: "mac:MenuDidUpdate";
303
+ readonly MenuWillAddItem: "mac:MenuWillAddItem";
304
+ readonly MenuWillBeginTracking: "mac:MenuWillBeginTracking";
305
+ readonly MenuWillDisplayItem: "mac:MenuWillDisplayItem";
306
+ readonly MenuWillEndTracking: "mac:MenuWillEndTracking";
307
+ readonly MenuWillHighlightItem: "mac:MenuWillHighlightItem";
308
+ readonly MenuWillOpen: "mac:MenuWillOpen";
309
+ readonly MenuWillPopUp: "mac:MenuWillPopUp";
310
+ readonly MenuWillRemoveItem: "mac:MenuWillRemoveItem";
311
+ readonly MenuWillSendAction: "mac:MenuWillSendAction";
312
+ readonly MenuWillSendActionToItem: "mac:MenuWillSendActionToItem";
313
+ readonly MenuWillUpdate: "mac:MenuWillUpdate";
314
+ readonly WebViewDidCommitNavigation: "mac:WebViewDidCommitNavigation";
315
+ readonly WebViewDidFinishNavigation: "mac:WebViewDidFinishNavigation";
316
+ readonly WebViewDidReceiveServerRedirectForProvisionalNavigation: "mac:WebViewDidReceiveServerRedirectForProvisionalNavigation";
317
+ readonly WebViewDidStartProvisionalNavigation: "mac:WebViewDidStartProvisionalNavigation";
318
+ readonly WindowDidBecomeKey: "mac:WindowDidBecomeKey";
319
+ readonly WindowDidBecomeMain: "mac:WindowDidBecomeMain";
320
+ readonly WindowDidBeginSheet: "mac:WindowDidBeginSheet";
321
+ readonly WindowDidChangeAlpha: "mac:WindowDidChangeAlpha";
322
+ readonly WindowDidChangeBackingLocation: "mac:WindowDidChangeBackingLocation";
323
+ readonly WindowDidChangeBackingProperties: "mac:WindowDidChangeBackingProperties";
324
+ readonly WindowDidChangeCollectionBehavior: "mac:WindowDidChangeCollectionBehavior";
325
+ readonly WindowDidChangeEffectiveAppearance: "mac:WindowDidChangeEffectiveAppearance";
326
+ readonly WindowDidChangeOcclusionState: "mac:WindowDidChangeOcclusionState";
327
+ readonly WindowDidChangeOrderingMode: "mac:WindowDidChangeOrderingMode";
328
+ readonly WindowDidChangeScreen: "mac:WindowDidChangeScreen";
329
+ readonly WindowDidChangeScreenParameters: "mac:WindowDidChangeScreenParameters";
330
+ readonly WindowDidChangeScreenProfile: "mac:WindowDidChangeScreenProfile";
331
+ readonly WindowDidChangeScreenSpace: "mac:WindowDidChangeScreenSpace";
332
+ readonly WindowDidChangeScreenSpaceProperties: "mac:WindowDidChangeScreenSpaceProperties";
333
+ readonly WindowDidChangeSharingType: "mac:WindowDidChangeSharingType";
334
+ readonly WindowDidChangeSpace: "mac:WindowDidChangeSpace";
335
+ readonly WindowDidChangeSpaceOrderingMode: "mac:WindowDidChangeSpaceOrderingMode";
336
+ readonly WindowDidChangeTitle: "mac:WindowDidChangeTitle";
337
+ readonly WindowDidChangeToolbar: "mac:WindowDidChangeToolbar";
338
+ readonly WindowDidDeminiaturize: "mac:WindowDidDeminiaturize";
339
+ readonly WindowDidEndSheet: "mac:WindowDidEndSheet";
340
+ readonly WindowDidEnterFullScreen: "mac:WindowDidEnterFullScreen";
341
+ readonly WindowDidEnterVersionBrowser: "mac:WindowDidEnterVersionBrowser";
342
+ readonly WindowDidExitFullScreen: "mac:WindowDidExitFullScreen";
343
+ readonly WindowDidExitVersionBrowser: "mac:WindowDidExitVersionBrowser";
344
+ readonly WindowDidExpose: "mac:WindowDidExpose";
345
+ readonly WindowDidFocus: "mac:WindowDidFocus";
346
+ readonly WindowDidMiniaturize: "mac:WindowDidMiniaturize";
347
+ readonly WindowDidMove: "mac:WindowDidMove";
348
+ readonly WindowDidOrderOffScreen: "mac:WindowDidOrderOffScreen";
349
+ readonly WindowDidOrderOnScreen: "mac:WindowDidOrderOnScreen";
350
+ readonly WindowDidResignKey: "mac:WindowDidResignKey";
351
+ readonly WindowDidResignMain: "mac:WindowDidResignMain";
352
+ readonly WindowDidResize: "mac:WindowDidResize";
353
+ readonly WindowDidUpdate: "mac:WindowDidUpdate";
354
+ readonly WindowDidUpdateAlpha: "mac:WindowDidUpdateAlpha";
355
+ readonly WindowDidUpdateCollectionBehavior: "mac:WindowDidUpdateCollectionBehavior";
356
+ readonly WindowDidUpdateCollectionProperties: "mac:WindowDidUpdateCollectionProperties";
357
+ readonly WindowDidUpdateShadow: "mac:WindowDidUpdateShadow";
358
+ readonly WindowDidUpdateTitle: "mac:WindowDidUpdateTitle";
359
+ readonly WindowDidUpdateToolbar: "mac:WindowDidUpdateToolbar";
360
+ readonly WindowDidZoom: "mac:WindowDidZoom";
361
+ readonly WindowFileDraggingEntered: "mac:WindowFileDraggingEntered";
362
+ readonly WindowFileDraggingExited: "mac:WindowFileDraggingExited";
363
+ readonly WindowFileDraggingPerformed: "mac:WindowFileDraggingPerformed";
364
+ readonly WindowHide: "mac:WindowHide";
365
+ readonly WindowMaximise: "mac:WindowMaximise";
366
+ readonly WindowUnMaximise: "mac:WindowUnMaximise";
367
+ readonly WindowMinimise: "mac:WindowMinimise";
368
+ readonly WindowUnMinimise: "mac:WindowUnMinimise";
369
+ readonly WindowShouldClose: "mac:WindowShouldClose";
370
+ readonly WindowShow: "mac:WindowShow";
371
+ readonly WindowWillBecomeKey: "mac:WindowWillBecomeKey";
372
+ readonly WindowWillBecomeMain: "mac:WindowWillBecomeMain";
373
+ readonly WindowWillBeginSheet: "mac:WindowWillBeginSheet";
374
+ readonly WindowWillChangeOrderingMode: "mac:WindowWillChangeOrderingMode";
375
+ readonly WindowWillClose: "mac:WindowWillClose";
376
+ readonly WindowWillDeminiaturize: "mac:WindowWillDeminiaturize";
377
+ readonly WindowWillEnterFullScreen: "mac:WindowWillEnterFullScreen";
378
+ readonly WindowWillEnterVersionBrowser: "mac:WindowWillEnterVersionBrowser";
379
+ readonly WindowWillExitFullScreen: "mac:WindowWillExitFullScreen";
380
+ readonly WindowWillExitVersionBrowser: "mac:WindowWillExitVersionBrowser";
381
+ readonly WindowWillFocus: "mac:WindowWillFocus";
382
+ readonly WindowWillMiniaturize: "mac:WindowWillMiniaturize";
383
+ readonly WindowWillMove: "mac:WindowWillMove";
384
+ readonly WindowWillOrderOffScreen: "mac:WindowWillOrderOffScreen";
385
+ readonly WindowWillOrderOnScreen: "mac:WindowWillOrderOnScreen";
386
+ readonly WindowWillResignMain: "mac:WindowWillResignMain";
387
+ readonly WindowWillResize: "mac:WindowWillResize";
388
+ readonly WindowWillUnfocus: "mac:WindowWillUnfocus";
389
+ readonly WindowWillUpdate: "mac:WindowWillUpdate";
390
+ readonly WindowWillUpdateAlpha: "mac:WindowWillUpdateAlpha";
391
+ readonly WindowWillUpdateCollectionBehavior: "mac:WindowWillUpdateCollectionBehavior";
392
+ readonly WindowWillUpdateCollectionProperties: "mac:WindowWillUpdateCollectionProperties";
393
+ readonly WindowWillUpdateShadow: "mac:WindowWillUpdateShadow";
394
+ readonly WindowWillUpdateTitle: "mac:WindowWillUpdateTitle";
395
+ readonly WindowWillUpdateToolbar: "mac:WindowWillUpdateToolbar";
396
+ readonly WindowWillUpdateVisibility: "mac:WindowWillUpdateVisibility";
397
+ readonly WindowWillUseStandardFrame: "mac:WindowWillUseStandardFrame";
398
+ readonly WindowZoomIn: "mac:WindowZoomIn";
399
+ readonly WindowZoomOut: "mac:WindowZoomOut";
400
+ readonly WindowZoomReset: "mac:WindowZoomReset";
401
+ }>;
402
+ export declare const Linux: Readonly<{
403
+ readonly ApplicationStartup: "linux:ApplicationStartup";
404
+ readonly SystemThemeChanged: "linux:SystemThemeChanged";
405
+ readonly WindowDeleteEvent: "linux:WindowDeleteEvent";
406
+ readonly WindowDidMove: "linux:WindowDidMove";
407
+ readonly WindowDidResize: "linux:WindowDidResize";
408
+ readonly WindowFocusIn: "linux:WindowFocusIn";
409
+ readonly WindowFocusOut: "linux:WindowFocusOut";
410
+ readonly WindowLoadChanged: "linux:WindowLoadChanged";
411
+ }>;
412
+ export declare const Common: Readonly<{
413
+ readonly ApplicationOpenedWithFile: "common:ApplicationOpenedWithFile";
414
+ readonly ApplicationStarted: "common:ApplicationStarted";
415
+ readonly ApplicationLaunchedWithUrl: "common:ApplicationLaunchedWithUrl";
416
+ readonly ThemeChanged: "common:ThemeChanged";
417
+ readonly WindowClosing: "common:WindowClosing";
418
+ readonly WindowDidMove: "common:WindowDidMove";
419
+ readonly WindowDidResize: "common:WindowDidResize";
420
+ readonly WindowDPIChanged: "common:WindowDPIChanged";
421
+ readonly WindowFilesDropped: "common:WindowFilesDropped";
422
+ readonly WindowFocus: "common:WindowFocus";
423
+ readonly WindowFullscreen: "common:WindowFullscreen";
424
+ readonly WindowHide: "common:WindowHide";
425
+ readonly WindowLostFocus: "common:WindowLostFocus";
426
+ readonly WindowMaximise: "common:WindowMaximise";
427
+ readonly WindowMinimise: "common:WindowMinimise";
428
+ readonly WindowToggleFrameless: "common:WindowToggleFrameless";
429
+ readonly WindowRestore: "common:WindowRestore";
430
+ readonly WindowRuntimeReady: "common:WindowRuntimeReady";
431
+ readonly WindowShow: "common:WindowShow";
432
+ readonly WindowUnFullscreen: "common:WindowUnFullscreen";
433
+ readonly WindowUnMaximise: "common:WindowUnMaximise";
434
+ readonly WindowUnMinimise: "common:WindowUnMinimise";
435
+ readonly WindowZoom: "common:WindowZoom";
436
+ readonly WindowZoomIn: "common:WindowZoomIn";
437
+ readonly WindowZoomOut: "common:WindowZoomOut";
438
+ readonly WindowZoomReset: "common:WindowZoomReset";
439
+ readonly WindowDropZoneFilesDropped: "common:WindowDropZoneFilesDropped";
440
+ }>;
package/types/events.d.ts CHANGED
@@ -1,26 +1,48 @@
1
- export { Types } from "./event_types.js";
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);
2
23
  /**
3
24
  * The type of handlers for a given event.
4
25
  */
5
- export type Callback = (ev: WailsEvent) => void;
26
+ export type WailsEventCallback<E extends WailsEventName = WailsEventName> = (ev: WailsEvent<E>) => void;
6
27
  /**
7
28
  * Represents a system event or a custom event emitted through wails-provided facilities.
8
29
  */
9
- export declare class WailsEvent {
30
+ export declare class WailsEvent<E extends WailsEventName = WailsEventName> {
10
31
  /**
11
32
  * The name of the event.
12
33
  */
13
- name: string;
34
+ name: E;
14
35
  /**
15
36
  * Optional data associated with the emitted event.
16
37
  */
17
- data: any;
38
+ data: WailsEventData<E>;
18
39
  /**
19
40
  * Name of the originating window. Omitted for application events.
20
41
  * Will be overridden if set manually.
21
42
  */
22
43
  sender?: string;
23
- constructor(name: string, data?: any);
44
+ constructor(name: E, data: WailsEventData<E>);
45
+ constructor(name: WailsEventData<E> extends null | void ? E : never);
24
46
  }
25
47
  /**
26
48
  * Register a callback function to be called multiple times for a specific event.
@@ -30,7 +52,7 @@ export declare class WailsEvent {
30
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.
31
53
  * @returns A function that, when called, will unregister the callback from the event.
32
54
  */
33
- export declare function OnMultiple(eventName: string, callback: Callback, maxCallbacks: number): () => void;
55
+ export declare function OnMultiple<E extends WailsEventName = WailsEventName>(eventName: E, callback: WailsEventCallback<E>, maxCallbacks: number): () => void;
34
56
  /**
35
57
  * Registers a callback function to be executed when the specified event occurs.
36
58
  *
@@ -38,7 +60,7 @@ export declare function OnMultiple(eventName: string, callback: Callback, maxCal
38
60
  * @param callback - The callback function to be called when the event is triggered.
39
61
  * @returns A function that, when called, will unregister the callback from the event.
40
62
  */
41
- export declare function On(eventName: string, callback: Callback): () => void;
63
+ export declare function On<E extends WailsEventName = WailsEventName>(eventName: E, callback: WailsEventCallback<E>): () => void;
42
64
  /**
43
65
  * Registers a callback function to be executed only once for the specified event.
44
66
  *
@@ -46,22 +68,23 @@ export declare function On(eventName: string, callback: Callback): () => void;
46
68
  * @param callback - The callback function to be called when the event is triggered.
47
69
  * @returns A function that, when called, will unregister the callback from the event.
48
70
  */
49
- export declare function Once(eventName: string, callback: Callback): () => void;
71
+ export declare function Once<E extends WailsEventName = WailsEventName>(eventName: E, callback: WailsEventCallback<E>): () => void;
50
72
  /**
51
73
  * Removes event listeners for the specified event names.
52
74
  *
53
75
  * @param eventNames - The name of the events to remove listeners for.
54
76
  */
55
- export declare function Off(...eventNames: [string, ...string[]]): void;
77
+ export declare function Off(...eventNames: [WailsEventName, ...WailsEventName[]]): void;
56
78
  /**
57
79
  * Removes all event listeners.
58
80
  */
59
81
  export declare function OffAll(): void;
60
82
  /**
61
- * Emits an event using the name and data.
83
+ * Emits an event.
62
84
  *
63
- * @returns A promise that will be fulfilled once the event has been emitted.
64
- * @param name - the name of the event to emit.
65
- * @param data - the data to be sent with the event.
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
66
88
  */
67
- export declare function Emit(name: string, data?: any): Promise<void>;
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/index.d.ts CHANGED
@@ -13,4 +13,10 @@ import * as System from "./system.js";
13
13
  import Window from "./window.js";
14
14
  import * as WML from "./wml.js";
15
15
  export { Application, Browser, Call, Clipboard, Dialogs, Events, Flags, Screens, System, Window, WML };
16
+ /**
17
+ * An internal utility consumed by the binding generator.
18
+ *
19
+ * @ignore
20
+ */
21
+ export { Create };
16
22
  export * from "./cancellable.js";
@@ -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;