UNPKG

2.05 kBTypeScriptView Raw
1import { DocNodeKind, DocNode, IDocNodeParsedParameters } from './DocNode';
2import { TokenSequence } from '../parser/TokenSequence';
3import { TSDocMessageId } from '../parser/TSDocMessageId';
4/**
5 * Constructor parameters for {@link DocErrorText}.
6 */
7export interface IDocErrorTextParsedParameters extends IDocNodeParsedParameters {
8 textExcerpt: TokenSequence;
9 messageId: TSDocMessageId;
10 errorMessage: string;
11 errorLocation: TokenSequence;
12}
13/**
14 * Represents a span of text that contained invalid markup.
15 * The characters should be rendered as plain text.
16 */
17export declare class DocErrorText extends DocNode {
18 private _text;
19 private readonly _textExcerpt;
20 private readonly _messageId;
21 private readonly _errorMessage;
22 private readonly _errorLocation;
23 /**
24 * Don't call this directly. Instead use {@link TSDocParser}
25 * @internal
26 */
27 constructor(parameters: IDocErrorTextParsedParameters);
28 /** @override */
29 get kind(): DocNodeKind | string;
30 /**
31 * The characters that should be rendered as plain text because they
32 * could not be parsed successfully.
33 */
34 get text(): string;
35 get textExcerpt(): TokenSequence | undefined;
36 /**
37 * The TSDoc error message identifier.
38 */
39 get messageId(): TSDocMessageId;
40 /**
41 * A description of why the character could not be parsed.
42 */
43 get errorMessage(): string;
44 /**
45 * The range of characters that caused the error. In general these may be
46 * somewhat farther ahead in the input stream from the DocErrorText node itself.
47 *
48 * @remarks
49 * For example, for the malformed HTML tag `<a href="123" @ /a>`, the DocErrorText node
50 * will correspond to the `<` character that looked like an HTML tag, whereas the
51 * error location might be the `@` character that caused the trouble.
52 */
53 get errorLocation(): TokenSequence;
54 /** @override */
55 protected onGetChildNodes(): ReadonlyArray<DocNode | undefined>;
56}
57//# sourceMappingURL=DocErrorText.d.ts.map
\No newline at end of file