@wailsio/runtime 3.0.0-alpha.20 → 3.0.0-alpha.22
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/docs/{functions/Window.Size.html → assets/icons.js} +15 -2
- package/docs/assets/icons.svg +1 -0
- package/docs/assets/main.js +4 -4
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/assets/style.css +2 -1
- package/docs/classes/Events.WailsEvent.html +4 -4
- package/docs/functions/Application.Hide.html +2 -2
- package/docs/functions/Application.Quit.html +2 -2
- package/docs/functions/Application.Show.html +2 -2
- package/docs/functions/Browser.OpenURL.html +3 -3
- package/docs/functions/Call.ByID.html +4 -4
- package/docs/functions/Call.ByName.html +4 -4
- package/docs/functions/Call.Call.html +3 -3
- package/docs/functions/Call.Plugin.html +5 -5
- package/docs/functions/Clipboard.SetText.html +3 -3
- package/docs/functions/Clipboard.Text.html +2 -2
- package/docs/functions/Dialogs.Error.html +2 -2
- package/docs/functions/Dialogs.Info.html +2 -2
- package/docs/functions/Dialogs.OpenFile.html +2 -2
- package/docs/functions/Dialogs.Question.html +2 -2
- package/docs/functions/Dialogs.SaveFile.html +2 -2
- package/docs/functions/Dialogs.Warning.html +2 -2
- package/docs/functions/Events.Emit.html +3 -3
- package/docs/functions/Events.Off.html +4 -4
- package/docs/functions/Events.OffAll.html +2 -2
- package/docs/functions/Events.On.html +4 -4
- package/docs/functions/Events.OnMultiple.html +5 -5
- package/docs/functions/Events.Once.html +4 -4
- package/docs/functions/Events.setup.html +1 -1
- package/docs/functions/Flags.GetFlag.html +3 -3
- package/docs/functions/Screens.GetAll.html +3 -3
- package/docs/functions/Screens.GetCurrent.html +3 -3
- package/docs/functions/Screens.GetPrimary.html +3 -3
- package/docs/functions/System.Capabilities.html +2 -2
- package/docs/functions/System.Environment.html +2 -2
- package/docs/functions/System.IsAMD64.html +2 -2
- package/docs/functions/System.IsARM.html +2 -2
- package/docs/functions/System.IsARM64.html +2 -2
- package/docs/functions/System.IsDarkMode.html +2 -2
- package/docs/functions/System.IsDebug.html +1 -1
- package/docs/functions/System.IsLinux.html +2 -2
- package/docs/functions/System.IsMac.html +2 -2
- package/docs/functions/System.IsWindows.html +2 -2
- package/docs/functions/System.invoke.html +1 -1
- package/docs/functions/WML.Enable.html +2 -0
- package/docs/functions/WML.Reload.html +2 -2
- package/docs/index.html +2 -2
- package/docs/interfaces/Dialogs.Button.html +7 -7
- package/docs/interfaces/Dialogs.FileFilter.html +5 -5
- package/docs/interfaces/Dialogs.MessageDialogOptions.html +9 -9
- package/docs/interfaces/Dialogs.OpenFileDialogOptions.html +33 -33
- package/docs/interfaces/Dialogs.SaveFileDialogOptions.html +35 -35
- package/docs/interfaces/Screens.Position.html +5 -5
- package/docs/interfaces/Screens.Rect.html +9 -9
- package/docs/interfaces/Screens.Screen.html +19 -19
- package/docs/interfaces/Screens.Size.html +5 -5
- package/docs/interfaces/System.EnvironmentInfo.html +11 -5
- package/docs/interfaces/System.OSInfo.html +9 -0
- package/docs/modules/Application.html +4 -4
- package/docs/modules/Browser.html +2 -2
- package/docs/modules/Call.html +5 -5
- package/docs/modules/Clipboard.html +3 -3
- package/docs/modules/Dialogs.html +12 -12
- package/docs/modules/Events.html +10 -10
- package/docs/modules/Flags.html +2 -2
- package/docs/modules/Screens.html +8 -9
- package/docs/modules/System.html +14 -13
- package/docs/modules/WML.html +3 -2
- package/docs/modules.html +12 -12
- package/docs/variables/Events.Types.html +1 -1
- package/docs/variables/Window.html +2 -0
- package/package.json +34 -31
- package/src/application.js +46 -46
- package/src/browser.js +24 -24
- package/src/calls.js +180 -161
- package/src/clipboard.js +35 -35
- package/src/contextmenu.js +97 -97
- package/src/dialogs.js +200 -200
- package/src/drag.js +119 -125
- package/src/event_types.js +5 -0
- package/src/events.js +140 -140
- package/src/flags.js +25 -25
- package/src/index.js +46 -95
- package/src/runtime.js +123 -122
- package/src/screens.js +77 -83
- package/src/system.js +128 -117
- package/src/utils.js +86 -0
- package/src/window.js +638 -316
- package/src/wml.js +250 -171
- package/tsconfig.json +19 -19
- package/types/event_types.d.ts +5 -0
- package/types/events.d.ts +5 -0
- package/types/index.d.ts +2 -2
- package/types/runtime.d.ts +1 -0
- package/types/screens.d.ts +1 -5
- package/types/system.d.ts +44 -4
- package/types/utils.d.ts +14 -0
- package/types/window.d.ts +400 -133
- package/types/wml.d.ts +6 -0
- package/docs/functions/Window.Center.html +0 -2
- package/docs/functions/Window.Close.html +0 -2
- package/docs/functions/Window.Fullscreen.html +0 -2
- package/docs/functions/Window.Get.html +0 -6
- package/docs/functions/Window.GetZoomLevel.html +0 -2
- package/docs/functions/Window.Height.html +0 -2
- package/docs/functions/Window.Hide.html +0 -2
- package/docs/functions/Window.Maximise.html +0 -2
- package/docs/functions/Window.Minimise.html +0 -2
- package/docs/functions/Window.RelativePosition.html +0 -2
- package/docs/functions/Window.Restore.html +0 -2
- package/docs/functions/Window.Screen-1.html +0 -2
- package/docs/functions/Window.SetAlwaysOnTop.html +0 -3
- package/docs/functions/Window.SetBackgroundColour.html +0 -6
- package/docs/functions/Window.SetMaxSize.html +0 -4
- package/docs/functions/Window.SetMinSize.html +0 -4
- package/docs/functions/Window.SetRelativePosition.html +0 -4
- package/docs/functions/Window.SetResizable.html +0 -3
- package/docs/functions/Window.SetSize.html +0 -4
- package/docs/functions/Window.SetTitle.html +0 -3
- package/docs/functions/Window.SetZoomLevel.html +0 -3
- package/docs/functions/Window.Show.html +0 -2
- package/docs/functions/Window.ToggleMaximise.html +0 -2
- package/docs/functions/Window.UnMaximise.html +0 -2
- package/docs/functions/Window.UnMinimise.html +0 -2
- package/docs/functions/Window.Width.html +0 -2
- package/docs/functions/Window.ZoomIn.html +0 -2
- package/docs/functions/Window.ZoomOut.html +0 -2
- package/docs/functions/Window.ZoomReset.html +0 -2
- package/docs/modules/Window.html +0 -32
- package/docs/types/Screens.Rotation.html +0 -2
- package/src/log.js +0 -13
package/src/wml.js
CHANGED
|
@@ -1,171 +1,250 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* @return {void}
|
|
24
|
-
*/
|
|
25
|
-
function
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
*
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
*
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
}
|
|
1
|
+
/*
|
|
2
|
+
_ __ _ __
|
|
3
|
+
| | / /___ _(_) /____
|
|
4
|
+
| | /| / / __ `/ / / ___/
|
|
5
|
+
| |/ |/ / /_/ / / (__ )
|
|
6
|
+
|__/|__/\__,_/_/_/____/
|
|
7
|
+
The electron alternative for Go
|
|
8
|
+
(c) Lea Anthony 2019-present
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import {OpenURL} from "./browser";
|
|
12
|
+
import {Question} from "./dialogs";
|
|
13
|
+
import {Emit, WailsEvent} from "./events";
|
|
14
|
+
import {canAbortListeners, whenReady} from "./utils";
|
|
15
|
+
import Window from "./window";
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Sends an event with the given name and optional data.
|
|
19
|
+
*
|
|
20
|
+
* @param {string} eventName - The name of the event to send.
|
|
21
|
+
* @param {any} [data=null] - Optional data to send along with the event.
|
|
22
|
+
*
|
|
23
|
+
* @return {void}
|
|
24
|
+
*/
|
|
25
|
+
function sendEvent(eventName, data=null) {
|
|
26
|
+
Emit(new WailsEvent(eventName, data));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Calls a method on a specified window.
|
|
31
|
+
* @param {string} windowName - The name of the window to call the method on.
|
|
32
|
+
* @param {string} methodName - The name of the method to call.
|
|
33
|
+
*/
|
|
34
|
+
function callWindowMethod(windowName, methodName) {
|
|
35
|
+
const targetWindow = Window.Get(windowName);
|
|
36
|
+
const method = targetWindow[methodName];
|
|
37
|
+
|
|
38
|
+
if (typeof method !== "function") {
|
|
39
|
+
console.error(`Window method '${methodName}' not found`);
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
try {
|
|
44
|
+
method.call(targetWindow);
|
|
45
|
+
} catch (e) {
|
|
46
|
+
console.error(`Error calling window method '${methodName}': `, e);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Responds to a triggering event by running appropriate WML actions for the current target
|
|
52
|
+
*
|
|
53
|
+
* @param {Event} ev
|
|
54
|
+
* @return {void}
|
|
55
|
+
*/
|
|
56
|
+
function onWMLTriggered(ev) {
|
|
57
|
+
const element = ev.currentTarget;
|
|
58
|
+
|
|
59
|
+
function runEffect(choice = "Yes") {
|
|
60
|
+
if (choice !== "Yes")
|
|
61
|
+
return;
|
|
62
|
+
|
|
63
|
+
const eventType = element.getAttribute('wml-event');
|
|
64
|
+
const targetWindow = element.getAttribute('wml-target-window') || "";
|
|
65
|
+
const windowMethod = element.getAttribute('wml-window');
|
|
66
|
+
const url = element.getAttribute('wml-openurl');
|
|
67
|
+
|
|
68
|
+
if (eventType !== null)
|
|
69
|
+
sendEvent(eventType);
|
|
70
|
+
if (windowMethod !== null)
|
|
71
|
+
callWindowMethod(targetWindow, windowMethod);
|
|
72
|
+
if (url !== null)
|
|
73
|
+
void OpenURL(url);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const confirm = element.getAttribute('wml-confirm');
|
|
77
|
+
|
|
78
|
+
if (confirm) {
|
|
79
|
+
Question({
|
|
80
|
+
Title: "Confirm",
|
|
81
|
+
Message: confirm,
|
|
82
|
+
Detached: false,
|
|
83
|
+
Buttons: [
|
|
84
|
+
{ Label: "Yes" },
|
|
85
|
+
{ Label: "No", IsDefault: true }
|
|
86
|
+
]
|
|
87
|
+
}).then(runEffect);
|
|
88
|
+
} else {
|
|
89
|
+
runEffect();
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* @type {symbol}
|
|
95
|
+
*/
|
|
96
|
+
const controller = Symbol();
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* AbortControllerRegistry does not actually remember active event listeners: instead
|
|
100
|
+
* it ties them to an AbortSignal and uses an AbortController to remove them all at once.
|
|
101
|
+
*/
|
|
102
|
+
class AbortControllerRegistry {
|
|
103
|
+
constructor() {
|
|
104
|
+
/**
|
|
105
|
+
* Stores the AbortController that can be used to remove all currently active listeners.
|
|
106
|
+
*
|
|
107
|
+
* @private
|
|
108
|
+
* @name {@link controller}
|
|
109
|
+
* @member {AbortController}
|
|
110
|
+
*/
|
|
111
|
+
this[controller] = new AbortController();
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Returns an options object for addEventListener that ties the listener
|
|
116
|
+
* to the AbortSignal from the current AbortController.
|
|
117
|
+
*
|
|
118
|
+
* @param {HTMLElement} element An HTML element
|
|
119
|
+
* @param {string[]} triggers The list of active WML trigger events for the specified elements
|
|
120
|
+
* @returns {AddEventListenerOptions}
|
|
121
|
+
*/
|
|
122
|
+
set(element, triggers) {
|
|
123
|
+
return { signal: this[controller].signal };
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Removes all registered event listeners.
|
|
128
|
+
*
|
|
129
|
+
* @returns {void}
|
|
130
|
+
*/
|
|
131
|
+
reset() {
|
|
132
|
+
this[controller].abort();
|
|
133
|
+
this[controller] = new AbortController();
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* @type {symbol}
|
|
139
|
+
*/
|
|
140
|
+
const triggerMap = Symbol();
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* @type {symbol}
|
|
144
|
+
*/
|
|
145
|
+
const elementCount = Symbol();
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* WeakMapRegistry maps active trigger events to each DOM element through a WeakMap.
|
|
149
|
+
* This ensures that the mapping remains private to this module, while still allowing garbage
|
|
150
|
+
* collection of the involved elements.
|
|
151
|
+
*/
|
|
152
|
+
class WeakMapRegistry {
|
|
153
|
+
constructor() {
|
|
154
|
+
/**
|
|
155
|
+
* Stores the current element-to-trigger mapping.
|
|
156
|
+
*
|
|
157
|
+
* @private
|
|
158
|
+
* @name {@link triggerMap}
|
|
159
|
+
* @member {WeakMap<HTMLElement, string[]>}
|
|
160
|
+
*/
|
|
161
|
+
this[triggerMap] = new WeakMap();
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Counts the number of elements with active WML triggers.
|
|
165
|
+
*
|
|
166
|
+
* @private
|
|
167
|
+
* @name {@link elementCount}
|
|
168
|
+
* @member {number}
|
|
169
|
+
*/
|
|
170
|
+
this[elementCount] = 0;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Sets the active triggers for the specified element.
|
|
175
|
+
*
|
|
176
|
+
* @param {HTMLElement} element An HTML element
|
|
177
|
+
* @param {string[]} triggers The list of active WML trigger events for the specified element
|
|
178
|
+
* @returns {AddEventListenerOptions}
|
|
179
|
+
*/
|
|
180
|
+
set(element, triggers) {
|
|
181
|
+
this[elementCount] += !this[triggerMap].has(element);
|
|
182
|
+
this[triggerMap].set(element, triggers);
|
|
183
|
+
return {};
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Removes all registered event listeners.
|
|
188
|
+
*
|
|
189
|
+
* @returns {void}
|
|
190
|
+
*/
|
|
191
|
+
reset() {
|
|
192
|
+
if (this[elementCount] <= 0)
|
|
193
|
+
return;
|
|
194
|
+
|
|
195
|
+
for (const element of document.body.querySelectorAll('*')) {
|
|
196
|
+
if (this[elementCount] <= 0)
|
|
197
|
+
break;
|
|
198
|
+
|
|
199
|
+
const triggers = this[triggerMap].get(element);
|
|
200
|
+
this[elementCount] -= (typeof triggers !== "undefined");
|
|
201
|
+
|
|
202
|
+
for (const trigger of triggers || [])
|
|
203
|
+
element.removeEventListener(trigger, onWMLTriggered);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
this[triggerMap] = new WeakMap();
|
|
207
|
+
this[elementCount] = 0;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
const triggerRegistry = canAbortListeners() ? new AbortControllerRegistry() : new WeakMapRegistry();
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Adds event listeners to the specified element.
|
|
215
|
+
*
|
|
216
|
+
* @param {HTMLElement} element
|
|
217
|
+
* @return {void}
|
|
218
|
+
*/
|
|
219
|
+
function addWMLListeners(element) {
|
|
220
|
+
const triggerRegExp = /\S+/g;
|
|
221
|
+
const triggerAttr = (element.getAttribute('wml-trigger') || "click");
|
|
222
|
+
const triggers = [];
|
|
223
|
+
|
|
224
|
+
let match;
|
|
225
|
+
while ((match = triggerRegExp.exec(triggerAttr)) !== null)
|
|
226
|
+
triggers.push(match[0]);
|
|
227
|
+
|
|
228
|
+
const options = triggerRegistry.set(element, triggers);
|
|
229
|
+
for (const trigger of triggers)
|
|
230
|
+
element.addEventListener(trigger, onWMLTriggered, options);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Schedules an automatic reload of WML to be performed as soon as the document is fully loaded.
|
|
235
|
+
*
|
|
236
|
+
* @return {void}
|
|
237
|
+
*/
|
|
238
|
+
export function Enable() {
|
|
239
|
+
whenReady(Reload);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Reloads the WML page by adding necessary event listeners and browser listeners.
|
|
244
|
+
*
|
|
245
|
+
* @return {void}
|
|
246
|
+
*/
|
|
247
|
+
export function Reload() {
|
|
248
|
+
triggerRegistry.reset();
|
|
249
|
+
document.body.querySelectorAll('[wml-event], [wml-window], [wml-openurl]').forEach(addWMLListeners);
|
|
250
|
+
}
|
package/tsconfig.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
{
|
|
2
|
-
"include": ["./src/**/*"],
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"lib": [
|
|
5
|
-
"dom",
|
|
6
|
-
"dom.iterable",
|
|
7
|
-
"esnext"
|
|
8
|
-
],
|
|
9
|
-
"allowJs": true,
|
|
10
|
-
"declaration": true,
|
|
11
|
-
"declarationMap": true,
|
|
12
|
-
"emitDeclarationOnly": true,
|
|
13
|
-
"esModuleInterop": true,
|
|
14
|
-
"module": "esnext",
|
|
15
|
-
"moduleResolution": "
|
|
16
|
-
"outDir": "dist",
|
|
17
|
-
"strict": true,
|
|
18
|
-
"target": "es6",
|
|
19
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"include": ["./src/**/*"],
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"lib": [
|
|
5
|
+
"dom",
|
|
6
|
+
"dom.iterable",
|
|
7
|
+
"esnext"
|
|
8
|
+
],
|
|
9
|
+
"allowJs": true,
|
|
10
|
+
"declaration": true,
|
|
11
|
+
"declarationMap": true,
|
|
12
|
+
"emitDeclarationOnly": true,
|
|
13
|
+
"esModuleInterop": true,
|
|
14
|
+
"module": "esnext",
|
|
15
|
+
"moduleResolution": "bundler",
|
|
16
|
+
"outDir": "dist",
|
|
17
|
+
"strict": true,
|
|
18
|
+
"target": "es6",
|
|
19
|
+
}
|
|
20
20
|
}
|
package/types/event_types.d.ts
CHANGED
|
@@ -155,6 +155,11 @@ export declare const EventTypes: {
|
|
|
155
155
|
},
|
|
156
156
|
Linux: {
|
|
157
157
|
SystemThemeChanged: string,
|
|
158
|
+
WindowLoadChanged: string,
|
|
159
|
+
WindowDeleteEvent: string,
|
|
160
|
+
WindowFocusIn: string,
|
|
161
|
+
WindowFocusOut: string,
|
|
162
|
+
ApplicationStartup: string,
|
|
158
163
|
},
|
|
159
164
|
Common: {
|
|
160
165
|
ApplicationStarted: string,
|
package/types/events.d.ts
CHANGED
|
@@ -202,6 +202,11 @@ export const Types: {
|
|
|
202
202
|
};
|
|
203
203
|
Linux: {
|
|
204
204
|
SystemThemeChanged: string;
|
|
205
|
+
WindowLoadChanged: string;
|
|
206
|
+
WindowDeleteEvent: string;
|
|
207
|
+
WindowFocusIn: string;
|
|
208
|
+
WindowFocusOut: string;
|
|
209
|
+
ApplicationStartup: string;
|
|
205
210
|
};
|
|
206
211
|
Common: {
|
|
207
212
|
ApplicationStarted: string;
|
package/types/index.d.ts
CHANGED
|
@@ -7,6 +7,6 @@ import * as Events from "./events";
|
|
|
7
7
|
import * as Flags from "./flags";
|
|
8
8
|
import * as Screens from "./screens";
|
|
9
9
|
import * as System from "./system";
|
|
10
|
-
import
|
|
11
|
-
import * as WML from
|
|
10
|
+
import Window from "./window";
|
|
11
|
+
import * as WML from "./wml";
|
|
12
12
|
export { Application, Browser, Call, Clipboard, Dialogs, Events, Flags, Screens, System, Window, WML };
|
package/types/runtime.d.ts
CHANGED
package/types/screens.d.ts
CHANGED
|
@@ -52,10 +52,6 @@ export type Rect = {
|
|
|
52
52
|
*/
|
|
53
53
|
Height: number;
|
|
54
54
|
};
|
|
55
|
-
/**
|
|
56
|
-
* The rotation of the screen. Can be one of 'Zero', 'Ninety', 'OneEighty', 'TwoSeventy'.
|
|
57
|
-
*/
|
|
58
|
-
export type Rotation = ('Zero' | 'Ninety' | 'OneEighty' | 'TwoSeventy');
|
|
59
55
|
export type Screen = {
|
|
60
56
|
/**
|
|
61
57
|
* - Unique identifier for the screen.
|
|
@@ -92,5 +88,5 @@ export type Screen = {
|
|
|
92
88
|
/**
|
|
93
89
|
* - The rotation of the screen.
|
|
94
90
|
*/
|
|
95
|
-
Rotation:
|
|
91
|
+
Rotation: number;
|
|
96
92
|
};
|
package/types/system.d.ts
CHANGED
|
@@ -14,9 +14,19 @@ export function IsDarkMode(): Promise<boolean>;
|
|
|
14
14
|
*/
|
|
15
15
|
export function Capabilities(): Promise<any>;
|
|
16
16
|
/**
|
|
17
|
-
* @typedef {
|
|
18
|
-
* @property {string}
|
|
17
|
+
* @typedef {Object} OSInfo
|
|
18
|
+
* @property {string} Branding - The branding of the OS.
|
|
19
|
+
* @property {string} ID - The ID of the OS.
|
|
20
|
+
* @property {string} Name - The name of the OS.
|
|
21
|
+
* @property {string} Version - The version of the OS.
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* @typedef {Object} EnvironmentInfo
|
|
19
25
|
* @property {string} Arch - The architecture of the system.
|
|
26
|
+
* @property {boolean} Debug - True if the application is running in debug mode, otherwise false.
|
|
27
|
+
* @property {string} OS - The operating system in use.
|
|
28
|
+
* @property {OSInfo} OSInfo - Details of the operating system.
|
|
29
|
+
* @property {Object} PlatformInfo - Additional platform information.
|
|
20
30
|
*/
|
|
21
31
|
/**
|
|
22
32
|
* @function
|
|
@@ -60,13 +70,43 @@ export function IsARM(): boolean;
|
|
|
60
70
|
*/
|
|
61
71
|
export function IsARM64(): boolean;
|
|
62
72
|
export function IsDebug(): boolean;
|
|
73
|
+
export type OSInfo = {
|
|
74
|
+
/**
|
|
75
|
+
* - The branding of the OS.
|
|
76
|
+
*/
|
|
77
|
+
Branding: string;
|
|
78
|
+
/**
|
|
79
|
+
* - The ID of the OS.
|
|
80
|
+
*/
|
|
81
|
+
ID: string;
|
|
82
|
+
/**
|
|
83
|
+
* - The name of the OS.
|
|
84
|
+
*/
|
|
85
|
+
Name: string;
|
|
86
|
+
/**
|
|
87
|
+
* - The version of the OS.
|
|
88
|
+
*/
|
|
89
|
+
Version: string;
|
|
90
|
+
};
|
|
63
91
|
export type EnvironmentInfo = {
|
|
92
|
+
/**
|
|
93
|
+
* - The architecture of the system.
|
|
94
|
+
*/
|
|
95
|
+
Arch: string;
|
|
96
|
+
/**
|
|
97
|
+
* - True if the application is running in debug mode, otherwise false.
|
|
98
|
+
*/
|
|
99
|
+
Debug: boolean;
|
|
64
100
|
/**
|
|
65
101
|
* - The operating system in use.
|
|
66
102
|
*/
|
|
67
103
|
OS: string;
|
|
68
104
|
/**
|
|
69
|
-
* -
|
|
105
|
+
* - Details of the operating system.
|
|
70
106
|
*/
|
|
71
|
-
|
|
107
|
+
OSInfo: OSInfo;
|
|
108
|
+
/**
|
|
109
|
+
* - Additional platform information.
|
|
110
|
+
*/
|
|
111
|
+
PlatformInfo: any;
|
|
72
112
|
};
|
package/types/utils.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Logs a message to the console with custom formatting.
|
|
3
|
+
* @param {string} message - The message to be logged.
|
|
4
|
+
* @return {void}
|
|
5
|
+
*/
|
|
6
|
+
export function debugLog(message: string): void;
|
|
7
|
+
/**
|
|
8
|
+
* Checks whether the browser supports removing listeners by triggering an AbortSignal
|
|
9
|
+
* (see https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#signal)
|
|
10
|
+
*
|
|
11
|
+
* @return {boolean}
|
|
12
|
+
*/
|
|
13
|
+
export function canAbortListeners(): boolean;
|
|
14
|
+
export function whenReady(callback: any): void;
|