// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT

/**
 * Service manages windowing, dialogs, and other visual elements.
 * It is the primary interface for interacting with the UI.
 * @module
 */

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import { Call as $Call, CancellablePromise as $CancellablePromise, Create as $Create } from "@wailsio/runtime";

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import * as core$0 from "../core/models.js";
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import * as application$0 from "../../../../wailsapp/wails/v3/pkg/application/models.js";
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import * as notifications$0 from "../../../../wailsapp/wails/v3/pkg/services/notifications/models.js";

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import * as $models from "./models.js";

/**
 * ApplyWorkflowLayout applies a predefined layout for a specific workflow.
 */
export function ApplyWorkflowLayout(workflow: $models.WorkflowType): $CancellablePromise<void> {
    return $Call.ByID(476043825, workflow);
}

/**
 * CheckNotificationPermission checks if notifications are authorized.
 */
export function CheckNotificationPermission(): $CancellablePromise<boolean> {
    return $Call.ByID(3457032254);
}

/**
 * ClearClipboard clears the clipboard by setting empty text.
 */
export function ClearClipboard(): $CancellablePromise<void> {
    return $Call.ByID(841655875);
}

/**
 * CloseWindow closes a window by name.
 */
export function CloseWindow(name: string): $CancellablePromise<void> {
    return $Call.ByID(3433483506, name);
}

/**
 * Config returns the registered Config service from the core application.
 * This is a convenience method for accessing the application's configuration.
 */
export function Config(): $CancellablePromise<core$0.Config> {
    return $Call.ByID(2232242108);
}

/**
 * ConfirmDialog shows a confirmation dialog and returns the user's choice.
 */
export function ConfirmDialog(title: string, message: string): $CancellablePromise<boolean> {
    return $Call.ByID(3496660522, title, message);
}

/**
 * Core returns the central core instance, providing access to all registered services.
 */
export function Core(): $CancellablePromise<core$0.Core | null> {
    return $Call.ByID(1945729093).then(($result: any) => {
        return $$createType1($result);
    });
}

/**
 * CreateWindow creates a new window with the specified options.
 */
export function CreateWindow(opts: $models.CreateWindowOptions): $CancellablePromise<$models.WindowInfo | null> {
    return $Call.ByID(2268870170, opts).then(($result: any) => {
        return $$createType3($result);
    });
}

/**
 * DeleteLayout removes a saved layout by name.
 */
export function DeleteLayout(name: string): $CancellablePromise<void> {
    return $Call.ByID(431293335, name);
}

/**
 * FocusWindow brings a window to the front.
 */
export function FocusWindow(name: string): $CancellablePromise<void> {
    return $Call.ByID(3679876474, name);
}

/**
 * GetEventManager returns the event manager for WebSocket event subscriptions.
 */
export function GetEventManager(): $CancellablePromise<$models.WSEventManager | null> {
    return $Call.ByID(4088339441).then(($result: any) => {
        return $$createType5($result);
    });
}

/**
 * GetFocusedWindow returns the name of the currently focused window, or empty if none.
 */
export function GetFocusedWindow(): $CancellablePromise<string> {
    return $Call.ByID(4250461515);
}

/**
 * GetLayout returns a specific layout by name.
 */
export function GetLayout(name: string): $CancellablePromise<$models.Layout | null> {
    return $Call.ByID(2300207048, name).then(($result: any) => {
        return $$createType7($result);
    });
}

/**
 * GetPrimaryScreen returns information about the primary screen.
 */
export function GetPrimaryScreen(): $CancellablePromise<$models.ScreenInfo | null> {
    return $Call.ByID(1543157204).then(($result: any) => {
        return $$createType9($result);
    });
}

/**
 * GetSavedWindowStates returns all saved window states.
 */
export function GetSavedWindowStates(): $CancellablePromise<{ [_: string]: $models.WindowState | null }> {
    return $Call.ByID(959704111).then(($result: any) => {
        return $$createType12($result);
    });
}

/**
 * GetScreen returns information about a specific screen by ID.
 */
export function GetScreen(id: string): $CancellablePromise<$models.ScreenInfo | null> {
    return $Call.ByID(461483954, id).then(($result: any) => {
        return $$createType9($result);
    });
}

/**
 * GetScreenAtPoint returns the screen containing a specific point.
 */
export function GetScreenAtPoint(x: number, y: number): $CancellablePromise<$models.ScreenInfo | null> {
    return $Call.ByID(1700073503, x, y).then(($result: any) => {
        return $$createType9($result);
    });
}

/**
 * GetScreenForWindow returns the screen containing a specific window.
 */
export function GetScreenForWindow(name: string): $CancellablePromise<$models.ScreenInfo | null> {
    return $Call.ByID(835390401, name).then(($result: any) => {
        return $$createType9($result);
    });
}

