import { fetchFormats } from "../services/fetcher.js";
import { fillTemplates, groupTemplates } from "../services/templates.js";
export async function registerEdenFormats(eden) {
    const bareTemplates = await fetchFormats();
    const templates = fillTemplates(bareTemplates);
    const { default: FormatDescriptor } = await import("../core/template.js");
    Object.entries(templates).forEach(([templateName, template]) => {
        eden.templateDescriptors[templateName] = new FormatDescriptor(template);
    });
    eden.templates = templates;
    eden.groupedTemplates = groupTemplates(templates);
}
