-
Notifications
You must be signed in to change notification settings - Fork 682
Expand file tree
/
Copy pathDocEmphasisSpan.ts
More file actions
34 lines (28 loc) · 1.03 KB
/
DocEmphasisSpan.ts
File metadata and controls
34 lines (28 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
// See LICENSE in the project root for license information.
import { type DocNode, DocNodeContainer, type IDocNodeContainerParameters } from '@microsoft/tsdoc';
import { CustomDocNodeKind } from './CustomDocNodeKind.ts';
/**
* Constructor parameters for {@link DocEmphasisSpan}.
*/
export interface IDocEmphasisSpanParameters extends IDocNodeContainerParameters {
bold?: boolean;
italic?: boolean;
}
/**
* Represents a span of text that is styled with CommonMark emphasis (italics), strong emphasis (boldface),
* or both.
*/
export class DocEmphasisSpan extends DocNodeContainer {
public readonly bold: boolean;
public readonly italic: boolean;
public constructor(parameters: IDocEmphasisSpanParameters, children?: DocNode[]) {
super(parameters, children);
this.bold = !!parameters.bold;
this.italic = !!parameters.italic;
}
/** @override */
public get kind(): string {
return CustomDocNodeKind.EmphasisSpan;
}
}