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.d.ts
runtime.d.ts 14.9K
1/*2 _ __ _ __3| | / /___ _(_) /____4| | /| / / __ `/ / / ___/5| |/ |/ / /_/ / / (__ )6|__/|__/\__,_/_/_/____/7The electron alternative for Go8(c) Lea Anthony 2019-present9*/1011export interface Position {12 x: number;13 y: number;14}1516export interface Size {17 w: number;18 h: number;19}2021export interface Screen {22 isCurrent: boolean;23 isPrimary: boolean;24 width : number25 height : number26}2728// Environment information such as platform, buildtype, ...29export interface EnvironmentInfo {30 buildType: string;31 platform: string;32 arch: string;33}3435// [EventsEmit](https://wails.io/docs/reference/runtime/events#eventsemit)36// emits the given event. Optional data may be passed with the event.37// This will trigger any event listeners.38export function EventsEmit(eventName: string, ...data: any): void;3940// [EventsOn](https://wails.io/docs/reference/runtime/events#eventson) sets up a listener for the given event name.41export function EventsOn(eventName: string, callback: (...data: any) => void): () => void;4243// [EventsOnMultiple](https://wails.io/docs/reference/runtime/events#eventsonmultiple)44// sets up a listener for the given event name, but will only trigger a given number times.45export function EventsOnMultiple(eventName: string, callback: (...data: any) => void, maxCallbacks: number): () => void;4647// [EventsOnce](https://wails.io/docs/reference/runtime/events#eventsonce)48// sets up a listener for the given event name, but will only trigger once.49export function EventsOnce(eventName: string, callback: (...data: any) => void): () => void;5051// [EventsOff](https://wails.io/docs/reference/runtime/events#eventsoff)52// unregisters the listener for the given event name.53export function EventsOff(eventName: string, ...additionalEventNames: string[]): void;5455// [EventsOffAll](https://wails.io/docs/reference/runtime/events#eventsoffall)56// unregisters all listeners.57export function EventsOffAll(): void;5859// [LogPrint](https://wails.io/docs/reference/runtime/log#logprint)60// logs the given message as a raw message61export function LogPrint(message: string): void;6263// [LogTrace](https://wails.io/docs/reference/runtime/log#logtrace)64// logs the given message at the `trace` log level.65export function LogTrace(message: string): void;6667// [LogDebug](https://wails.io/docs/reference/runtime/log#logdebug)68// logs the given message at the `debug` log level.69export function LogDebug(message: string): void;7071// [LogError](https://wails.io/docs/reference/runtime/log#logerror)72// logs the given message at the `error` log level.73export function LogError(message: string): void;7475// [LogFatal](https://wails.io/docs/reference/runtime/log#logfatal)76// logs the given message at the `fatal` log level.77// The application will quit after calling this method.78export function LogFatal(message: string): void;7980// [LogInfo](https://wails.io/docs/reference/runtime/log#loginfo)81// logs the given message at the `info` log level.82export function LogInfo(message: string): void;8384// [LogWarning](https://wails.io/docs/reference/runtime/log#logwarning)85// logs the given message at the `warning` log level.86export function LogWarning(message: string): void;8788// [WindowReload](https://wails.io/docs/reference/runtime/window#windowreload)89// Forces a reload by the main application as well as connected browsers.90export function WindowReload(): void;9192// [WindowReloadApp](https://wails.io/docs/reference/runtime/window#windowreloadapp)93// Reloads the application frontend.94export function WindowReloadApp(): void;9596// [WindowSetAlwaysOnTop](https://wails.io/docs/reference/runtime/window#windowsetalwaysontop)97// Sets the window AlwaysOnTop or not on top.98export function WindowSetAlwaysOnTop(b: boolean): void;99100// [WindowSetSystemDefaultTheme](https://wails.io/docs/next/reference/runtime/window#windowsetsystemdefaulttheme)101// *Windows only*102// Sets window theme to system default (dark/light).103export function WindowSetSystemDefaultTheme(): void;104105// [WindowSetLightTheme](https://wails.io/docs/next/reference/runtime/window#windowsetlighttheme)106// *Windows only*107// Sets window to light theme.108export function WindowSetLightTheme(): void;109110// [WindowSetDarkTheme](https://wails.io/docs/next/reference/runtime/window#windowsetdarktheme)111// *Windows only*112// Sets window to dark theme.113export function WindowSetDarkTheme(): void;114115// [WindowCenter](https://wails.io/docs/reference/runtime/window#windowcenter)116// Centers the window on the monitor the window is currently on.117export function WindowCenter(): void;118119// [WindowSetTitle](https://wails.io/docs/reference/runtime/window#windowsettitle)120// Sets the text in the window title bar.121export function WindowSetTitle(title: string): void;122123// [WindowFullscreen](https://wails.io/docs/reference/runtime/window#windowfullscreen)124// Makes the window full screen.125export function WindowFullscreen(): void;126127// [WindowUnfullscreen](https://wails.io/docs/reference/runtime/window#windowunfullscreen)128// Restores the previous window dimensions and position prior to full screen.129export function WindowUnfullscreen(): void;130131// [WindowIsFullscreen](https://wails.io/docs/reference/runtime/window#windowisfullscreen)132// Returns the state of the window, i.e. whether the window is in full screen mode or not.133export function WindowIsFullscreen(): Promise<boolean>;134135// [WindowSetSize](https://wails.io/docs/reference/runtime/window#windowsetsize)136// Sets the width and height of the window.137export function WindowSetSize(width: number, height: number): void;138139// [WindowGetSize](https://wails.io/docs/reference/runtime/window#windowgetsize)140// Gets the width and height of the window.141export function WindowGetSize(): Promise<Size>;142143// [WindowSetMaxSize](https://wails.io/docs/reference/runtime/window#windowsetmaxsize)144// Sets the maximum window size. Will resize the window if the window is currently larger than the given dimensions.145// Setting a size of 0,0 will disable this constraint.146export function WindowSetMaxSize(width: number, height: number): void;147148// [WindowSetMinSize](https://wails.io/docs/reference/runtime/window#windowsetminsize)149// Sets the minimum window size. Will resize the window if the window is currently smaller than the given dimensions.150// Setting a size of 0,0 will disable this constraint.151export function WindowSetMinSize(width: number, height: number): void;152153// [WindowSetPosition](https://wails.io/docs/reference/runtime/window#windowsetposition)154// Sets the window position relative to the monitor the window is currently on.155export function WindowSetPosition(x: number, y: number): void;156157// [WindowGetPosition](https://wails.io/docs/reference/runtime/window#windowgetposition)158// Gets the window position relative to the monitor the window is currently on.159export function WindowGetPosition(): Promise<Position>;160161// [WindowHide](https://wails.io/docs/reference/runtime/window#windowhide)162// Hides the window.163export function WindowHide(): void;164165// [WindowShow](https://wails.io/docs/reference/runtime/window#windowshow)166// Shows the window, if it is currently hidden.167export function WindowShow(): void;168169// [WindowMaximise](https://wails.io/docs/reference/runtime/window#windowmaximise)170// Maximises the window to fill the screen.171export function WindowMaximise(): void;172173// [WindowToggleMaximise](https://wails.io/docs/reference/runtime/window#windowtogglemaximise)174// Toggles between Maximised and UnMaximised.175export function WindowToggleMaximise(): void;176177// [WindowUnmaximise](https://wails.io/docs/reference/runtime/window#windowunmaximise)178// Restores the window to the dimensions and position prior to maximising.179export function WindowUnmaximise(): void;180181// [WindowIsMaximised](https://wails.io/docs/reference/runtime/window#windowismaximised)182// Returns the state of the window, i.e. whether the window is maximised or not.183export function WindowIsMaximised(): Promise<boolean>;184185// [WindowMinimise](https://wails.io/docs/reference/runtime/window#windowminimise)186// Minimises the window.187export function WindowMinimise(): void;188189// [WindowUnminimise](https://wails.io/docs/reference/runtime/window#windowunminimise)190// Restores the window to the dimensions and position prior to minimising.191export function WindowUnminimise(): void;192193// [WindowIsMinimised](https://wails.io/docs/reference/runtime/window#windowisminimised)194// Returns the state of the window, i.e. whether the window is minimised or not.195export function WindowIsMinimised(): Promise<boolean>;196197// [WindowIsNormal](https://wails.io/docs/reference/runtime/window#windowisnormal)198// Returns the state of the window, i.e. whether the window is normal or not.199export function WindowIsNormal(): Promise<boolean>;200201// [WindowSetBackgroundColour](https://wails.io/docs/reference/runtime/window#windowsetbackgroundcolour)202// Sets the background colour of the window to the given RGBA colour definition. This colour will show through for all transparent pixels.203export function WindowSetBackgroundColour(R: number, G: number, B: number, A: number): void;204205// [ScreenGetAll](https://wails.io/docs/reference/runtime/window#screengetall)206// Gets the all screens. Call this anew each time you want to refresh data from the underlying windowing system.207export function ScreenGetAll(): Promise<Screen[]>;208209// [BrowserOpenURL](https://wails.io/docs/reference/runtime/browser#browseropenurl)210// Opens the given URL in the system browser.211export function BrowserOpenURL(url: string): void;212213// [Environment](https://wails.io/docs/reference/runtime/intro#environment)214// Returns information about the environment215export function Environment(): Promise<EnvironmentInfo>;216217// [Quit](https://wails.io/docs/reference/runtime/intro#quit)218// Quits the application.219export function Quit(): void;220221// [Hide](https://wails.io/docs/reference/runtime/intro#hide)222// Hides the application.223export function Hide(): void;224225// [Show](https://wails.io/docs/reference/runtime/intro#show)226// Shows the application.227export function Show(): void;228229// [ClipboardGetText](https://wails.io/docs/reference/runtime/clipboard#clipboardgettext)230// Returns the current text stored on clipboard231export function ClipboardGetText(): Promise<string>;232233// [ClipboardSetText](https://wails.io/docs/reference/runtime/clipboard#clipboardsettext)234// Sets a text on the clipboard235export function ClipboardSetText(text: string): Promise<boolean>;236237// [OnFileDrop](https://wails.io/docs/reference/runtime/draganddrop#onfiledrop)238// OnFileDrop listens to drag and drop events and calls the callback with the coordinates of the drop and an array of path strings.239export function OnFileDrop(callback: (x: number, y: number ,paths: string[]) => void, useDropTarget: boolean) :void240241// [OnFileDropOff](https://wails.io/docs/reference/runtime/draganddrop#dragandddropoff)242// OnFileDropOff removes the drag and drop listeners and handlers.243export function OnFileDropOff() :void244245// Check if the file path resolver is available246export function CanResolveFilePaths(): boolean;247248// Resolves file paths for an array of files249export function ResolveFilePaths(files: File[]): void250251// Notification types252export interface NotificationOptions {253 id: string;254 title: string;255 subtitle?: string; // macOS and Linux only256 body?: string;257 categoryId?: string;258 data?: { [key: string]: any };259}260261export interface NotificationAction {262 id?: string;263 title?: string;264 destructive?: boolean; // macOS-specific265}266267export interface NotificationCategory {268 id?: string;269 actions?: NotificationAction[];270 hasReplyField?: boolean;271 replyPlaceholder?: string;272 replyButtonTitle?: string;273}274275// [InitializeNotifications](https://wails.io/docs/reference/runtime/notification#initializenotifications)276// Initializes the notification service for the application.277// This must be called before sending any notifications.278export function InitializeNotifications(): Promise<void>;279280// [CleanupNotifications](https://wails.io/docs/reference/runtime/notification#cleanupnotifications)281// Cleans up notification resources and releases any held connections.282export function CleanupNotifications(): Promise<void>;283284// [IsNotificationAvailable](https://wails.io/docs/reference/runtime/notification#isnotificationavailable)285// Checks if notifications are available on the current platform.286export function IsNotificationAvailable(): Promise<boolean>;287288// [RequestNotificationAuthorization](https://wails.io/docs/reference/runtime/notification#requestnotificationauthorization)289// Requests notification authorization from the user (macOS only).290export function RequestNotificationAuthorization(): Promise<boolean>;291292// [CheckNotificationAuthorization](https://wails.io/docs/reference/runtime/notification#checknotificationauthorization)293// Checks the current notification authorization status (macOS only).294export function CheckNotificationAuthorization(): Promise<boolean>;295296// [SendNotification](https://wails.io/docs/reference/runtime/notification#sendnotification)297// Sends a basic notification with the given options.298export function SendNotification(options: NotificationOptions): Promise<void>;299300// [SendNotificationWithActions](https://wails.io/docs/reference/runtime/notification#sendnotificationwithactions)301// Sends a notification with action buttons. Requires a registered category.302export function SendNotificationWithActions(options: NotificationOptions): Promise<void>;303304// [RegisterNotificationCategory](https://wails.io/docs/reference/runtime/notification#registernotificationcategory)305// Registers a notification category that can be used with SendNotificationWithActions.306export function RegisterNotificationCategory(category: NotificationCategory): Promise<void>;307308// [RemoveNotificationCategory](https://wails.io/docs/reference/runtime/notification#removenotificationcategory)309// Removes a previously registered notification category.310export function RemoveNotificationCategory(categoryId: string): Promise<void>;311312// [RemoveAllPendingNotifications](https://wails.io/docs/reference/runtime/notification#removeallpendingnotifications)313// Removes all pending notifications from the notification center.314export function RemoveAllPendingNotifications(): Promise<void>;315316// [RemovePendingNotification](https://wails.io/docs/reference/runtime/notification#removependingnotification)317// Removes a specific pending notification by its identifier.318export function RemovePendingNotification(identifier: string): Promise<void>;319320// [RemoveAllDeliveredNotifications](https://wails.io/docs/reference/runtime/notification#removealldeliverednotifications)321// Removes all delivered notifications from the notification center.322export function RemoveAllDeliveredNotifications(): Promise<void>;323324// [RemoveDeliveredNotification](https://wails.io/docs/reference/runtime/notification#removedeliverednotification)325// Removes a specific delivered notification by its identifier.326export function RemoveDeliveredNotification(identifier: string): Promise<void>;327328// [RemoveNotification](https://wails.io/docs/reference/runtime/notification#removenotification)329// Removes a notification by its identifier (cross-platform convenience function).330export function RemoveNotification(identifier: string): Promise<void>;