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.DocExcerpt = exports.ExcerptKind = void 0;
|
17 | var DocNode_1 = require("./DocNode");
|
18 | var Token_1 = require("../parser/Token");
|
19 |
|
20 |
|
21 |
|
22 |
|
23 | var ExcerptKind;
|
24 | (function (ExcerptKind) {
|
25 | ExcerptKind["Spacing"] = "Spacing";
|
26 | ExcerptKind["BlockTag"] = "BlockTag";
|
27 | ExcerptKind["CodeSpan_OpeningDelimiter"] = "CodeSpan_OpeningDelimiter";
|
28 | ExcerptKind["CodeSpan_Code"] = "CodeSpan_Code";
|
29 | ExcerptKind["CodeSpan_ClosingDelimiter"] = "CodeSpan_ClosingDelimiter";
|
30 | ExcerptKind["DeclarationReference_PackageName"] = "DeclarationReference_PackageName";
|
31 | ExcerptKind["DeclarationReference_ImportPath"] = "DeclarationReference_ImportPath";
|
32 | ExcerptKind["DeclarationReference_ImportHash"] = "DeclarationReference_ImportHash";
|
33 | |
34 |
|
35 |
|
36 |
|
37 | ExcerptKind["ErrorText"] = "ErrorText";
|
38 | |
39 |
|
40 |
|
41 |
|
42 |
|
43 | ExcerptKind["NonstandardText"] = "NonstandardText";
|
44 | ExcerptKind["EscapedText"] = "EscapedText";
|
45 | ExcerptKind["FencedCode_OpeningFence"] = "FencedCode_OpeningFence";
|
46 | ExcerptKind["FencedCode_Language"] = "FencedCode_Language";
|
47 | ExcerptKind["FencedCode_Code"] = "FencedCode_Code";
|
48 | ExcerptKind["FencedCode_ClosingFence"] = "FencedCode_ClosingFence";
|
49 | ExcerptKind["HtmlAttribute_Name"] = "HtmlAttribute_Name";
|
50 | ExcerptKind["HtmlAttribute_Equals"] = "HtmlAttribute_Equals";
|
51 | ExcerptKind["HtmlAttribute_Value"] = "HtmlAttribute_Value";
|
52 | ExcerptKind["HtmlEndTag_OpeningDelimiter"] = "HtmlEndTag_OpeningDelimiter";
|
53 | ExcerptKind["HtmlEndTag_Name"] = "HtmlEndTag_Name";
|
54 | ExcerptKind["HtmlEndTag_ClosingDelimiter"] = "HtmlEndTag_ClosingDelimiter";
|
55 | ExcerptKind["HtmlStartTag_OpeningDelimiter"] = "HtmlStartTag_OpeningDelimiter";
|
56 | ExcerptKind["HtmlStartTag_Name"] = "HtmlStartTag_Name";
|
57 | ExcerptKind["HtmlStartTag_ClosingDelimiter"] = "HtmlStartTag_ClosingDelimiter";
|
58 | ExcerptKind["InlineTag_OpeningDelimiter"] = "InlineTag_OpeningDelimiter";
|
59 | ExcerptKind["InlineTag_TagName"] = "InlineTag_TagName";
|
60 | ExcerptKind["InlineTag_TagContent"] = "InlineTag_TagContent";
|
61 | ExcerptKind["InlineTag_ClosingDelimiter"] = "InlineTag_ClosingDelimiter";
|
62 | ExcerptKind["LinkTag_UrlDestination"] = "LinkTag_UrlDestination";
|
63 | ExcerptKind["LinkTag_Pipe"] = "LinkTag_Pipe";
|
64 | ExcerptKind["LinkTag_LinkText"] = "LinkTag_LinkText";
|
65 | ExcerptKind["MemberIdentifier_LeftQuote"] = "MemberIdentifier_LeftQuote";
|
66 | ExcerptKind["MemberIdentifier_Identifier"] = "MemberIdentifier_Identifier";
|
67 | ExcerptKind["MemberIdentifier_RightQuote"] = "MemberIdentifier_RightQuote";
|
68 | ExcerptKind["MemberReference_Dot"] = "MemberReference_Dot";
|
69 | ExcerptKind["MemberReference_LeftParenthesis"] = "MemberReference_LeftParenthesis";
|
70 | ExcerptKind["MemberReference_Colon"] = "MemberReference_Colon";
|
71 | ExcerptKind["MemberReference_RightParenthesis"] = "MemberReference_RightParenthesis";
|
72 | ExcerptKind["MemberSelector"] = "MemberSelector";
|
73 | ExcerptKind["DocMemberSymbol_LeftBracket"] = "DocMemberSymbol_LeftBracket";
|
74 | ExcerptKind["DocMemberSymbol_RightBracket"] = "DocMemberSymbol_RightBracket";
|
75 | ExcerptKind["ParamBlock_ParameterName"] = "ParamBlock_ParameterName";
|
76 | ExcerptKind["ParamBlock_Hyphen"] = "ParamBlock_Hyphen";
|
77 | ExcerptKind["PlainText"] = "PlainText";
|
78 | ExcerptKind["SoftBreak"] = "SoftBreak";
|
79 | })(ExcerptKind = exports.ExcerptKind || (exports.ExcerptKind = {}));
|
80 |
|
81 |
|
82 |
|
83 |
|
84 |
|
85 |
|
86 |
|
87 |
|
88 |
|
89 |
|
90 |
|
91 |
|
92 |
|
93 |
|
94 | var DocExcerpt = (function (_super) {
|
95 | __extends(DocExcerpt, _super);
|
96 | |
97 |
|
98 |
|
99 |
|
100 | function DocExcerpt(parameters) {
|
101 | var _this = _super.call(this, parameters) || this;
|
102 | if (parameters.excerptKind === ExcerptKind.Spacing) {
|
103 | for (var _i = 0, _a = parameters.content.tokens; _i < _a.length; _i++) {
|
104 | var token = _a[_i];
|
105 | switch (token.kind) {
|
106 | case Token_1.TokenKind.Spacing:
|
107 | case Token_1.TokenKind.Newline:
|
108 | case Token_1.TokenKind.EndOfInput:
|
109 | break;
|
110 | default:
|
111 | throw new Error("The excerptKind=Spacing but the range contains a non-whitespace token");
|
112 | }
|
113 | }
|
114 | }
|
115 | _this._excerptKind = parameters.excerptKind;
|
116 | _this._content = parameters.content;
|
117 | return _this;
|
118 | }
|
119 | Object.defineProperty(DocExcerpt.prototype, "kind", {
|
120 |
|
121 | get: function () {
|
122 | return DocNode_1.DocNodeKind.Excerpt;
|
123 | },
|
124 | enumerable: false,
|
125 | configurable: true
|
126 | });
|
127 | Object.defineProperty(DocExcerpt.prototype, "excerptKind", {
|
128 | |
129 |
|
130 |
|
131 | get: function () {
|
132 | return this._excerptKind;
|
133 | },
|
134 | enumerable: false,
|
135 | configurable: true
|
136 | });
|
137 | Object.defineProperty(DocExcerpt.prototype, "content", {
|
138 | |
139 |
|
140 |
|
141 |
|
142 |
|
143 |
|
144 | get: function () {
|
145 | return this._content;
|
146 | },
|
147 | enumerable: false,
|
148 | configurable: true
|
149 | });
|
150 | return DocExcerpt;
|
151 | }(DocNode_1.DocNode));
|
152 | exports.DocExcerpt = DocExcerpt;
|
153 |
|
\ | No newline at end of file |