import * as tslib_1 from "tslib";
import ColumnBuilder from './ColumnBuilder';
var StringColumnBuilder = /** @class */ (function (_super) {
    tslib_1.__extends(StringColumnBuilder, _super);
    function StringColumnBuilder(column) {
        return _super.call(this, 'string', column) || this;
    }
    /**
     * makes the text editable within a cell and switches to the annotate type
     */
    StringColumnBuilder.prototype.editable = function () {
        this.desc.type = 'annotate';
        return this;
    };
    /**
     * changes the alignment of the column
     */
    StringColumnBuilder.prototype.alignment = function (align) {
        this.desc.alignment = align;
        return this;
    };
    /**
     * allow html text as values
     */
    StringColumnBuilder.prototype.html = function () {
        this.desc.escape = false;
        return this;
    };
    /**
     * provide a pattern with which the value will be wrapped, use <code>${value}</code> for the current and and <code>${item}</code> for the whole item
     * @param {string} pattern pattern to apply
     * @param {string[]} templates optional templates for patterns to provide in the edit pattern dialog
     */
    StringColumnBuilder.prototype.pattern = function (pattern, templates) {
        this.desc.type = 'link';
        this.desc.pattern = pattern;
        if (templates) {
            this.desc.patternTemplates = templates;
        }
        return this;
    };
    return StringColumnBuilder;
}(ColumnBuilder));
export default StringColumnBuilder;
/**
 * builds a string column builder
 * @param {string} column column which contains the associated data
 * @returns {StringColumnBuilder}
 */
export function buildStringColumn(column) {
    return new StringColumnBuilder(column);
}
//# sourceMappingURL=StringColumnBuilder.js.map