UNPKG

3.29 kBJavaScriptView Raw
1var __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})();
14import { DocNodeKind, DocNode } from './DocNode';
15import { DocExcerpt, ExcerptKind } from './DocExcerpt';
16/**
17 * Represents a reference to an ECMAScript 6 symbol that is used
18 * to identify a member declaration.
19 *
20 * @example
21 *
22 * In the declaration reference `{@link MyClass.([MySymbols.example]:instance)}`,
23 * the member symbol `[MySymbols.example]` might be used to reference a property
24 * of the class.
25 */
26var DocMemberSymbol = /** @class */ (function (_super) {
27 __extends(DocMemberSymbol, _super);
28 /**
29 * Don't call this directly. Instead use {@link TSDocParser}
30 * @internal
31 */
32 function DocMemberSymbol(parameters) {
33 var _this = _super.call(this, parameters) || this;
34 if (DocNode.isParsedParameters(parameters)) {
35 _this._leftBracketExcerpt = new DocExcerpt({
36 configuration: _this.configuration,
37 excerptKind: ExcerptKind.DocMemberSymbol_LeftBracket,
38 content: parameters.leftBracketExcerpt
39 });
40 if (parameters.spacingAfterLeftBracketExcerpt) {
41 _this._spacingAfterLeftBracketExcerpt = new DocExcerpt({
42 configuration: _this.configuration,
43 excerptKind: ExcerptKind.Spacing,
44 content: parameters.spacingAfterLeftBracketExcerpt
45 });
46 }
47 _this._rightBracketExcerpt = new DocExcerpt({
48 configuration: _this.configuration,
49 excerptKind: ExcerptKind.DocMemberSymbol_RightBracket,
50 content: parameters.rightBracketExcerpt
51 });
52 }
53 _this._symbolReference = parameters.symbolReference;
54 return _this;
55 }
56 Object.defineProperty(DocMemberSymbol.prototype, "kind", {
57 /** @override */
58 get: function () {
59 return DocNodeKind.MemberSymbol;
60 },
61 enumerable: false,
62 configurable: true
63 });
64 Object.defineProperty(DocMemberSymbol.prototype, "symbolReference", {
65 /**
66 * The declaration reference for the ECMAScript 6 symbol that will act as
67 * the identifier for the member.
68 */
69 get: function () {
70 return this._symbolReference;
71 },
72 enumerable: false,
73 configurable: true
74 });
75 /** @override */
76 DocMemberSymbol.prototype.onGetChildNodes = function () {
77 return [
78 this._leftBracketExcerpt,
79 this._spacingAfterLeftBracketExcerpt,
80 this._symbolReference,
81 this._rightBracketExcerpt
82 ];
83 };
84 return DocMemberSymbol;
85}(DocNode));
86export { DocMemberSymbol };
87//# sourceMappingURL=DocMemberSymbol.js.map
\No newline at end of file