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

/**
 * Router manages plugin registration and provides a Gin-based HTTP router.
 * It implements http.Handler and can be used as the Wails asset handler middleware.
 * @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 gin$0 from "../../../../gin-gonic/gin/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 http$0 from "../../../../../net/http/models.js";

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

/**
 * Engine returns the underlying Gin engine for advanced configuration.
 */
export function Engine(): $CancellablePromise<gin$0.Engine | null> {
    return $Call.ByID(2071121571).then(($result: any) => {
        return $$createType1($result);
    });
}

/**
 * Get returns a plugin by namespace and name.
 */
export function Get($namespace: string, name: string): $CancellablePromise<[$models.Plugin, boolean]> {
    return $Call.ByID(2263988351, $namespace, name);
}

/**
 * List returns info about all registered plugins.
 */
export function List(): $CancellablePromise<$models.PluginInfo[]> {
    return $Call.ByID(1465721241).then(($result: any) => {
        return $$createType3($result);
    });
}

/**
 * ListByNamespace returns all plugins in a namespace.
 */
export function ListByNamespace($namespace: string): $CancellablePromise<$models.Plugin[]> {
    return $Call.ByID(3303695111, $namespace).then(($result: any) => {
        return $$createType4($result);
    });
}

/**
 * Register adds a plugin to the router.
 */
export function Register(p: $models.Plugin): $CancellablePromise<void> {
    return $Call.ByID(1142024616, p);
}

/**
 * ServiceOptions returns the Wails service options for the router.
 */
export function ServiceOptions(): $CancellablePromise<application$0.ServiceOptions> {
    return $Call.ByID(1034114530).then(($result: any) => {
        return $$createType5($result);
    });
}

/**
 * SetAssetHandler sets the fallback handler for non-API routes (Wails assets).
 */
export function SetAssetHandler(h: http$0.Handler): $CancellablePromise<void> {
    return $Call.ByID(417441915, h);
}

/**
 * Unregister removes a plugin from the router.
 * Note: Gin doesn't support removing routes, so this only removes from our registry.
 * A restart is required for route changes to take effect.
 */
export function Unregister($namespace: string, name: string): $CancellablePromise<void> {
    return $Call.ByID(2047711931, $namespace, name);
}

// Private type creation functions
const $$createType0 = gin$0.Engine.createFrom;
const $$createType1 = $Create.Nullable($$createType0);
const $$createType2 = $models.PluginInfo.createFrom;
const $$createType3 = $Create.Array($$createType2);
const $$createType4 = $Create.Array($Create.Any);
const $$createType5 = application$0.ServiceOptions.createFrom;
