@microsoft/api-documenter
Version:
Read JSON files from api-extractor, generate documentation pages
47 lines • 1.39 kB
JavaScript
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
// See LICENSE in the project root for license information.
import { DocNode, DocPlainText } from '@microsoft/tsdoc';
import { CustomDocNodeKind } from './CustomDocNodeKind';
import { DocTableCell } from './DocTableCell';
/**
* Represents table row, similar to an HTML `<tr>` element.
*/
export class DocTableRow extends DocNode {
constructor(parameters, cells) {
super(parameters);
this._cells = [];
if (cells) {
for (const cell of cells) {
this.addCell(cell);
}
}
}
/** @override */
get kind() {
return CustomDocNodeKind.TableRow;
}
get cells() {
return this._cells;
}
addCell(cell) {
this._cells.push(cell);
}
createAndAddCell() {
const newCell = new DocTableCell({ configuration: this.configuration });
this.addCell(newCell);
return newCell;
}
addPlainTextCell(cellContent) {
const cell = this.createAndAddCell();
cell.content.appendNodeInParagraph(new DocPlainText({
configuration: this.configuration,
text: cellContent
}));
return cell;
}
/** @override */
onGetChildNodes() {
return this._cells;
}
}
//# sourceMappingURL=DocTableRow.js.map