"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DartTargetLanguage = exports.dartLanguageConfig = exports.dartOptions = void 0;
const index_js_1 = require("../../RendererOptions/index.js");
const TargetLanguage_js_1 = require("../../TargetLanguage.js");
const DartRenderer_js_1 = require("./DartRenderer.js");
exports.dartOptions = {
    nullSafety: new index_js_1.BooleanOption("null-safety", "Null Safety", true),
    justTypes: new index_js_1.BooleanOption("just-types", "Types only", false),
    codersInClass: new index_js_1.BooleanOption("coders-in-class", "Put encoder & decoder in Class", false),
    methodNamesWithMap: new index_js_1.BooleanOption("from-map", "Use method names fromMap() & toMap()", false, "secondary"),
    requiredProperties: new index_js_1.BooleanOption("required-props", "Make all properties required", false),
    finalProperties: new index_js_1.BooleanOption("final-props", "Make all properties final", false),
    generateCopyWith: new index_js_1.BooleanOption("copy-with", "Generate CopyWith method", false),
    useFreezed: new index_js_1.BooleanOption("use-freezed", "Generate class definitions with @freezed compatibility", false, "secondary"),
    useHive: new index_js_1.BooleanOption("use-hive", "Generate annotations for Hive type adapters", false, "secondary"),
    useJsonAnnotation: new index_js_1.BooleanOption("use-json-annotation", "Generate annotations for json_serializable", false, "secondary"),
    partName: new index_js_1.StringOption("part-name", "Use this name in `part` directive", "NAME", "", "secondary"),
};
exports.dartLanguageConfig = {
    displayName: "Dart",
    names: ["dart"],
    extension: "dart",
};
class DartTargetLanguage extends TargetLanguage_js_1.TargetLanguage {
    constructor() {
        super(exports.dartLanguageConfig);
    }
    getOptions() {
        return exports.dartOptions;
    }
    get supportsUnionsWithBothNumberTypes() {
        return true;
    }
    get stringTypeMapping() {
        const mapping = new Map();
        mapping.set("date", "date");
        mapping.set("date-time", "date-time");
        return mapping;
    }
    makeRenderer(renderContext, untypedOptionValues) {
        const options = (0, index_js_1.getOptionValues)(exports.dartOptions, untypedOptionValues);
        return new DartRenderer_js_1.DartRenderer(this, renderContext, options);
    }
}
exports.DartTargetLanguage = DartTargetLanguage;