/**
 * GetScreens returns information about all available screens.
 */
export function GetScreens(): $CancellablePromise<$models.ScreenInfo[]> {
    return $Call.ByID(237481171).then(($result: any) => {
        return $$createType13($result);
    });
}

/**
 * GetSystemTheme returns the system's theme preference.
 * This is the same as GetTheme since Wails follows the system theme.
 */
export function GetSystemTheme(): $CancellablePromise<$models.ThemeInfo> {
    return $Call.ByID(3150417360).then(($result: any) => {
        return $$createType14($result);
    });
}

/**
 * GetTheme returns the current application theme.
 */
export function GetTheme(): $CancellablePromise<$models.ThemeInfo> {
    return $Call.ByID(4073748231).then(($result: any) => {
        return $$createType14($result);
    });
}

/**
 * GetTrayInfo returns information about the current tray state.
 */
export function GetTrayInfo(): $CancellablePromise<{ [_: string]: any }> {
    return $Call.ByID(3859382794).then(($result: any) => {
        return $$createType15($result);
    });
}

/**
 * GetWindowInfo returns information about a window by name.
 */
export function GetWindowInfo(name: string): $CancellablePromise<$models.WindowInfo | null> {
    return $Call.ByID(349034490, name).then(($result: any) => {
        return $$createType3($result);
    });
}

/**
 * GetWindowTitle returns the title of a window by name.
 * Note: Wails v3 doesn't expose a title getter, so we track it ourselves or return the name.
 */
export function GetWindowTitle(name: string): $CancellablePromise<string> {
    return $Call.ByID(2943922308, name);
}

/**
 * GetWorkAreas returns the usable work area for all screens.
 */
export function GetWorkAreas(): $CancellablePromise<$models.WorkArea[]> {
    return $Call.ByID(2006398407).then(($result: any) => {
        return $$createType17($result);
    });
}

/**
 * HasClipboard checks if the clipboard has content.
 */
export function HasClipboard(): $CancellablePromise<boolean> {
    return $Call.ByID(2739125668);
}

/**
 * ListLayouts returns all saved layout names with metadata.
 */
export function ListLayouts(): $CancellablePromise<$models.LayoutInfo[]> {
    return $Call.ByID(1178398225).then(($result: any) => {
        return $$createType19($result);
    });
}

/**
 * ListWindowInfos returns information about all windows.
 */
export function ListWindowInfos(): $CancellablePromise<$models.WindowInfo[]> {
    return $Call.ByID(1417409467).then(($result: any) => {
        return $$createType20($result);
    });
}

/**
 * MaximizeWindow maximizes a window.
 */
export function MaximizeWindow(name: string): $CancellablePromise<void> {
    return $Call.ByID(3409085844, name);
}

/**
 * MinimizeWindow minimizes a window.
 */
export function MinimizeWindow(name: string): $CancellablePromise<void> {
    return $Call.ByID(282422382, name);
}

/**
 * NewWithOptions creates a new window by applying a series of options.
 */
export function NewWithOptions(...opts: $models.WindowOption[]): $CancellablePromise<application$0.WebviewWindow | null> {
    return $Call.ByID(2933522506, opts).then(($result: any) => {
        return $$createType22($result);
    });
}

/**
 * NewWithStruct creates a new window using the provided options and returns its handle.
 */
export function NewWithStruct(options: $models.Window | null): $CancellablePromise<application$0.WebviewWindow | null> {
    return $Call.ByID(51896165, options).then(($result: any) => {
        return $$createType22($result);
    });
}

/**
 * NewWithURL creates a new default window pointing to the specified URL.
 */
export function NewWithURL(url: string): $CancellablePromise<application$0.WebviewWindow | null> {
    return $Call.ByID(1128847469, url).then(($result: any) => {
        return $$createType22($result);
    });
}

/**
 * OpenDirectoryDialog shows a directory picker.
 */
export function OpenDirectoryDialog(opts: $models.OpenDirectoryOptions): $CancellablePromise<string> {
    return $Call.ByID(2018109069, opts);
}

/**
 * OpenFileDialog shows a file open dialog and returns selected path(s).
 */
export function OpenFileDialog(opts: $models.OpenFileOptions): $CancellablePromise<string[]> {
    return $Call.ByID(1105329884, opts).then(($result: any) => {
        return $$createType23($result);
    });
}

/**
 * OpenSingleFileDialog shows a file open dialog for a single file.
 */
export function OpenSingleFileDialog(opts: $models.OpenFileOptions): $CancellablePromise<string> {
    return $Call.ByID(2818039508, opts);
}

/**
 * OpenWindow creates a new window with the given options. If no options are
 * provided, it will use the default options.
 * 
 * example:
 * 
 * 	err := displayService.OpenWindow(
 * 		display.WithName("my-window"),
 * 		display.WithTitle("My Window"),
 * 		display.WithWidth(800),
 * 		display.WithHeight(600),
 * 	)
 * 	if err != nil {
 * 		log.Fatal(err)
 * 	}
 */
