"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Scala3TargetLanguage = exports.scala3LanguageConfig = exports.scala3Options = void 0;
const index_js_1 = require("../../RendererOptions/index.js");
const Support_js_1 = require("../../support/Support.js");
const TargetLanguage_js_1 = require("../../TargetLanguage.js");
const CirceRenderer_js_1 = require("./CirceRenderer.js");
const Scala3Renderer_js_1 = require("./Scala3Renderer.js");
const UpickleRenderer_js_1 = require("./UpickleRenderer.js");
exports.scala3Options = {
    framework: new index_js_1.EnumOption("framework", "Serialization framework", {
        "just-types": "None",
        circe: "Circe",
        upickle: "Upickle",
    }, "just-types"),
    packageName: new index_js_1.StringOption("package", "Package", "PACKAGE", "quicktype"),
};
exports.scala3LanguageConfig = {
    displayName: "Scala3",
    names: ["scala3"],
    extension: "scala",
};
class Scala3TargetLanguage extends TargetLanguage_js_1.TargetLanguage {
    constructor() {
        super(exports.scala3LanguageConfig);
    }
    getOptions() {
        return exports.scala3Options;
    }
    get supportsOptionalClassProperties() {
        return true;
    }
    get supportsUnionsWithBothNumberTypes() {
        return true;
    }
    makeRenderer(renderContext, untypedOptionValues) {
        const options = (0, index_js_1.getOptionValues)(exports.scala3Options, untypedOptionValues);
        switch (options.framework) {
            case "None":
                return new Scala3Renderer_js_1.Scala3Renderer(this, renderContext, options);
            case "Upickle":
                return new UpickleRenderer_js_1.UpickleRenderer(this, renderContext, options);
            case "Circe":
                return new CirceRenderer_js_1.CirceRenderer(this, renderContext, options);
            default:
                return (0, Support_js_1.assertNever)(options.framework);
        }
    }
}
exports.Scala3TargetLanguage = Scala3TargetLanguage;
