UNPKG

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