// 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";

/**
 * Var is a variable that can be set, unset and queried for its state.
 */
export class Var<T> {

    /** Creates a new Var instance. */
    constructor($$source: Partial<Var<T>> = {}) {

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

    /**
     * Given creation functions for each type parameter,
     * returns a creation function for a concrete instance
     * of the generic class Var.
     */
    static createFrom<T = any>($$createParamT: (source: any) => T): ($$source?: any) => Var<T> {
        return ($$source: any = {}) => {
            let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
            return new Var<T>($$parsedSource as Partial<Var<T>>);
        };
    }
}

/**
 * Bool is a `bool` that can be unset
 */
export const Bool = Var;

/**
 * Bool is a `bool` that can be unset
 */
export type Bool = Var<boolean>;
