runtime.js 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. /*
  2. _ __ _ __
  3. | | / /___ _(_) /____
  4. | | /| / / __ `/ / / ___/
  5. | |/ |/ / /_/ / / (__ )
  6. |__/|__/\__,_/_/_/____/
  7. The electron alternative for Go
  8. (c) Lea Anthony 2019-present
  9. */
  10. export function LogPrint(message) {
  11. window.runtime.LogPrint(message);
  12. }
  13. export function LogTrace(message) {
  14. window.runtime.LogTrace(message);
  15. }
  16. export function LogDebug(message) {
  17. window.runtime.LogDebug(message);
  18. }
  19. export function LogInfo(message) {
  20. window.runtime.LogInfo(message);
  21. }
  22. export function LogWarning(message) {
  23. window.runtime.LogWarning(message);
  24. }
  25. export function LogError(message) {
  26. window.runtime.LogError(message);
  27. }
  28. export function LogFatal(message) {
  29. window.runtime.LogFatal(message);
  30. }
  31. export function EventsOnMultiple(eventName, callback, maxCallbacks) {
  32. return window.runtime.EventsOnMultiple(eventName, callback, maxCallbacks);
  33. }
  34. export function EventsOn(eventName, callback) {
  35. return EventsOnMultiple(eventName, callback, -1);
  36. }
  37. export function EventsOff(eventName, ...additionalEventNames) {
  38. return window.runtime.EventsOff(eventName, ...additionalEventNames);
  39. }
  40. export function EventsOnce(eventName, callback) {
  41. return EventsOnMultiple(eventName, callback, 1);
  42. }
  43. export function EventsEmit(eventName) {
  44. let args = [eventName].slice.call(arguments);
  45. return window.runtime.EventsEmit.apply(null, args);
  46. }
  47. export function WindowReload() {
  48. window.runtime.WindowReload();
  49. }
  50. export function WindowReloadApp() {
  51. window.runtime.WindowReloadApp();
  52. }
  53. export function WindowSetAlwaysOnTop(b) {
  54. window.runtime.WindowSetAlwaysOnTop(b);
  55. }
  56. export function WindowSetSystemDefaultTheme() {
  57. window.runtime.WindowSetSystemDefaultTheme();
  58. }
  59. export function WindowSetLightTheme() {
  60. window.runtime.WindowSetLightTheme();
  61. }
  62. export function WindowSetDarkTheme() {
  63. window.runtime.WindowSetDarkTheme();
  64. }
  65. export function WindowCenter() {
  66. window.runtime.WindowCenter();
  67. }
  68. export function WindowSetTitle(title) {
  69. window.runtime.WindowSetTitle(title);
  70. }
  71. export function WindowFullscreen() {
  72. window.runtime.WindowFullscreen();
  73. }
  74. export function WindowUnfullscreen() {
  75. window.runtime.WindowUnfullscreen();
  76. }
  77. export function WindowIsFullscreen() {
  78. return window.runtime.WindowIsFullscreen();
  79. }
  80. export function WindowGetSize() {
  81. return window.runtime.WindowGetSize();
  82. }
  83. export function WindowSetSize(width, height) {
  84. window.runtime.WindowSetSize(width, height);
  85. }
  86. export function WindowSetMaxSize(width, height) {
  87. window.runtime.WindowSetMaxSize(width, height);
  88. }
  89. export function WindowSetMinSize(width, height) {
  90. window.runtime.WindowSetMinSize(width, height);
  91. }
  92. export function WindowSetPosition(x, y) {
  93. window.runtime.WindowSetPosition(x, y);
  94. }
  95. export function WindowGetPosition() {
  96. return window.runtime.WindowGetPosition();
  97. }
  98. export function WindowHide() {
  99. window.runtime.WindowHide();
  100. }
  101. export function WindowShow() {
  102. window.runtime.WindowShow();
  103. }
  104. export function WindowMaximise() {
  105. window.runtime.WindowMaximise();
  106. }
  107. export function WindowToggleMaximise() {
  108. window.runtime.WindowToggleMaximise();
  109. }
  110. export function WindowUnmaximise() {
  111. window.runtime.WindowUnmaximise();
  112. }
  113. export function WindowIsMaximised() {
  114. return window.runtime.WindowIsMaximised();
  115. }
  116. export function WindowMinimise() {
  117. window.runtime.WindowMinimise();
  118. }
  119. export function WindowUnminimise() {
  120. window.runtime.WindowUnminimise();
  121. }
  122. export function WindowSetBackgroundColour(R, G, B, A) {
  123. window.runtime.WindowSetBackgroundColour(R, G, B, A);
  124. }
  125. export function ScreenGetAll() {
  126. return window.runtime.ScreenGetAll();
  127. }
  128. export function WindowIsMinimised() {
  129. return window.runtime.WindowIsMinimised();
  130. }
  131. export function WindowIsNormal() {
  132. return window.runtime.WindowIsNormal();
  133. }
  134. export function BrowserOpenURL(url) {
  135. window.runtime.BrowserOpenURL(url);
  136. }
  137. export function Environment() {
  138. return window.runtime.Environment();
  139. }
  140. export function Quit() {
  141. window.runtime.Quit();
  142. }
  143. export function Hide() {
  144. window.runtime.Hide();
  145. }
  146. export function Show() {
  147. window.runtime.Show();
  148. }
  149. export function ClipboardGetText() {
  150. return window.runtime.ClipboardGetText();
  151. }
  152. export function ClipboardSetText(text) {
  153. return window.runtime.ClipboardSetText(text);
  154. }