// 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 $models from "./models.js";

/**
 * 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);
}

/**
 * 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);
    });
}

/**
 * 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 $$createType3($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 $$createType3($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 $$createType3($result);
    });
}

/**
 * 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);
}

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

/**
 * 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);
}

/**
 * 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);
}

// Private type creation functions
const $$createType0 = core$0.Core.createFrom;
const $$createType1 = $Create.Nullable($$createType0);
const $$createType2 = application$0.WebviewWindow.createFrom;
const $$createType3 = $Create.Nullable($$createType2);
