import { ufm } from '../plugins/marked-ufm.plugin.js';
import { umbExtensionsRegistry } from '../../core/extension-registry/index.js';
import { UmbExtensionsApiInitializer } from '../../../libs/extension-api/index.js';
export class UmbUfmMarkedExtensionApi {
    constructor(host, marked) {
        new UmbExtensionsApiInitializer(host, umbExtensionsRegistry, 'ufmComponent', [], undefined, (controllers) => {
            marked.use(ufm(controllers
                .map((controller) => {
                const ctrl = controller;
                if (!ctrl.manifest || !ctrl.api)
                    return;
                return {
                    alias: ctrl.manifest.meta.alias || ctrl.manifest.alias,
                    marker: ctrl.manifest.meta.marker,
                    render: ctrl.api.render,
                };
            })
                .filter((x) => x)));
        });
    }
    destroy() { }
}
export default UmbUfmMarkedExtensionApi;
