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

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

/**
 * Config provides access to application configuration.
 */
export type Config = any;

/**
 * Core is the central application object that manages services, assets, and communication.
 */
export class Core {
    /**
     * GUI runtime (e.g., Wails App) - set by WithApp option
     */
    "App": any;
    "Features": Features | null;

    /** Creates a new Core instance. */
    constructor($$source: Partial<Core> = {}) {
        if (!("App" in $$source)) {
            this["App"] = null;
        }
        if (!("Features" in $$source)) {
            this["Features"] = null;
        }

        Object.assign(this, $$source);
    }

    /**
     * Creates a new Core instance from a string or object.
     */
    static createFrom($$source: any = {}): Core {
        const $$createField1_0 = $$createType1;
        let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
        if ("Features" in $$parsedSource) {
            $$parsedSource["Features"] = $$createField1_0($$parsedSource["Features"]);
        }
        return new Core($$parsedSource as Partial<Core>);
    }
}

/**
 * Crypt provides PGP-based encryption, signing, and key management.
 */
export type Crypt = any;

/**
 * Display provides access to windowing and visual elements.
 */
export type Display = any;

/**
 * Features provides a way to check if a feature is enabled.
 * This is used for feature flagging and conditional logic.
 */
export class Features {
    /**
     * Flags is a list of enabled feature flags.
     */
    "Flags": string[];

    /** Creates a new Features instance. */
    constructor($$source: Partial<Features> = {}) {
        if (!("Flags" in $$source)) {
            this["Flags"] = [];
        }

        Object.assign(this, $$source);
    }

    /**
     * Creates a new Features instance from a string or object.
     */
    static createFrom($$source: any = {}): Features {
        const $$createField0_0 = $$createType2;
        let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
        if ("Flags" in $$parsedSource) {
            $$parsedSource["Flags"] = $$createField0_0($$parsedSource["Flags"]);
        }
        return new Features($$parsedSource as Partial<Features>);
    }
}

/**
 * Message is the interface for all messages that can be sent through the Core's IPC system.
 * Any struct can be a message, allowing for structured data to be passed between services.
 * Used with ACTION for fire-and-forget broadcasts.
 */
export type Message = any;

/**
 * Query is the interface for read-only requests that return data.
 * Used with QUERY (first responder) or QUERYALL (all responders).
 */
export type Query = any;

/**
 * QueryHandler handles Query requests. Returns (result, handled, error).
 * If handled is false, the query will be passed to the next handler.
 */
export type QueryHandler = any;

/**
 * Task is the interface for requests that perform side effects.
 * Used with PERFORM (first responder executes).
 */
export type Task = any;

/**
 * TaskHandler handles Task requests. Returns (result, handled, error).
 * If handled is false, the task will be passed to the next handler.
 */
export type TaskHandler = any;

/**
 * Workspace provides management for encrypted user workspaces.
 */
export type Workspace = any;

// Private type creation functions
const $$createType0 = Features.createFrom;
const $$createType1 = $Create.Nullable($$createType0);
const $$createType2 = $Create.Array($Create.Any);
