UNPKG

2.35 kBTypeScriptView Raw
1import { DocNode, DocNodeKind, IDocNodeParameters, IDocNodeParsedParameters } from './DocNode';
2import { DocHtmlAttribute } from './DocHtmlAttribute';
3import { TokenSequence } from '../parser/TokenSequence';
4/**
5 * Constructor parameters for {@link DocHtmlStartTag}.
6 */
7export interface IDocHtmlStartTagParameters extends IDocNodeParameters {
8 name: string;
9 spacingAfterName?: string;
10 htmlAttributes?: DocHtmlAttribute[];
11 selfClosingTag?: boolean;
12}
13/**
14 * Constructor parameters for {@link DocHtmlStartTag}.
15 */
16export interface IDocHtmlStartTagParsedParameters extends IDocNodeParsedParameters {
17 openingDelimiterExcerpt: TokenSequence;
18 nameExcerpt: TokenSequence;
19 spacingAfterNameExcerpt?: TokenSequence;
20 htmlAttributes: DocHtmlAttribute[];
21 selfClosingTag: boolean;
22 closingDelimiterExcerpt: TokenSequence;
23}
24/**
25 * Represents an HTML start tag, which may or may not be self-closing.
26 *
27 * Example: `<a href="#" />`
28 */
29export declare class DocHtmlStartTag extends DocNode {
30 private readonly _openingDelimiterExcerpt;
31 private _name;
32 private readonly _nameExcerpt;
33 private _spacingAfterName;
34 private readonly _spacingAfterNameExcerpt;
35 private readonly _htmlAttributes;
36 private readonly _selfClosingTag;
37 private readonly _closingDelimiterExcerpt;
38 /**
39 * Don't call this directly. Instead use {@link TSDocParser}
40 * @internal
41 */
42 constructor(parameters: IDocHtmlStartTagParameters | IDocHtmlStartTagParsedParameters);
43 /** @override */
44 get kind(): DocNodeKind | string;
45 /**
46 * The HTML element name.
47 */
48 get name(): string;
49 /**
50 * The HTML attributes belonging to this HTML element.
51 */
52 get htmlAttributes(): ReadonlyArray<DocHtmlAttribute>;
53 /**
54 * If true, then the HTML tag ends with `/>` instead of `>`.
55 */
56 get selfClosingTag(): boolean;
57 /**
58 * Explicit whitespace that a renderer should insert after the HTML element name.
59 * If undefined, then the renderer can use a formatting rule to generate appropriate spacing.
60 */
61 get spacingAfterName(): string | undefined;
62 /**
63 * Generates the HTML for this tag.
64 */
65 emitAsHtml(): string;
66 /** @override */
67 protected onGetChildNodes(): ReadonlyArray<DocNode | undefined>;
68}
69//# sourceMappingURL=DocHtmlStartTag.d.ts.map
\No newline at end of file