export function OpenWindow(...opts: $models.WindowOption[]): $CancellablePromise<void> {
    return $Call.ByID(1872737238, opts);
}

/**
 * PromptDialog shows an input prompt dialog.
 * Note: Wails v3 doesn't have a native prompt dialog, so this uses a question dialog.
 */
export function PromptDialog(title: string, message: string): $CancellablePromise<[string, boolean]> {
    return $Call.ByID(3860540752, title, message);
}

/**
 * ReadClipboard reads text content from the system clipboard.
 */
export function ReadClipboard(): $CancellablePromise<string> {
    return $Call.ByID(353696084);
}

/**
 * RegisterTrayMenuCallback registers a callback for a tray menu action ID.
 */
export function RegisterTrayMenuCallback(actionID: string, callback: any): $CancellablePromise<void> {
    return $Call.ByID(2238034275, actionID, callback);
}

/**
 * RequestNotificationPermission requests permission for native notifications.
 */
export function RequestNotificationPermission(): $CancellablePromise<boolean> {
    return $Call.ByID(1315305223);
}

/**
 * ResetWindowState clears saved window positions.
 */
export function ResetWindowState(): $CancellablePromise<void> {
    return $Call.ByID(610344254);
}

/**
 * RestoreLayout applies a saved layout, positioning all windows.
 */
export function RestoreLayout(name: string): $CancellablePromise<void> {
    return $Call.ByID(2529654318, name);
}

/**
 * RestoreWindow restores a maximized/minimized window.
 */
export function RestoreWindow(name: string): $CancellablePromise<void> {
    return $Call.ByID(2762972996, name);
}

/**
 * SaveFileDialog shows a save file dialog and returns the selected path.
 */
export function SaveFileDialog(opts: $models.SaveFileOptions): $CancellablePromise<string> {
    return $Call.ByID(3969587317, opts);
}

/**
 * SaveLayout saves the current window arrangement as a named layout.
 */
export function SaveLayout(name: string): $CancellablePromise<void> {
    return $Call.ByID(1426429509, name);
}

/**
 * SelectDirectory opens a directory selection dialog and returns the selected path.
 */
export function SelectDirectory(): $CancellablePromise<string> {
    return $Call.ByID(968138697);
}

/**
 * SetNotifier sets the notifications service for native notifications.
 */
export function SetNotifier(notifier: notifications$0.NotificationService | null): $CancellablePromise<void> {
    return $Call.ByID(4060884340, notifier);
}

/**
 * SetTrayIcon sets the system tray icon from raw PNG data.
 */
export function SetTrayIcon(iconData: string): $CancellablePromise<void> {
    return $Call.ByID(888726123, iconData);
}

/**
 * SetTrayLabel sets the system tray label text.
 */
export function SetTrayLabel(label: string): $CancellablePromise<void> {
    return $Call.ByID(3980670180, label);
}

/**
 * SetTrayMenu sets the system tray menu from a list of menu items.
 */
export function SetTrayMenu(items: $models.TrayMenuItem[]): $CancellablePromise<void> {
    return $Call.ByID(3981223617, items);
}

/**
 * SetTrayTooltip sets the system tray tooltip text.
 */
export function SetTrayTooltip(tooltip: string): $CancellablePromise<void> {
    return $Call.ByID(85856277, tooltip);
}

/**
 * SetWindowAlwaysOnTop sets whether a window stays on top of other windows.
 */
export function SetWindowAlwaysOnTop(name: string, alwaysOnTop: boolean): $CancellablePromise<void> {
    return $Call.ByID(2197119377, name, alwaysOnTop);
}

/**
 * SetWindowBackgroundColour sets the background color of a window with alpha for transparency.
 * Note: On Windows, only alpha 0 or 255 are supported. Other values treated as 255.
 */
export function SetWindowBackgroundColour(name: string, r: number, g: number, b: number, a: number): $CancellablePromise<void> {
    return $Call.ByID(3749517962, name, r, g, b, a);
}

/**
 * SetWindowBounds sets both position and size of a window.
 */
export function SetWindowBounds(name: string, x: number, y: number, width: number, height: number): $CancellablePromise<void> {
    return $Call.ByID(2084950575, name, x, y, width, height);
}

/**
 * SetWindowFullscreen sets a window to fullscreen mode.
 */
export function SetWindowFullscreen(name: string, fullscreen: boolean): $CancellablePromise<void> {
    return $Call.ByID(4232233979, name, fullscreen);
}

/**
 * SetWindowPosition moves a window to the specified position.
 */
export function SetWindowPosition(name: string, x: number, y: number): $CancellablePromise<void> {
    return $Call.ByID(3018518601, name, x, y);
}

