import { Directive, ElementRef, Input, Renderer } from '@angular/core';
export var Typography = (function () {
    function Typography(_elementRef, _renderer) {
        this._elementRef = _elementRef;
        this._renderer = _renderer;
    }
    Object.defineProperty(Typography.prototype, "color", {
        get: function () {
            return this._color;
        },
        set: function (val) {
            this._updateColor(val);
        },
        enumerable: true,
        configurable: true
    });
    Typography.prototype._updateColor = function (newColor) {
        this._setElementColor(this._color, false);
        this._setElementColor(newColor, true);
        this._color = newColor;
    };
    Typography.prototype._setElementColor = function (color, isAdd) {
        if (color !== null && color !== '') {
            this._renderer.setElementClass(this._elementRef.nativeElement, "text-" + color, isAdd);
        }
    };
    Typography.decorators = [
        { type: Directive, args: [{
                    selector: 'h1[color], h2[color], h3[color], h4[color], h5[color], h6[color], a[color], p[color], span[color], b[color], i[color], strong[color], em[color], small[color], sub[color], sup[color]'
                },] },
    ];
    Typography.ctorParameters = [
        { type: ElementRef, },
        { type: Renderer, },
    ];
    Typography.propDecorators = {
        'color': [{ type: Input },],
    };
    return Typography;
}());
