import Renderables from '../Renderables';
/**
 * Implementation of the 'headline' markup element.
 * Create a h2 HTML element is created and the class
 * lto-headline is added to allow CSS manipulations.
 *
 * @see {@link IRenderable}
 */
var Headline = /** @class */ (function () {
    function Headline(spec) {
        this.spec = spec;
    }
    /**
     * @inheritDoc
     */
    Headline.prototype.render = function (renderer, isNested) {
        var headline = document.createElement('h2');
        if (this.spec.id !== undefined) {
            headline.id = this.spec.id;
        }
        if (this.spec.class !== undefined) {
            this.spec.class.split(" ").forEach(function (e) { return headline.classList.add(e); });
        }
        headline.classList.add('lto-headline', "lto-" + this.spec.position || 'left');
        headline.appendChild(document.createTextNode(this.spec.text || ""));
        return headline;
    };
    return Headline;
}());
export { Headline };
Renderables.register("headline", Headline);
//# sourceMappingURL=index.js.map