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

/**
 * DirectoryEntry represents a file or directory in a listing.
 */
export class DirectoryEntry {
    "name": string;
    "path": string;
    "isDir": boolean;
    "size": number;

    /** Creates a new DirectoryEntry instance. */
    constructor($$source: Partial<DirectoryEntry> = {}) {
        if (!("name" in $$source)) {
            this["name"] = "";
        }
        if (!("path" in $$source)) {
            this["path"] = "";
        }
        if (!("isDir" in $$source)) {
            this["isDir"] = false;
        }
        if (!("size" in $$source)) {
            this["size"] = 0;
        }

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

    /**
     * Creates a new DirectoryEntry instance from a string or object.
     */
    static createFrom($$source: any = {}): DirectoryEntry {
        let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
        return new DirectoryEntry($$parsedSource as Partial<DirectoryEntry>);
    }
}

/**
 * FileInfo represents information about a file for the editor.
 */
export class FileInfo {
    "path": string;
    "name": string;
    "content": string;
    "language": string;
    "isNew": boolean;

    /** Creates a new FileInfo instance. */
    constructor($$source: Partial<FileInfo> = {}) {
        if (!("path" in $$source)) {
            this["path"] = "";
        }
        if (!("name" in $$source)) {
            this["name"] = "";
        }
        if (!("content" in $$source)) {
            this["content"] = "";
        }
        if (!("language" in $$source)) {
            this["language"] = "";
        }
        if (!("isNew" in $$source)) {
            this["isNew"] = false;
        }

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

    /**
     * Creates a new FileInfo instance from a string or object.
     */
    static createFrom($$source: any = {}): FileInfo {
        let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
        return new FileInfo($$parsedSource as Partial<FileInfo>);
    }
}

/**
 * LanguageInfo describes a supported programming language.
 */
export class LanguageInfo {
    "id": string;
    "name": string;
    "extensions": string[];

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

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

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

// Private type creation functions
const $$createType0 = $Create.Array($Create.Any);
