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