/**
 * SetWindowSize resizes a window.
 */
export function SetWindowSize(name: string, width: number, height: number): $CancellablePromise<void> {
    return $Call.ByID(2987817615, name, width, height);
}

/**
 * SetWindowTitle changes a window's title.
 */
export function SetWindowTitle(name: string, title: string): $CancellablePromise<void> {
    return $Call.ByID(3349151432, name, title);
}

/**
 * SetWindowVisibility shows or hides a window.
 */
export function SetWindowVisibility(name: string, visible: boolean): $CancellablePromise<void> {
    return $Call.ByID(121431198, name, visible);
}

/**
 * ShowEnvironmentDialog displays a dialog containing detailed information about
 * the application's runtime environment. This is useful for debugging and
 * understanding the context in which the application is running.
 * 
 * example:
 * 
 * 	displayService.ShowEnvironmentDialog()
 */
export function ShowEnvironmentDialog(): $CancellablePromise<void> {
    return $Call.ByID(3261510832);
}

/**
 * ShowErrorNotification shows an error notification.
 */
export function ShowErrorNotification(title: string, message: string): $CancellablePromise<void> {
    return $Call.ByID(1228262280, title, message);
}

/**
 * ShowInfoNotification shows an info notification with a simple message.
 */
export function ShowInfoNotification(title: string, message: string): $CancellablePromise<void> {
    return $Call.ByID(2419366044, title, message);
}

/**
 * ShowNotification displays a native system notification.
 * Falls back to dialog if notifier is not available.
 */
export function ShowNotification(opts: $models.NotificationOptions): $CancellablePromise<void> {
    return $Call.ByID(2416075800, opts);
}

/**
 * ShowWarningNotification shows a warning notification.
 */
export function ShowWarningNotification(title: string, message: string): $CancellablePromise<void> {
    return $Call.ByID(200899338, title, message);
}

/**
 * SnapWindow snaps a window to a screen edge or corner.
 */
export function SnapWindow(name: string, position: $models.SnapPosition): $CancellablePromise<void> {
    return $Call.ByID(3088366266, name, position);
}

/**
 * StackWindows arranges windows in a cascade (stacked) pattern.
 * Each window is offset by the given amount from the previous one.
 */
export function StackWindows(windowNames: string[], offsetX: number, offsetY: number): $CancellablePromise<void> {
    return $Call.ByID(3309040327, windowNames, offsetX, offsetY);
}

/**
 * Startup is called when the app starts. It initializes the display service
 * and sets up the main application window and system tray.
 * 
 * 	err := displayService.Startup(ctx)
 * 	if err != nil {
 * 		log.Fatal(err)
 * 	}
 */
export function Startup(): $CancellablePromise<void> {
    return $Call.ByID(1664741927);
}

/**
 * TileWindows arranges windows in a tiled layout.
 * mode can be: left, right, top, bottom, top-left, top-right, bottom-left, bottom-right, grid
 * If windowNames is empty, tiles all windows.
 */
export function TileWindows(mode: $models.TileMode, windowNames: string[]): $CancellablePromise<void> {
    return $Call.ByID(1638500379, mode, windowNames);
}

/**
 * WriteClipboard writes text content to the system clipboard.
 */
export function WriteClipboard(text: string): $CancellablePromise<void> {
    return $Call.ByID(2577466505, text);
}

// Private type creation functions
const $$createType0 = core$0.Core.createFrom;
const $$createType1 = $Create.Nullable($$createType0);
const $$createType2 = $models.WindowInfo.createFrom;
const $$createType3 = $Create.Nullable($$createType2);
const $$createType4 = $models.WSEventManager.createFrom;
const $$createType5 = $Create.Nullable($$createType4);
const $$createType6 = $models.Layout.createFrom;
const $$createType7 = $Create.Nullable($$createType6);
const $$createType8 = $models.ScreenInfo.createFrom;
const $$createType9 = $Create.Nullable($$createType8);
const $$createType10 = $models.WindowState.createFrom;
const $$createType11 = $Create.Nullable($$createType10);
const $$createType12 = $Create.Map($Create.Any, $$createType11);
const $$createType13 = $Create.Array($$createType8);
const $$createType14 = $models.ThemeInfo.createFrom;
const $$createType15 = $Create.Map($Create.Any, $Create.Any);
const $$createType16 = $models.WorkArea.createFrom;
const $$createType17 = $Create.Array($$createType16);
const $$createType18 = $models.LayoutInfo.createFrom;
const $$createType19 = $Create.Array($$createType18);
const $$createType20 = $Create.Array($$createType2);
const $$createType21 = application$0.WebviewWindow.createFrom;
const $$createType22 = $Create.Nullable($$createType21);
const $$createType23 = $Create.Array($Create.Any);
