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.DocCodeSpan = void 0;
|
17 | var DocNode_1 = require("./DocNode");
|
18 | var DocExcerpt_1 = require("./DocExcerpt");
|
19 |
|
20 |
|
21 |
|
22 |
|
23 | var DocCodeSpan = (function (_super) {
|
24 | __extends(DocCodeSpan, _super);
|
25 | |
26 |
|
27 |
|
28 |
|
29 | function DocCodeSpan(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.CodeSpan_OpeningDelimiter,
|
35 | content: parameters.openingDelimiterExcerpt
|
36 | });
|
37 | _this._codeExcerpt = new DocExcerpt_1.DocExcerpt({
|
38 | configuration: _this.configuration,
|
39 | excerptKind: DocExcerpt_1.ExcerptKind.CodeSpan_Code,
|
40 | content: parameters.codeExcerpt
|
41 | });
|
42 | _this._closingDelimiterExcerpt = new DocExcerpt_1.DocExcerpt({
|
43 | configuration: _this.configuration,
|
44 | excerptKind: DocExcerpt_1.ExcerptKind.CodeSpan_ClosingDelimiter,
|
45 | content: parameters.closingDelimiterExcerpt
|
46 | });
|
47 | }
|
48 | else {
|
49 | _this._code = parameters.code;
|
50 | }
|
51 | return _this;
|
52 | }
|
53 | Object.defineProperty(DocCodeSpan.prototype, "kind", {
|
54 |
|
55 | get: function () {
|
56 | return DocNode_1.DocNodeKind.CodeSpan;
|
57 | },
|
58 | enumerable: false,
|
59 | configurable: true
|
60 | });
|
61 | Object.defineProperty(DocCodeSpan.prototype, "code", {
|
62 | |
63 |
|
64 |
|
65 | get: function () {
|
66 | if (this._code === undefined) {
|
67 | this._code = this._codeExcerpt.content.toString();
|
68 | }
|
69 | return this._code;
|
70 | },
|
71 | enumerable: false,
|
72 | configurable: true
|
73 | });
|
74 |
|
75 | DocCodeSpan.prototype.onGetChildNodes = function () {
|
76 | return [this._openingDelimiterExcerpt, this._codeExcerpt, this._closingDelimiterExcerpt];
|
77 | };
|
78 | return DocCodeSpan;
|
79 | }(DocNode_1.DocNode));
|
80 | exports.DocCodeSpan = DocCodeSpan;
|
81 |
|
\ | No newline at end of file |