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 | var __spreadArrays = (this && this.__spreadArrays) || function () {
|
15 | for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
16 | for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
17 | for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
18 | r[k] = a[j];
|
19 | return r;
|
20 | };
|
21 | import { DocNode, DocNodeKind } from './DocNode';
|
22 | import { DocExcerpt, ExcerptKind } from './DocExcerpt';
|
23 | import { StringBuilder } from '../emitters/StringBuilder';
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 | var DocDeclarationReference = (function (_super) {
|
32 | __extends(DocDeclarationReference, _super);
|
33 | |
34 |
|
35 |
|
36 |
|
37 | function DocDeclarationReference(parameters) {
|
38 | var _a;
|
39 | var _this = _super.call(this, parameters) || this;
|
40 | if (DocNode.isParsedParameters(parameters)) {
|
41 | if (parameters.packageNameExcerpt) {
|
42 | _this._packageNameExcerpt = new DocExcerpt({
|
43 | configuration: _this.configuration,
|
44 | excerptKind: ExcerptKind.DeclarationReference_PackageName,
|
45 | content: parameters.packageNameExcerpt
|
46 | });
|
47 | }
|
48 | if (parameters.importPathExcerpt) {
|
49 | _this._importPathExcerpt = new DocExcerpt({
|
50 | configuration: _this.configuration,
|
51 | excerptKind: ExcerptKind.DeclarationReference_ImportPath,
|
52 | content: parameters.importPathExcerpt
|
53 | });
|
54 | }
|
55 | if (parameters.importHashExcerpt) {
|
56 | _this._importHashExcerpt = new DocExcerpt({
|
57 | configuration: _this.configuration,
|
58 | excerptKind: ExcerptKind.DeclarationReference_ImportHash,
|
59 | content: parameters.importHashExcerpt
|
60 | });
|
61 | }
|
62 | if (parameters.spacingAfterImportHashExcerpt) {
|
63 | _this._spacingAfterImportHashExcerpt = new DocExcerpt({
|
64 | configuration: _this.configuration,
|
65 | excerptKind: ExcerptKind.Spacing,
|
66 | content: parameters.spacingAfterImportHashExcerpt
|
67 | });
|
68 | }
|
69 | }
|
70 | else {
|
71 | _this._packageName = parameters.packageName;
|
72 | _this._importPath = parameters.importPath;
|
73 | }
|
74 | _this._memberReferences = [];
|
75 | if (parameters.memberReferences) {
|
76 | (_a = _this._memberReferences).push.apply(_a, parameters.memberReferences);
|
77 | }
|
78 | return _this;
|
79 | }
|
80 | Object.defineProperty(DocDeclarationReference.prototype, "kind", {
|
81 |
|
82 | get: function () {
|
83 | return DocNodeKind.DeclarationReference;
|
84 | },
|
85 | enumerable: false,
|
86 | configurable: true
|
87 | });
|
88 | Object.defineProperty(DocDeclarationReference.prototype, "packageName", {
|
89 | |
90 |
|
91 |
|
92 |
|
93 |
|
94 | get: function () {
|
95 | if (this._packageName === undefined) {
|
96 | if (this._packageNameExcerpt !== undefined) {
|
97 | this._packageName = this._packageNameExcerpt.content.toString();
|
98 | }
|
99 | }
|
100 | return this._packageName;
|
101 | },
|
102 | enumerable: false,
|
103 | configurable: true
|
104 | });
|
105 | Object.defineProperty(DocDeclarationReference.prototype, "importPath", {
|
106 | |
107 |
|
108 |
|
109 |
|
110 |
|
111 |
|
112 |
|
113 |
|
114 |
|
115 | get: function () {
|
116 | if (this._importPath === undefined) {
|
117 | if (this._importPathExcerpt !== undefined) {
|
118 | this._importPath = this._importPathExcerpt.content.toString();
|
119 | }
|
120 | }
|
121 | return this._importPath;
|
122 | },
|
123 | enumerable: false,
|
124 | configurable: true
|
125 | });
|
126 | Object.defineProperty(DocDeclarationReference.prototype, "memberReferences", {
|
127 | |
128 |
|
129 |
|
130 |
|
131 |
|
132 | get: function () {
|
133 | return this._memberReferences;
|
134 | },
|
135 | enumerable: false,
|
136 | configurable: true
|
137 | });
|
138 | |
139 |
|
140 |
|
141 | DocDeclarationReference.prototype.emitAsTsdoc = function () {
|
142 | var stringBuilder = new StringBuilder();
|
143 |
|
144 | var emitter = new TSDocEmitter();
|
145 | emitter.renderDeclarationReference(stringBuilder, this);
|
146 | return stringBuilder.toString();
|
147 | };
|
148 |
|
149 | DocDeclarationReference.prototype.onGetChildNodes = function () {
|
150 | return __spreadArrays([
|
151 | this._packageNameExcerpt,
|
152 | this._importPathExcerpt,
|
153 | this._importHashExcerpt,
|
154 | this._spacingAfterImportHashExcerpt
|
155 | ], this._memberReferences);
|
156 | };
|
157 | return DocDeclarationReference;
|
158 | }(DocNode));
|
159 | export { DocDeclarationReference };
|
160 |
|
161 | import { TSDocEmitter } from '../emitters/TSDocEmitter';
|
162 |
|
\ | No newline at end of file |