clone

a desktop tv and program guide for over-the-air broadcasts: what's on air, what your tuner gets, live tv, recordings

main
airwaves / frontend / wailsjs / runtime / runtime.js
runtime.js 7.0K
1/*2 _ __ _ __3| | / /___ _(_) /____4| | /| / / __ `/ / / ___/5| |/ |/ / /_/ / / (__ )6|__/|__/\__,_/_/_/____/7The electron alternative for Go8(c) Lea Anthony 2019-present9*/1011export function LogPrint(message) {12 window.runtime.LogPrint(message);13}1415export function LogTrace(message) {16 window.runtime.LogTrace(message);17}1819export function LogDebug(message) {20 window.runtime.LogDebug(message);21}2223export function LogInfo(message) {24 window.runtime.LogInfo(message);25}2627export function LogWarning(message) {28 window.runtime.LogWarning(message);29}3031export function LogError(message) {32 window.runtime.LogError(message);33}3435export function LogFatal(message) {36 window.runtime.LogFatal(message);37}3839export function EventsOnMultiple(eventName, callback, maxCallbacks) {40 return window.runtime.EventsOnMultiple(eventName, callback, maxCallbacks);41}4243export function EventsOn(eventName, callback) {44 return EventsOnMultiple(eventName, callback, -1);45}4647export function EventsOff(eventName, ...additionalEventNames) {48 return window.runtime.EventsOff(eventName, ...additionalEventNames);49}5051export function EventsOffAll() {52 return window.runtime.EventsOffAll();53}5455export function EventsOnce(eventName, callback) {56 return EventsOnMultiple(eventName, callback, 1);57}5859export function EventsEmit(eventName) {60 let args = [eventName].slice.call(arguments);61 return window.runtime.EventsEmit.apply(null, args);62}6364export function WindowReload() {65 window.runtime.WindowReload();66}6768export function WindowReloadApp() {69 window.runtime.WindowReloadApp();70}7172export function WindowSetAlwaysOnTop(b) {73 window.runtime.WindowSetAlwaysOnTop(b);74}7576export function WindowSetSystemDefaultTheme() {77 window.runtime.WindowSetSystemDefaultTheme();78}7980export function WindowSetLightTheme() {81 window.runtime.WindowSetLightTheme();82}8384export function WindowSetDarkTheme() {85 window.runtime.WindowSetDarkTheme();86}8788export function WindowCenter() {89 window.runtime.WindowCenter();90}9192export function WindowSetTitle(title) {93 window.runtime.WindowSetTitle(title);94}9596export function WindowFullscreen() {97 window.runtime.WindowFullscreen();98}99100export function WindowUnfullscreen() {101 window.runtime.WindowUnfullscreen();102}103104export function WindowIsFullscreen() {105 return window.runtime.WindowIsFullscreen();106}107108export function WindowGetSize() {109 return window.runtime.WindowGetSize();110}111112export function WindowSetSize(width, height) {113 window.runtime.WindowSetSize(width, height);114}115116export function WindowSetMaxSize(width, height) {117 window.runtime.WindowSetMaxSize(width, height);118}119120export function WindowSetMinSize(width, height) {121 window.runtime.WindowSetMinSize(width, height);122}123124export function WindowSetPosition(x, y) {125 window.runtime.WindowSetPosition(x, y);126}127128export function WindowGetPosition() {129 return window.runtime.WindowGetPosition();130}131132export function WindowHide() {133 window.runtime.WindowHide();134}135136export function WindowShow() {137 window.runtime.WindowShow();138}139140export function WindowMaximise() {141 window.runtime.WindowMaximise();142}143144export function WindowToggleMaximise() {145 window.runtime.WindowToggleMaximise();146}147148export function WindowUnmaximise() {149 window.runtime.WindowUnmaximise();150}151152export function WindowIsMaximised() {153 return window.runtime.WindowIsMaximised();154}155156export function WindowMinimise() {157 window.runtime.WindowMinimise();158}159160export function WindowUnminimise() {161 window.runtime.WindowUnminimise();162}163164export function WindowSetBackgroundColour(R, G, B, A) {165 window.runtime.WindowSetBackgroundColour(R, G, B, A);166}167168export function ScreenGetAll() {169 return window.runtime.ScreenGetAll();170}171172export function WindowIsMinimised() {173 return window.runtime.WindowIsMinimised();174}175176export function WindowIsNormal() {177 return window.runtime.WindowIsNormal();178}179180export function BrowserOpenURL(url) {181 window.runtime.BrowserOpenURL(url);182}183184export function Environment() {185 return window.runtime.Environment();186}187188export function Quit() {189 window.runtime.Quit();190}191192export function Hide() {193 window.runtime.Hide();194}195196export function Show() {197 window.runtime.Show();198}199200export function ClipboardGetText() {201 return window.runtime.ClipboardGetText();202}203204export function ClipboardSetText(text) {205 return window.runtime.ClipboardSetText(text);206}207208/**209 * Callback for OnFileDrop returns a slice of file path strings when a drop is finished.210 *211 * @export212 * @callback OnFileDropCallback213 * @param {number} x - x coordinate of the drop214 * @param {number} y - y coordinate of the drop215 * @param {string[]} paths - A list of file paths.216 */217218/**219 * OnFileDrop listens to drag and drop events and calls the callback with the coordinates of the drop and an array of path strings.220 *221 * @export222 * @param {OnFileDropCallback} callback - Callback for OnFileDrop returns a slice of file path strings when a drop is finished.223 * @param {boolean} [useDropTarget=true] - Only call the callback when the drop finished on an element that has the drop target style. (--wails-drop-target)224 */225export function OnFileDrop(callback, useDropTarget) {226 return window.runtime.OnFileDrop(callback, useDropTarget);227}228229/**230 * OnFileDropOff removes the drag and drop listeners and handlers.231 */232export function OnFileDropOff() {233 return window.runtime.OnFileDropOff();234}235236export function CanResolveFilePaths() {237 return window.runtime.CanResolveFilePaths();238}239240export function ResolveFilePaths(files) {241 return window.runtime.ResolveFilePaths(files);242}243244export function InitializeNotifications() {245 return window.runtime.InitializeNotifications();246}247248export function CleanupNotifications() {249 return window.runtime.CleanupNotifications();250}251252export function IsNotificationAvailable() {253 return window.runtime.IsNotificationAvailable();254}255256export function RequestNotificationAuthorization() {257 return window.runtime.RequestNotificationAuthorization();258}259260export function CheckNotificationAuthorization() {261 return window.runtime.CheckNotificationAuthorization();262}263264export function SendNotification(options) {265 return window.runtime.SendNotification(options);266}267268export function SendNotificationWithActions(options) {269 return window.runtime.SendNotificationWithActions(options);270}271272export function RegisterNotificationCategory(category) {273 return window.runtime.RegisterNotificationCategory(category);274}275276export function RemoveNotificationCategory(categoryId) {277 return window.runtime.RemoveNotificationCategory(categoryId);278}279280export function RemoveAllPendingNotifications() {281 return window.runtime.RemoveAllPendingNotifications();282}283284export function RemovePendingNotification(identifier) {285 return window.runtime.RemovePendingNotification(identifier);286}287288export function RemoveAllDeliveredNotifications() {289 return window.runtime.RemoveAllDeliveredNotifications();290}291292export function RemoveDeliveredNotification(identifier) {293 return window.runtime.RemoveDeliveredNotification(identifier);294}295296export function RemoveNotification(identifier) {297 return window.runtime.RemoveNotification(identifier);298}