"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SwiftTargetLanguage = exports.swiftLanguageConfig = exports.swiftOptions = void 0;
const index_js_1 = require("../../RendererOptions/index.js");
const Acronyms_js_1 = require("../../support/Acronyms.js");
const TargetLanguage_js_1 = require("../../TargetLanguage.js");
const SwiftRenderer_js_1 = require("./SwiftRenderer.js");
const utils_js_1 = require("./utils.js");
exports.swiftOptions = {
    justTypes: new index_js_1.BooleanOption("just-types", "Plain types only", false),
    convenienceInitializers: new index_js_1.BooleanOption("initializers", "Generate initializers and mutators", true),
    explicitCodingKeys: new index_js_1.BooleanOption("coding-keys", "Explicit CodingKey values in Codable types", true),
    codingKeysProtocol: new index_js_1.StringOption("coding-keys-protocol", "CodingKeys implements protocols", "protocol1, protocol2...", "", "secondary"),
    alamofire: new index_js_1.BooleanOption("alamofire", "Alamofire extensions", false),
    namedTypePrefix: new index_js_1.StringOption("type-prefix", "Prefix for type names", "PREFIX", "", "secondary"),
    useClasses: new index_js_1.EnumOption("struct-or-class", "Structs or classes", {
        struct: false,
        class: true,
    }, "struct"),
    mutableProperties: new index_js_1.BooleanOption("mutable-properties", "Use var instead of let for object properties", false),
    acronymStyle: (0, Acronyms_js_1.acronymOption)(Acronyms_js_1.AcronymStyleOptions.Pascal),
    dense: new index_js_1.EnumOption("density", "Code density", {
        dense: true,
        normal: false,
    }, "dense", "secondary"),
    linux: new index_js_1.BooleanOption("support-linux", "Support Linux", false, "secondary"),
    objcSupport: new index_js_1.BooleanOption("objective-c-support", "Objects inherit from NSObject and @objcMembers is added to classes", false),
    optionalEnums: new index_js_1.BooleanOption("optional-enums", "If no matching case is found enum value is set to null", false),
    swift5Support: new index_js_1.BooleanOption("swift-5-support", "Renders output in a Swift 5 compatible mode", false),
    sendable: new index_js_1.BooleanOption("sendable", "Mark generated models as Sendable", false),
    multiFileOutput: new index_js_1.BooleanOption("multi-file-output", "Renders each top-level object in its own Swift file", false),
    accessLevel: new index_js_1.EnumOption("access-level", "Access level", {
        internal: "internal",
        public: "public",
    }, "internal", "secondary"),
    protocol: new index_js_1.EnumOption("protocol", "Make types implement protocol", {
        none: { equatable: false, hashable: false },
        equatable: { equatable: true, hashable: false },
        hashable: { equatable: false, hashable: true },
    }, "none", "secondary"),
};
exports.swiftLanguageConfig = {
    displayName: "Swift",
    names: ["swift", "swift4"],
    extension: "swift",
};
class SwiftTargetLanguage extends TargetLanguage_js_1.TargetLanguage {
    constructor() {
        super(exports.swiftLanguageConfig);
    }
    getOptions() {
        return exports.swiftOptions;
    }
    get stringTypeMapping() {
        const mapping = new Map();
        mapping.set("date-time", "date-time");
        return mapping;
    }
    get supportsOptionalClassProperties() {
        return true;
    }
    get supportsUnionsWithBothNumberTypes() {
        return true;
    }
    makeRenderer(renderContext, untypedOptionValues) {
        return new SwiftRenderer_js_1.SwiftRenderer(this, renderContext, (0, index_js_1.getOptionValues)(exports.swiftOptions, untypedOptionValues));
    }
    get dateTimeRecognizer() {
        return new utils_js_1.SwiftDateTimeRecognizer();
    }
}
exports.SwiftTargetLanguage = SwiftTargetLanguage;
