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 { DocNodeKind, DocNode } from './DocNode';
|
15 |
|
16 |
|
17 |
|
18 |
|
19 | var DocParamCollection = (function (_super) {
|
20 | __extends(DocParamCollection, _super);
|
21 | |
22 |
|
23 |
|
24 |
|
25 | function DocParamCollection(parameters) {
|
26 | var _this = _super.call(this, parameters) || this;
|
27 | _this._blocks = [];
|
28 | return _this;
|
29 | }
|
30 | Object.defineProperty(DocParamCollection.prototype, "kind", {
|
31 |
|
32 | get: function () {
|
33 | return DocNodeKind.ParamCollection;
|
34 | },
|
35 | enumerable: false,
|
36 | configurable: true
|
37 | });
|
38 | |
39 |
|
40 |
|
41 | DocParamCollection.prototype[Symbol.iterator] = function () {
|
42 | return this._blocks[Symbol.iterator]();
|
43 | };
|
44 | Object.defineProperty(DocParamCollection.prototype, "blocks", {
|
45 | |
46 |
|
47 |
|
48 | get: function () {
|
49 | return this._blocks;
|
50 | },
|
51 | enumerable: false,
|
52 | configurable: true
|
53 | });
|
54 | Object.defineProperty(DocParamCollection.prototype, "count", {
|
55 | |
56 |
|
57 |
|
58 | get: function () {
|
59 | return this._blocks.length;
|
60 | },
|
61 | enumerable: false,
|
62 | configurable: true
|
63 | });
|
64 | |
65 |
|
66 |
|
67 | DocParamCollection.prototype.add = function (docParamBlock) {
|
68 | this._blocks.push(docParamBlock);
|
69 |
|
70 | if (this._blocksByName === undefined) {
|
71 | this._blocksByName = new Map();
|
72 | }
|
73 |
|
74 | if (!this._blocksByName.has(docParamBlock.parameterName)) {
|
75 | this._blocksByName.set(docParamBlock.parameterName, docParamBlock);
|
76 | }
|
77 | };
|
78 | |
79 |
|
80 |
|
81 | DocParamCollection.prototype.clear = function () {
|
82 | this._blocks.length = 0;
|
83 | this._blocksByName = undefined;
|
84 | };
|
85 | |
86 |
|
87 |
|
88 |
|
89 |
|
90 |
|
91 |
|
92 |
|
93 |
|
94 |
|
95 | DocParamCollection.prototype.tryGetBlockByName = function (parameterName) {
|
96 | if (this._blocksByName) {
|
97 | return this._blocksByName.get(parameterName);
|
98 | }
|
99 | return undefined;
|
100 | };
|
101 |
|
102 | DocParamCollection.prototype.onGetChildNodes = function () {
|
103 | return this._blocks;
|
104 | };
|
105 | return DocParamCollection;
|
106 | }(DocNode));
|
107 | export { DocParamCollection };
|
108 |
|
\ | No newline at end of file |