// #region
import { DirectiveBase, PartType, compose } from '../../../../Directives/Abstracts/DirectiveBase';
// #endregion
export class AdornerDirective extends DirectiveBase {
    // #region Ctor
    constructor(args) {
        super(args);
        if (args.type !== PartType.ELEMENT) {
            throw new Error('The `Adorner` directive can only be used on elements');
        }
    }
    // #endregion
    // #region Methods
    render(adornerType) {
        const adorner = new adornerType();
        this.internals.element.appendChild(adorner);
        this.internals.element.classList.add('adornment');
        adorner.attach(this.internals.element);
        return adorner;
    }
}
export const adorner = compose(AdornerDirective);
//# sourceMappingURL=AdornerDirective.js.map