const require_kebabCaseToCamelCase = require('../utils/kebabCaseToCamelCase.cjs');
const require__utils_asset = require('../_virtual/_utils_asset.cjs');

//#region ../chokidar/dist/esm/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.mjs
const getContentDeclarationFileTemplate = async (key, format, fileParams = {}) => {
	let fileTemplate;
	switch (format) {
		case "ts":
			fileTemplate = "./tsTemplate.txt";
			break;
		case "cjs":
			fileTemplate = "./cjsTemplate.txt";
			break;
		case "json":
			fileTemplate = "./jsonTemplate.txt";
			break;
		default:
			fileTemplate = "./esmTemplate.txt";
			break;
	}
	const fileContent = require__utils_asset.readAsset(fileTemplate);
	const camelCaseKey = require_kebabCaseToCamelCase.kebabCaseToCamelCase(key);
	const nonCapitalizedCamelCaseKey = camelCaseKey.charAt(0).toLowerCase() + camelCaseKey.slice(1);
	const fileParamsString = Object.entries(fileParams).filter(([, value]) => value !== void 0).map(([key$1, value]) => {
		if (typeof value === "object") return `\n  '${key$1}': ${JSON.stringify(value)},`;
		if (typeof value === "boolean" || typeof value === "number") return `\n  '${key$1}': ${value},`;
		if (typeof value === "string") return `\n  '${key$1}': '${value}',`;
		return `\n  '${key$1}': ${value},`;
	}).join("");
	return fileContent.replace("{{key}}", key).replaceAll("{{name}}", nonCapitalizedCamelCaseKey).replace("{{fileParams}}", fileParamsString);
};

//#endregion
exports.getContentDeclarationFileTemplate = getContentDeclarationFileTemplate;
//# sourceMappingURL=getContentDeclarationFileTemplate.cjs.map