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 | Object.defineProperty(exports, "__esModule", { value: true });
|
16 | exports.DocMemberIdentifier = void 0;
|
17 | var DocNode_1 = require("./DocNode");
|
18 | var StringChecks_1 = require("../parser/StringChecks");
|
19 | var DocExcerpt_1 = require("./DocExcerpt");
|
20 |
|
21 |
|
22 |
|
23 | var DocMemberIdentifier = (function (_super) {
|
24 | __extends(DocMemberIdentifier, _super);
|
25 | |
26 |
|
27 |
|
28 |
|
29 | function DocMemberIdentifier(parameters) {
|
30 | var _this = _super.call(this, parameters) || this;
|
31 | if (DocNode_1.DocNode.isParsedParameters(parameters)) {
|
32 | if (parameters.leftQuoteExcerpt) {
|
33 | _this._leftQuoteExcerpt = new DocExcerpt_1.DocExcerpt({
|
34 | configuration: _this.configuration,
|
35 | excerptKind: DocExcerpt_1.ExcerptKind.MemberIdentifier_LeftQuote,
|
36 | content: parameters.leftQuoteExcerpt
|
37 | });
|
38 | }
|
39 | _this._identifierExcerpt = new DocExcerpt_1.DocExcerpt({
|
40 | configuration: _this.configuration,
|
41 | excerptKind: DocExcerpt_1.ExcerptKind.MemberIdentifier_Identifier,
|
42 | content: parameters.identifierExcerpt
|
43 | });
|
44 | if (parameters.rightQuoteExcerpt) {
|
45 | _this._rightQuoteExcerpt = new DocExcerpt_1.DocExcerpt({
|
46 | configuration: _this.configuration,
|
47 | excerptKind: DocExcerpt_1.ExcerptKind.MemberIdentifier_RightQuote,
|
48 | content: parameters.rightQuoteExcerpt
|
49 | });
|
50 | }
|
51 | }
|
52 | else {
|
53 | _this._identifier = parameters.identifier;
|
54 | }
|
55 | return _this;
|
56 | }
|
57 | |
58 |
|
59 |
|
60 |
|
61 |
|
62 |
|
63 |
|
64 |
|
65 |
|
66 | DocMemberIdentifier.isValidIdentifier = function (identifier) {
|
67 | return !StringChecks_1.StringChecks.explainIfInvalidUnquotedMemberIdentifier(identifier);
|
68 | };
|
69 | Object.defineProperty(DocMemberIdentifier.prototype, "kind", {
|
70 |
|
71 | get: function () {
|
72 | return DocNode_1.DocNodeKind.MemberIdentifier;
|
73 | },
|
74 | enumerable: false,
|
75 | configurable: true
|
76 | });
|
77 | Object.defineProperty(DocMemberIdentifier.prototype, "identifier", {
|
78 | |
79 |
|
80 |
|
81 |
|
82 |
|
83 |
|
84 |
|
85 | get: function () {
|
86 | if (this._identifier === undefined) {
|
87 | this._identifier = this._identifierExcerpt.content.toString();
|
88 | }
|
89 | return this._identifier;
|
90 | },
|
91 | enumerable: false,
|
92 | configurable: true
|
93 | });
|
94 | Object.defineProperty(DocMemberIdentifier.prototype, "hasQuotes", {
|
95 | |
96 |
|
97 |
|
98 |
|
99 |
|
100 | get: function () {
|
101 | if (this._identifierExcerpt) {
|
102 | return !!this._leftQuoteExcerpt;
|
103 | }
|
104 | else {
|
105 | return !DocMemberIdentifier.isValidIdentifier(this.identifier);
|
106 | }
|
107 | },
|
108 | enumerable: false,
|
109 | configurable: true
|
110 | });
|
111 |
|
112 | DocMemberIdentifier.prototype.onGetChildNodes = function () {
|
113 | return [this._leftQuoteExcerpt, this._identifierExcerpt, this._rightQuoteExcerpt];
|
114 | };
|
115 | return DocMemberIdentifier;
|
116 | }(DocNode_1.DocNode));
|
117 | exports.DocMemberIdentifier = DocMemberIdentifier;
|
118 |
|
\ | No newline at end of file |