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.DocNodeContainer = void 0;
|
17 | var DocNode_1 = require("./DocNode");
|
18 |
|
19 |
|
20 |
|
21 |
|
22 | var DocNodeContainer = (function (_super) {
|
23 | __extends(DocNodeContainer, _super);
|
24 | |
25 |
|
26 |
|
27 |
|
28 | function DocNodeContainer(parameters, childNodes) {
|
29 | var _this = _super.call(this, parameters) || this;
|
30 | _this._nodes = [];
|
31 | if (childNodes !== undefined && childNodes.length > 0) {
|
32 | _this.appendNodes(childNodes);
|
33 | }
|
34 | return _this;
|
35 | }
|
36 | Object.defineProperty(DocNodeContainer.prototype, "nodes", {
|
37 | |
38 |
|
39 |
|
40 | get: function () {
|
41 | return this._nodes;
|
42 | },
|
43 | enumerable: false,
|
44 | configurable: true
|
45 | });
|
46 | |
47 |
|
48 |
|
49 | DocNodeContainer.prototype.appendNode = function (docNode) {
|
50 | if (!this.configuration.docNodeManager.isAllowedChild(this.kind, docNode.kind)) {
|
51 | throw new Error("The TSDocConfiguration does not allow a " + this.kind + " node to" +
|
52 | (" contain a node of type " + docNode.kind));
|
53 | }
|
54 | this._nodes.push(docNode);
|
55 | };
|
56 | |
57 |
|
58 |
|
59 | DocNodeContainer.prototype.appendNodes = function (docNodes) {
|
60 | for (var _i = 0, docNodes_1 = docNodes; _i < docNodes_1.length; _i++) {
|
61 | var docNode = docNodes_1[_i];
|
62 | this.appendNode(docNode);
|
63 | }
|
64 | };
|
65 | |
66 |
|
67 |
|
68 | DocNodeContainer.prototype.clearNodes = function () {
|
69 | this._nodes.length = 0;
|
70 | };
|
71 |
|
72 | DocNodeContainer.prototype.onGetChildNodes = function () {
|
73 | return this._nodes;
|
74 | };
|
75 | return DocNodeContainer;
|
76 | }(DocNode_1.DocNode));
|
77 | exports.DocNodeContainer = DocNodeContainer;
|
78 |
|
\ | No newline at end of file |