typings/lib2/messagev2/common/column.js

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.VerticalAlignment = exports.ColumnWidth = exports.Column = void 0;
const internal_1 = require("../internal");
/**
 * Represents a column
 * @extends ChannelCustomizable
 */
class Column extends internal_1.ChannelCustomizable {
    /**
     * Creates an instance of the Column class.
     * @param {Field[]} [fields] The list of fields in the column.
     */
    constructor(fields) {
        super();
        this.fields = [];
        if (fields) {
            this.fields = fields;
        }
    }
    /**
     * Deserialize nested object properties into corresponding class instances
     */
    deserializeNestedProperties() {
        super.deserializeNestedProperties();
        this.fields = internal_1.MessageUtil.deserializeFields(this.fields);
    }
    /**
     * Gets the ID of the column.
     * @returns {string} The ID of the column.
     */
    getId() {
        return this.id;
    }
    /**
     * Sets the ID of the column.
     * @param {string} id The ID to set.
     * @returns {Column} The updated instance of the Column.
     */
    setId(id) {
        this.id = id;
        return this;
    }
    /**
     * Gets the list of fields in the column.
     * @returns {Field[]} The list of fields in the column.
     */
    getFields() {
        return this.fields;
    }
    /**
     * Sets the fields of the column.
     * @param {Field[]} fields The fields to set.
     * @returns {Column} The updated instance of the Column.
     */
    setFields(fields) {
        this.fields = fields;
        return this;
    }
    /**
     * Adds a field to the column.
     * @param {Field} field The field to add.
     * @returns {Column} The updated instance of the Column.
     */
    addField(field) {
        this.fields.push(field);
        return this;
    }
    /**
     * Gets the width of the column.
     * @returns {ColumnWidth} The width.
     */
    getWidth() {
        return this.width;
    }
    /**
     * Sets the width of the column.
     * @param {string} width The width to set.
     * @returns {Column} The updated instance of the Column.
     */
    setWidth(width) {
        this.width = width;
        return this;
    }
    /**
     * Gets the vertical alignment of the column.
     * @returns {VerticalAlignment} The alignment.
     */
    getVerticalAlignment() {
        return this.verticalAlignment;
    }
    /**
     * Sets the vertical alignment of the column.
     * @param {string} verticalAlignment The alignment to set.
     * @returns {Column} The updated instance of the Column.
     */
    setVerticalAlignment(verticalAlignment) {
        this.verticalAlignment = verticalAlignment;
        return this;
    }
}
exports.Column = Column;
/**
 * Represents the column width
 */
var ColumnWidth;
(function (ColumnWidth) {
    ColumnWidth["auto"] = "auto";
    ColumnWidth["stretch"] = "stretch";
})(ColumnWidth = exports.ColumnWidth || (exports.ColumnWidth = {}));
/**
 * Represents the vertical column aligment
 */
var VerticalAlignment;
(function (VerticalAlignment) {
    VerticalAlignment["top"] = "top";
    VerticalAlignment["center"] = "center";
    VerticalAlignment["bottom"] = "bottom";
})(VerticalAlignment = exports.VerticalAlignment || (exports.VerticalAlignment = {}));