import { BooleanOption, getOptionValues } from "../../RendererOptions/index.js";
import { AcronymStyleOptions, acronymOption } from "../../support/Acronyms.js";
import { TargetLanguage } from "../../TargetLanguage.js";
import { PhpRenderer } from "./PhpRenderer.js";
export const phpOptions = {
    withGet: new BooleanOption("with-get", "Create Getter", true),
    fastGet: new BooleanOption("fast-get", "getter without validation", false),
    withSet: new BooleanOption("with-set", "Create Setter", false),
    withClosing: new BooleanOption("with-closing", "PHP Closing Tag", false),
    acronymStyle: acronymOption(AcronymStyleOptions.Pascal),
};
export const phpLanguageConfig = {
    displayName: "PHP",
    names: ["php"],
    extension: "php",
};
export class PhpTargetLanguage extends TargetLanguage {
    constructor() {
        super(phpLanguageConfig);
    }
    getOptions() {
        return phpOptions;
    }
    get supportsUnionsWithBothNumberTypes() {
        return true;
    }
    makeRenderer(renderContext, untypedOptionValues) {
        const options = getOptionValues(phpOptions, untypedOptionValues);
        return new PhpRenderer(this, renderContext, options);
    }
    get stringTypeMapping() {
        const mapping = new Map();
        // "date" and "time" are not implemented in the renderer (it throws
        // on them), so let them fall back to plain strings.
        mapping.set("uuid", "uuid");
        mapping.set("date-time", "date-time");
        return mapping;
    }
}
