1 | var __extends = (this && this.__extends) || (function () {
|
2 | var extendStatics = function (d, b) {
|
3 | extendStatics = Object.setPrototypeOf ||
|
4 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
5 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
6 | return extendStatics(d, b);
|
7 | };
|
8 | return function (d, b) {
|
9 | extendStatics(d, b);
|
10 | function __() { this.constructor = d; }
|
11 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
12 | };
|
13 | })();
|
14 | import { DocNode } from './DocNode';
|
15 |
|
16 |
|
17 |
|
18 |
|
19 | var DocNodeContainer = (function (_super) {
|
20 | __extends(DocNodeContainer, _super);
|
21 | |
22 |
|
23 |
|
24 |
|
25 | function DocNodeContainer(parameters, childNodes) {
|
26 | var _this = _super.call(this, parameters) || this;
|
27 | _this._nodes = [];
|
28 | if (childNodes !== undefined && childNodes.length > 0) {
|
29 | _this.appendNodes(childNodes);
|
30 | }
|
31 | return _this;
|
32 | }
|
33 | Object.defineProperty(DocNodeContainer.prototype, "nodes", {
|
34 | |
35 |
|
36 |
|
37 | get: function () {
|
38 | return this._nodes;
|
39 | },
|
40 | enumerable: false,
|
41 | configurable: true
|
42 | });
|
43 | |
44 |
|
45 |
|
46 | DocNodeContainer.prototype.appendNode = function (docNode) {
|
47 | if (!this.configuration.docNodeManager.isAllowedChild(this.kind, docNode.kind)) {
|
48 | throw new Error("The TSDocConfiguration does not allow a " + this.kind + " node to" +
|
49 | (" contain a node of type " + docNode.kind));
|
50 | }
|
51 | this._nodes.push(docNode);
|
52 | };
|
53 | |
54 |
|
55 |
|
56 | DocNodeContainer.prototype.appendNodes = function (docNodes) {
|
57 | for (var _i = 0, docNodes_1 = docNodes; _i < docNodes_1.length; _i++) {
|
58 | var docNode = docNodes_1[_i];
|
59 | this.appendNode(docNode);
|
60 | }
|
61 | };
|
62 | |
63 |
|
64 |
|
65 | DocNodeContainer.prototype.clearNodes = function () {
|
66 | this._nodes.length = 0;
|
67 | };
|
68 |
|
69 | DocNodeContainer.prototype.onGetChildNodes = function () {
|
70 | return this._nodes;
|
71 | };
|
72 | return DocNodeContainer;
|
73 | }(DocNode));
|
74 | export { DocNodeContainer };
|
75 |
|
\ | No newline at end of file |