1 | "use strict";
|
2 | var __extends = (this && this.__extends) || (function () {
|
3 | var extendStatics = function (d, b) {
|
4 | extendStatics = Object.setPrototypeOf ||
|
5 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
6 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
7 | return extendStatics(d, b);
|
8 | };
|
9 | return function (d, b) {
|
10 | extendStatics(d, b);
|
11 | function __() { this.constructor = d; }
|
12 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
13 | };
|
14 | })();
|
15 | Object.defineProperty(exports, "__esModule", { value: true });
|
16 | exports.DocSection = void 0;
|
17 | var DocNode_1 = require("./DocNode");
|
18 | var DocParagraph_1 = require("./DocParagraph");
|
19 | var DocNodeContainer_1 = require("./DocNodeContainer");
|
20 |
|
21 |
|
22 |
|
23 | var DocSection = (function (_super) {
|
24 | __extends(DocSection, _super);
|
25 | |
26 |
|
27 |
|
28 |
|
29 | function DocSection(parameters, childNodes) {
|
30 | return _super.call(this, parameters, childNodes) || this;
|
31 | }
|
32 | Object.defineProperty(DocSection.prototype, "kind", {
|
33 |
|
34 | get: function () {
|
35 | return DocNode_1.DocNodeKind.Section;
|
36 | },
|
37 | enumerable: false,
|
38 | configurable: true
|
39 | });
|
40 | |
41 |
|
42 |
|
43 |
|
44 | DocSection.prototype.appendNodeInParagraph = function (docNode) {
|
45 | var paragraphNode = undefined;
|
46 | if (this.nodes.length > 0) {
|
47 | var lastNode = this.nodes[this.nodes.length - 1];
|
48 | if (lastNode.kind === DocNode_1.DocNodeKind.Paragraph) {
|
49 | paragraphNode = lastNode;
|
50 | }
|
51 | }
|
52 | if (!paragraphNode) {
|
53 | paragraphNode = new DocParagraph_1.DocParagraph({ configuration: this.configuration });
|
54 | this.appendNode(paragraphNode);
|
55 | }
|
56 | paragraphNode.appendNode(docNode);
|
57 | };
|
58 | DocSection.prototype.appendNodesInParagraph = function (docNodes) {
|
59 | for (var _i = 0, docNodes_1 = docNodes; _i < docNodes_1.length; _i++) {
|
60 | var docNode = docNodes_1[_i];
|
61 | this.appendNodeInParagraph(docNode);
|
62 | }
|
63 | };
|
64 | return DocSection;
|
65 | }(DocNodeContainer_1.DocNodeContainer));
|
66 | exports.DocSection = DocSection;
|
67 |
|
\ | No newline at end of file |