import { EnumOption, StringOption, getOptionValues, } from "../../RendererOptions/index.js";
import { AcronymStyleOptions, acronymOption } from "../../support/Acronyms.js";
import { assertNever } from "../../support/Support.js";
import { TargetLanguage } from "../../TargetLanguage.js";
import { KotlinJacksonRenderer } from "./KotlinJacksonRenderer.js";
import { KotlinKlaxonRenderer } from "./KotlinKlaxonRenderer.js";
import { KotlinRenderer } from "./KotlinRenderer.js";
import { KotlinXRenderer } from "./KotlinXRenderer.js";
export const kotlinOptions = {
    framework: new EnumOption("framework", "Serialization framework", {
        "just-types": "None",
        jackson: "Jackson",
        klaxon: "Klaxon",
        kotlinx: "KotlinX",
    }, "klaxon"),
    acronymStyle: acronymOption(AcronymStyleOptions.Pascal),
    packageName: new StringOption("package", "Package", "PACKAGE", "quicktype"),
};
export const kotlinLanguageConfig = {
    displayName: "Kotlin",
    names: ["kotlin"],
    extension: "kt",
};
export class KotlinTargetLanguage extends TargetLanguage {
    constructor() {
        super(kotlinLanguageConfig);
    }
    getOptions() {
        return kotlinOptions;
    }
    get supportsOptionalClassProperties() {
        return true;
    }
    get supportsUnionsWithBothNumberTypes() {
        return true;
    }
    makeRenderer(renderContext, untypedOptionValues) {
        const options = getOptionValues(kotlinOptions, untypedOptionValues);
        switch (options.framework) {
            case "None":
                return new KotlinRenderer(this, renderContext, options);
            case "Jackson":
                return new KotlinJacksonRenderer(this, renderContext, options);
            case "Klaxon":
                return new KotlinKlaxonRenderer(this, renderContext, options);
            case "KotlinX":
                return new KotlinXRenderer(this, renderContext, options);
            default:
                return assertNever(options.framework);
        }
    }
}
