UNPKG

2.47 kBJavaScriptView Raw
1"use strict";
2var __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})();
15Object.defineProperty(exports, "__esModule", { value: true });
16exports.DocSoftBreak = void 0;
17var DocNode_1 = require("./DocNode");
18var DocExcerpt_1 = require("./DocExcerpt");
19/**
20 * Instructs a renderer to insert an explicit newline in the output.
21 * (Normally the renderer uses a formatting rule to determine where
22 * lines should wrap.)
23 *
24 * @remarks
25 * In HTML, a soft break is represented as an ASCII newline character (which does not
26 * affect the web browser's view), whereas the hard break is the `<br />` element
27 * (which starts a new line in the web browser's view).
28 *
29 * TSDoc follows the same conventions, except the renderer avoids emitting
30 * two empty lines (because that could start a new CommonMark paragraph).
31 */
32var DocSoftBreak = /** @class */ (function (_super) {
33 __extends(DocSoftBreak, _super);
34 /**
35 * Don't call this directly. Instead use {@link TSDocParser}
36 * @internal
37 */
38 function DocSoftBreak(parameters) {
39 var _this = _super.call(this, parameters) || this;
40 if (DocNode_1.DocNode.isParsedParameters(parameters)) {
41 _this._softBreakExcerpt = new DocExcerpt_1.DocExcerpt({
42 configuration: _this.configuration,
43 excerptKind: DocExcerpt_1.ExcerptKind.SoftBreak,
44 content: parameters.softBreakExcerpt
45 });
46 }
47 return _this;
48 }
49 Object.defineProperty(DocSoftBreak.prototype, "kind", {
50 /** @override */
51 get: function () {
52 return DocNode_1.DocNodeKind.SoftBreak;
53 },
54 enumerable: false,
55 configurable: true
56 });
57 /** @override */
58 DocSoftBreak.prototype.onGetChildNodes = function () {
59 return [this._softBreakExcerpt];
60 };
61 return DocSoftBreak;
62}(DocNode_1.DocNode));
63exports.DocSoftBreak = DocSoftBreak;
64//# sourceMappingURL=DocSoftBreak.js.map
\No newline at end of file