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