"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.KotlinTargetLanguage = exports.kotlinLanguageConfig = exports.kotlinOptions = void 0;
const index_js_1 = require("../../RendererOptions/index.js");
const Acronyms_js_1 = require("../../support/Acronyms.js");
const Support_js_1 = require("../../support/Support.js");
const TargetLanguage_js_1 = require("../../TargetLanguage.js");
const KotlinJacksonRenderer_js_1 = require("./KotlinJacksonRenderer.js");
const KotlinKlaxonRenderer_js_1 = require("./KotlinKlaxonRenderer.js");
const KotlinRenderer_js_1 = require("./KotlinRenderer.js");
const KotlinXRenderer_js_1 = require("./KotlinXRenderer.js");
exports.kotlinOptions = {
    framework: new index_js_1.EnumOption("framework", "Serialization framework", {
        "just-types": "None",
        jackson: "Jackson",
        klaxon: "Klaxon",
        kotlinx: "KotlinX",
    }, "klaxon"),
    acronymStyle: (0, Acronyms_js_1.acronymOption)(Acronyms_js_1.AcronymStyleOptions.Pascal),
    packageName: new index_js_1.StringOption("package", "Package", "PACKAGE", "quicktype"),
};
exports.kotlinLanguageConfig = {
    displayName: "Kotlin",
    names: ["kotlin"],
    extension: "kt",
};
class KotlinTargetLanguage extends TargetLanguage_js_1.TargetLanguage {
    constructor() {
        super(exports.kotlinLanguageConfig);
    }
    getOptions() {
        return exports.kotlinOptions;
    }
    get supportsOptionalClassProperties() {
        return true;
    }
    get supportsUnionsWithBothNumberTypes() {
        return true;
    }
    makeRenderer(renderContext, untypedOptionValues) {
        const options = (0, index_js_1.getOptionValues)(exports.kotlinOptions, untypedOptionValues);
        switch (options.framework) {
            case "None":
                return new KotlinRenderer_js_1.KotlinRenderer(this, renderContext, options);
            case "Jackson":
                return new KotlinJacksonRenderer_js_1.KotlinJacksonRenderer(this, renderContext, options);
            case "Klaxon":
                return new KotlinKlaxonRenderer_js_1.KotlinKlaxonRenderer(this, renderContext, options);
            case "KotlinX":
                return new KotlinXRenderer_js_1.KotlinXRenderer(this, renderContext, options);
            default:
                return (0, Support_js_1.assertNever)(options.framework);
        }
    }
}
exports.KotlinTargetLanguage = KotlinTargetLanguage;
