UNPKG

1.03 kBJavaScriptView Raw
1"use strict";
2// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
3// See LICENSE in the project root for license information.
4Object.defineProperty(exports, "__esModule", { value: true });
5exports.DocHeading = void 0;
6const tsdoc_1 = require("@microsoft/tsdoc");
7/**
8 * Represents a section header similar to an HTML `<h1>` or `<h2>` element.
9 */
10class DocHeading extends tsdoc_1.DocNode {
11 /**
12 * Don't call this directly. Instead use {@link TSDocParser}
13 * @internal
14 */
15 constructor(parameters) {
16 super(parameters);
17 this.title = parameters.title;
18 this.level = parameters.level !== undefined ? parameters.level : 1;
19 if (this.level < 1 || this.level > 5) {
20 throw new Error('IDocHeadingParameters.level must be a number between 1 and 5');
21 }
22 }
23 /** @override */
24 get kind() {
25 return "Heading" /* CustomDocNodeKind.Heading */;
26 }
27}
28exports.DocHeading = DocHeading;
29//# sourceMappingURL=DocHeading.js.map
\No newline at end of file