@wailsio/runtime 3.0.0-alpha.64 → 3.0.0-alpha.66

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (142) hide show
  1. package/{src → dist}/application.js +2 -16
  2. package/dist/browser.js +20 -0
  3. package/dist/callable.js +144 -0
  4. package/dist/calls.js +194 -0
  5. package/dist/cancellable.js +792 -0
  6. package/dist/clipboard.js +30 -0
  7. package/dist/contextmenu.js +80 -0
  8. package/{src → dist}/create.js +2 -33
  9. package/dist/dialogs.js +134 -0
  10. package/dist/drag.js +222 -0
  11. package/dist/event_types.js +229 -0
  12. package/dist/events.js +101 -0
  13. package/dist/flags.js +23 -0
  14. package/dist/index.js +38 -0
  15. package/dist/listener.js +44 -0
  16. package/{src → dist}/nanoid.js +7 -11
  17. package/dist/runtime.js +63 -0
  18. package/dist/screens.js +38 -0
  19. package/dist/system.js +116 -0
  20. package/{src → dist}/utils.js +29 -20
  21. package/dist/window.js +438 -0
  22. package/{src → dist}/wml.js +51 -122
  23. package/package.json +43 -19
  24. package/types/application.d.ts +3 -10
  25. package/types/browser.d.ts +4 -4
  26. package/types/callable.d.ts +3 -0
  27. package/types/calls.d.ts +43 -49
  28. package/types/cancellable.d.ts +434 -0
  29. package/types/clipboard.d.ts +6 -5
  30. package/types/contextmenu.d.ts +1 -0
  31. package/types/create.d.ts +6 -27
  32. package/types/dialogs.d.ts +99 -143
  33. package/types/drag.d.ts +1 -0
  34. package/types/event_types.d.ts +218 -219
  35. package/types/events.d.ts +45 -250
  36. package/types/flags.d.ts +3 -3
  37. package/types/index.d.ts +16 -14
  38. package/types/listener.d.ts +9 -0
  39. package/types/nanoid.d.ts +1 -1
  40. package/types/runtime.d.ts +18 -26
  41. package/types/screens.d.ts +42 -76
  42. package/types/system.d.ts +50 -79
  43. package/types/utils.d.ts +15 -8
  44. package/types/window.d.ts +110 -225
  45. package/types/wml.d.ts +2 -6
  46. package/docs/.nojekyll +0 -1
  47. package/docs/assets/highlight.css +0 -22
  48. package/docs/assets/icons.js +0 -15
  49. package/docs/assets/icons.svg +0 -1
  50. package/docs/assets/main.js +0 -59
  51. package/docs/assets/navigation.js +0 -1
  52. package/docs/assets/search.js +0 -1
  53. package/docs/assets/style.css +0 -1415
  54. package/docs/classes/Call.RuntimeError.html +0 -11
  55. package/docs/classes/Events.WailsEvent.html +0 -4
  56. package/docs/functions/Application.Hide.html +0 -2
  57. package/docs/functions/Application.Quit.html +0 -2
  58. package/docs/functions/Application.Show.html +0 -2
  59. package/docs/functions/Browser.OpenURL.html +0 -3
  60. package/docs/functions/Call.ByID.html +0 -8
  61. package/docs/functions/Call.ByName.html +0 -6
  62. package/docs/functions/Call.Call.html +0 -11
  63. package/docs/functions/Clipboard.SetText.html +0 -6
  64. package/docs/functions/Clipboard.Text.html +0 -3
  65. package/docs/functions/Create.Any.html +0 -2
  66. package/docs/functions/Create.Array.html +0 -4
  67. package/docs/functions/Create.ByteSlice.html +0 -3
  68. package/docs/functions/Create.Map.html +0 -4
  69. package/docs/functions/Create.Nullable.html +0 -3
  70. package/docs/functions/Create.Struct.html +0 -3
  71. package/docs/functions/Dialogs.Error.html +0 -5
  72. package/docs/functions/Dialogs.Info.html +0 -5
  73. package/docs/functions/Dialogs.OpenFile.html +0 -3
  74. package/docs/functions/Dialogs.Question.html +0 -5
  75. package/docs/functions/Dialogs.SaveFile.html +0 -3
  76. package/docs/functions/Dialogs.Warning.html +0 -5
  77. package/docs/functions/Events.Emit.html +0 -6
  78. package/docs/functions/Events.Off.html +0 -4
  79. package/docs/functions/Events.OffAll.html +0 -3
  80. package/docs/functions/Events.On.html +0 -7
  81. package/docs/functions/Events.OnMultiple.html +0 -8
  82. package/docs/functions/Events.Once.html +0 -7
  83. package/docs/functions/Events.setup.html +0 -1
  84. package/docs/functions/Flags.GetFlag.html +0 -6
  85. package/docs/functions/Screens.GetAll.html +0 -3
  86. package/docs/functions/Screens.GetCurrent.html +0 -3
  87. package/docs/functions/Screens.GetPrimary.html +0 -3
  88. package/docs/functions/System.Capabilities.html +0 -4
  89. package/docs/functions/System.Environment.html +0 -5
  90. package/docs/functions/System.IsAMD64.html +0 -3
  91. package/docs/functions/System.IsARM.html +0 -3
  92. package/docs/functions/System.IsARM64.html +0 -5
  93. package/docs/functions/System.IsDarkMode.html +0 -5
  94. package/docs/functions/System.IsDebug.html +0 -1
  95. package/docs/functions/System.IsLinux.html +0 -3
  96. package/docs/functions/System.IsMac.html +0 -3
  97. package/docs/functions/System.IsWindows.html +0 -3
  98. package/docs/functions/System.invoke.html +0 -1
  99. package/docs/functions/WML.Enable.html +0 -2
  100. package/docs/functions/WML.Reload.html +0 -2
  101. package/docs/functions/init.html +0 -1
  102. package/docs/index.html +0 -5
  103. package/docs/interfaces/Call.CallOptions.html +0 -7
  104. package/docs/interfaces/Dialogs.Button.html +0 -7
  105. package/docs/interfaces/Dialogs.FileFilter.html +0 -5
  106. package/docs/interfaces/Dialogs.MessageDialogOptions.html +0 -9
  107. package/docs/interfaces/Dialogs.OpenFileDialogOptions.html +0 -33
  108. package/docs/interfaces/Dialogs.SaveFileDialogOptions.html +0 -35
  109. package/docs/interfaces/Screens.Rect.html +0 -9
  110. package/docs/interfaces/Screens.Screen.html +0 -25
  111. package/docs/interfaces/Screens.Size.html +0 -5
  112. package/docs/interfaces/System.EnvironmentInfo.html +0 -11
  113. package/docs/interfaces/System.OSInfo.html +0 -9
  114. package/docs/modules/Application.html +0 -4
  115. package/docs/modules/Browser.html +0 -2
  116. package/docs/modules/Call.html +0 -6
  117. package/docs/modules/Clipboard.html +0 -3
  118. package/docs/modules/Create.html +0 -7
  119. package/docs/modules/Dialogs.html +0 -12
  120. package/docs/modules/Events.html +0 -10
  121. package/docs/modules/Flags.html +0 -2
  122. package/docs/modules/Screens.html +0 -7
  123. package/docs/modules/System.html +0 -14
  124. package/docs/modules/WML.html +0 -3
  125. package/docs/modules.html +0 -14
  126. package/docs/variables/Events.Types.html +0 -1
  127. package/docs/variables/Window.html +0 -2
  128. package/src/browser.js +0 -24
  129. package/src/calls.js +0 -221
  130. package/src/clipboard.js +0 -35
  131. package/src/contextmenu.js +0 -97
  132. package/src/dialogs.js +0 -200
  133. package/src/drag.js +0 -119
  134. package/src/event_types.js +0 -219
  135. package/src/events.js +0 -140
  136. package/src/flags.js +0 -25
  137. package/src/index.js +0 -60
  138. package/src/runtime.js +0 -92
  139. package/src/screens.js +0 -71
  140. package/src/system.js +0 -143
  141. package/src/window.js +0 -638
  142. package/tsconfig.json +0 -20
