UNPKG

1.5 kBJavaScriptView Raw
1"use strict";
2// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
3// See LICENSE in the project root for license information.
4Object.defineProperty(exports, "__esModule", { value: true });
5exports.DocTableRow = void 0;
6const tsdoc_1 = require("@microsoft/tsdoc");
7const DocTableCell_1 = require("./DocTableCell");
8/**
9 * Represents table row, similar to an HTML `<tr>` element.
10 */
11class DocTableRow extends tsdoc_1.DocNode {
12 constructor(parameters, cells) {
13 super(parameters);
14 this._cells = [];
15 if (cells) {
16 for (const cell of cells) {
17 this.addCell(cell);
18 }
19 }
20 }
21 /** @override */
22 get kind() {
23 return "TableRow" /* CustomDocNodeKind.TableRow */;
24 }
25 get cells() {
26 return this._cells;
27 }
28 addCell(cell) {
29 this._cells.push(cell);
30 }
31 createAndAddCell() {
32 const newCell = new DocTableCell_1.DocTableCell({ configuration: this.configuration });
33 this.addCell(newCell);
34 return newCell;
35 }
36 addPlainTextCell(cellContent) {
37 const cell = this.createAndAddCell();
38 cell.content.appendNodeInParagraph(new tsdoc_1.DocPlainText({
39 configuration: this.configuration,
40 text: cellContent
41 }));
42 return cell;
43 }
44 /** @override */
45 onGetChildNodes() {
46 return this._cells;
47 }
48}
49exports.DocTableRow = DocTableRow;
50//# sourceMappingURL=DocTableRow.js.map
\No newline at end of file