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