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.DocHtmlEndTag = void 0;
|
17 | var DocNode_1 = require("./DocNode");
|
18 | var DocExcerpt_1 = require("./DocExcerpt");
|
19 | var StringBuilder_1 = require("../emitters/StringBuilder");
|
20 |
|
21 |
|
22 |
|
23 | var DocHtmlEndTag = (function (_super) {
|
24 | __extends(DocHtmlEndTag, _super);
|
25 | |
26 |
|
27 |
|
28 |
|
29 | function DocHtmlEndTag(parameters) {
|
30 | var _this = _super.call(this, parameters) || this;
|
31 | if (DocNode_1.DocNode.isParsedParameters(parameters)) {
|
32 | _this._openingDelimiterExcerpt = new DocExcerpt_1.DocExcerpt({
|
33 | configuration: _this.configuration,
|
34 | excerptKind: DocExcerpt_1.ExcerptKind.HtmlEndTag_OpeningDelimiter,
|
35 | content: parameters.openingDelimiterExcerpt
|
36 | });
|
37 | _this._nameExcerpt = new DocExcerpt_1.DocExcerpt({
|
38 | configuration: _this.configuration,
|
39 | excerptKind: DocExcerpt_1.ExcerptKind.HtmlEndTag_Name,
|
40 | content: parameters.nameExcerpt
|
41 | });
|
42 | if (parameters.spacingAfterNameExcerpt) {
|
43 | _this._spacingAfterNameExcerpt = new DocExcerpt_1.DocExcerpt({
|
44 | configuration: _this.configuration,
|
45 | excerptKind: DocExcerpt_1.ExcerptKind.Spacing,
|
46 | content: parameters.spacingAfterNameExcerpt
|
47 | });
|
48 | }
|
49 | _this._closingDelimiterExcerpt = new DocExcerpt_1.DocExcerpt({
|
50 | configuration: _this.configuration,
|
51 | excerptKind: DocExcerpt_1.ExcerptKind.HtmlEndTag_ClosingDelimiter,
|
52 | content: parameters.closingDelimiterExcerpt
|
53 | });
|
54 | }
|
55 | else {
|
56 | _this._name = parameters.name;
|
57 | }
|
58 | return _this;
|
59 | }
|
60 | Object.defineProperty(DocHtmlEndTag.prototype, "kind", {
|
61 |
|
62 | get: function () {
|
63 | return DocNode_1.DocNodeKind.HtmlEndTag;
|
64 | },
|
65 | enumerable: false,
|
66 | configurable: true
|
67 | });
|
68 | Object.defineProperty(DocHtmlEndTag.prototype, "name", {
|
69 | |
70 |
|
71 |
|
72 | get: function () {
|
73 | if (this._name === undefined) {
|
74 | this._name = this._nameExcerpt.content.toString();
|
75 | }
|
76 | return this._name;
|
77 | },
|
78 | enumerable: false,
|
79 | configurable: true
|
80 | });
|
81 | |
82 |
|
83 |
|
84 | DocHtmlEndTag.prototype.emitAsHtml = function () {
|
85 |
|
86 | var stringBuilder = new StringBuilder_1.StringBuilder();
|
87 |
|
88 | var emitter = new TSDocEmitter_1.TSDocEmitter();
|
89 | emitter.renderHtmlTag(stringBuilder, this);
|
90 | return stringBuilder.toString();
|
91 | };
|
92 |
|
93 | DocHtmlEndTag.prototype.onGetChildNodes = function () {
|
94 | return [
|
95 | this._openingDelimiterExcerpt,
|
96 | this._nameExcerpt,
|
97 | this._spacingAfterNameExcerpt,
|
98 | this._closingDelimiterExcerpt
|
99 | ];
|
100 | };
|
101 | return DocHtmlEndTag;
|
102 | }(DocNode_1.DocNode));
|
103 | exports.DocHtmlEndTag = DocHtmlEndTag;
|
104 |
|
105 | var TSDocEmitter_1 = require("../emitters/TSDocEmitter");
|
106 |
|
\ | No newline at end of file |