package/src/system.js DELETED
@@ -1,143 +0,0 @@
1
- /*
2
- _ __ _ __
3
- | | / /___ _(_) /____
4
- | | /| / / __ `/ / / ___/
5
- | |/ |/ / /_/ / / (__ )
6
- |__/|__/\__,_/_/_/____/
7
- The electron alternative for Go
8
- (c) Lea Anthony 2019-present
9
- */
10
-
11
- /* jshint esversion: 9 */
12
-
13
- import {newRuntimeCallerWithID, objectNames} from "./runtime";
14
- let call = newRuntimeCallerWithID(objectNames.System, '');
15
- const systemIsDarkMode = 0;
16
- const environment = 1;
17
-
18
- const _invoke = (() => {
19
- try {
20
- if(window?.chrome?.webview) {
21
- return (msg) => window.chrome.webview.postMessage(msg);
22
- }
23
- if(window?.webkit?.messageHandlers?.external) {
24
- return (msg) => window.webkit.messageHandlers.external.postMessage(msg);
25
- }
26
- } catch(e) {
27
- console.warn('\n%c⚠️ Browser Environment Detected %c\n\n%cOnly UI previews are available in the browser. For full functionality, please run the application in desktop mode.\nMore information at: https://v3.wails.io/learn/build/#using-a-browser-for-development\n',
28
- 'background: #ffffff; color: #000000; font-weight: bold; padding: 4px 8px; border-radius: 4px; border: 2px solid #000000;',
29
- 'background: transparent;',
30
- 'color: #ffffff; font-style: italic; font-weight: bold;');
31
- }
32
- return null;
33
- })();
34
-
35
- export function invoke(msg) {
36
- if (!_invoke) return;
37
- return _invoke(msg);
38
- }
39
-
40
- /**
41
- * @function
42
- * Retrieves the system dark mode status.
43
- * @returns {Promise<boolean>} - A promise that resolves to a boolean value indicating if the system is in dark mode.
44
- */
45
- export function IsDarkMode() {
46
- return call(systemIsDarkMode);
47
- }
48
-
49
- /**
50
- * Fetches the capabilities of the application from the server.
51
- *
52
- * @async
53
- * @function Capabilities
54
- * @returns {Promise<Object>} A promise that resolves to an object containing the capabilities.
55
- */
56
- export function Capabilities() {
57
- let response = fetch("/wails/capabilities");
58
- return response.json();
59
- }
60
-
61
- /**
62
- * @typedef {Object} OSInfo
63
- * @property {string} Branding - The branding of the OS.
64
- * @property {string} ID - The ID of the OS.
65
- * @property {string} Name - The name of the OS.
66
- * @property {string} Version - The version of the OS.
67
- */
68
-
69
- /**
70
- * @typedef {Object} EnvironmentInfo
71
- * @property {string} Arch - The architecture of the system.
72
- * @property {boolean} Debug - True if the application is running in debug mode, otherwise false.
73
- * @property {string} OS - The operating system in use.
74
- * @property {OSInfo} OSInfo - Details of the operating system.
75
- * @property {Object} PlatformInfo - Additional platform information.
76
- */
77
-
78
- /**
79
- * @function
80
- * Retrieves environment details.
81
- * @returns {Promise<EnvironmentInfo>} - A promise that resolves to an object containing OS and system architecture.
82
- */
83
- export function Environment() {
84
- return call(environment);
85
- }
86
-
87
- /**
88
- * Checks if the current operating system is Windows.
89
- *
90
- * @return {boolean} True if the operating system is Windows, otherwise false.
91
- */
92
- export function IsWindows() {
93
- return window._wails.environment.OS === "windows";
94
- }
95
-
96
- /**
97
- * Checks if the current operating system is Linux.
98
- *
99
- * @returns {boolean} Returns true if the current operating system is Linux, false otherwise.
100
- */
101
- export function IsLinux() {
102
- return window._wails.environment.OS === "linux";
103
- }
104
-
105
- /**
106
- * Checks if the current environment is a macOS operating system.
107
- *
108
- * @returns {boolean} True if the environment is macOS, false otherwise.
109
- */
110
- export function IsMac() {
111
- return window._wails.environment.OS === "darwin";
112
- }
113
-
114
- /**
115
- * Checks if the current environment architecture is AMD64.
116
- * @returns {boolean} True if the current environment architecture is AMD64, false otherwise.
117
- */
118
- export function IsAMD64() {
119
- return window._wails.environment.Arch === "amd64";
120
- }
121
-
122
- /**
123
- * Checks if the current architecture is ARM.
124
- *
125
- * @returns {boolean} True if the current architecture is ARM, false otherwise.
126
- */
127
- export function IsARM() {
128
- return window._wails.environment.Arch === "arm";
129
- }
130
-
131
- /**
132
- * Checks if the current environment is ARM64 architecture.
133
- *
134
- * @returns {boolean} - Returns true if the environment is ARM64 architecture, otherwise returns false.
135
- */
136
- export function IsARM64() {
137
- return window._wails.environment.Arch === "arm64";
138
- }
139
-
140
- export function IsDebug() {
141
- return window._wails.environment.Debug === true;
142
- }
143
-