"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.JavaScriptTargetLanguage = exports.javaScriptLanguageConfig = exports.javaScriptOptions = void 0;
const index_js_1 = require("../../RendererOptions/index.js");
const Acronyms_js_1 = require("../../support/Acronyms.js");
const Converters_js_1 = require("../../support/Converters.js");
const TargetLanguage_js_1 = require("../../TargetLanguage.js");
const JavaScriptRenderer_js_1 = require("./JavaScriptRenderer.js");
exports.javaScriptOptions = {
    acronymStyle: (0, Acronyms_js_1.acronymOption)(Acronyms_js_1.AcronymStyleOptions.Pascal),
    runtimeTypecheck: new index_js_1.BooleanOption("runtime-typecheck", "Verify JSON.parse results at runtime", true),
    runtimeTypecheckIgnoreUnknownProperties: new index_js_1.BooleanOption("runtime-typecheck-ignore-unknown-properties", "Ignore unknown properties when verifying at runtime", false, "secondary"),
    converters: (0, Converters_js_1.convertersOption)(),
    rawType: new index_js_1.EnumOption("raw-type", "Type of raw input (json by default)", {
        json: "json",
        any: "any",
    }, "json", "secondary"),
};
exports.javaScriptLanguageConfig = {
    displayName: "JavaScript",
    names: ["javascript", "js", "jsx"],
    extension: "js",
};
class JavaScriptTargetLanguage extends TargetLanguage_js_1.TargetLanguage {
    constructor() {
        super(exports.javaScriptLanguageConfig);
    }
    getOptions() {
        return exports.javaScriptOptions;
    }
    get stringTypeMapping() {
        const mapping = new Map();
        const dateTimeType = "date-time";
        mapping.set("date", dateTimeType);
        mapping.set("date-time", dateTimeType);
        return mapping;
    }
    get supportsOptionalClassProperties() {
        return true;
    }
    get supportsFullObjectType() {
        return true;
    }
    makeRenderer(renderContext, untypedOptionValues) {
        return new JavaScriptRenderer_js_1.JavaScriptRenderer(this, renderContext, (0, index_js_1.getOptionValues)(exports.javaScriptOptions, untypedOptionValues));
    }
}
exports.JavaScriptTargetLanguage = JavaScriptTargetLanguage;
