import { EnumOption, StringOption, getOptionValues, } from "../../RendererOptions/index.js";
import { assertNever } from "../../support/Support.js";
import { TargetLanguage } from "../../TargetLanguage.js";
import { CirceRenderer } from "./CirceRenderer.js";
import { Scala3Renderer } from "./Scala3Renderer.js";
import { UpickleRenderer } from "./UpickleRenderer.js";
export const scala3Options = {
    framework: new EnumOption("framework", "Serialization framework", {
        "just-types": "None",
        circe: "Circe",
        upickle: "Upickle",
    }, "just-types"),
    packageName: new StringOption("package", "Package", "PACKAGE", "quicktype"),
};
export const scala3LanguageConfig = {
    displayName: "Scala3",
    names: ["scala3"],
    extension: "scala",
};
export class Scala3TargetLanguage extends TargetLanguage {
    constructor() {
        super(scala3LanguageConfig);
    }
    getOptions() {
        return scala3Options;
    }
    get supportsOptionalClassProperties() {
        return true;
    }
    get supportsUnionsWithBothNumberTypes() {
        return true;
    }
    makeRenderer(renderContext, untypedOptionValues) {
        const options = getOptionValues(scala3Options, untypedOptionValues);
        switch (options.framework) {
            case "None":
                return new Scala3Renderer(this, renderContext, options);
            case "Upickle":
                return new UpickleRenderer(this, renderContext, options);
            case "Circe":
                return new CirceRenderer(this, renderContext, options);
            default:
                return assertNever(options.framework);
        }
    }
}
