UNPKG

1.39 kBTypeScriptView Raw
1import { TextRange } from './TextRange';
2import { TokenSequence } from './TokenSequence';
3import { DocNode } from '../nodes/DocNode';
4import { TSDocMessageId } from './TSDocMessageId';
5/**
6 * Constructor parameters for {@link ParserMessage}.
7 */
8export interface IParserMessageParameters {
9 messageId: TSDocMessageId;
10 messageText: string;
11 textRange: TextRange;
12 tokenSequence?: TokenSequence;
13 docNode?: DocNode;
14}
15/**
16 * Represents an error or warning that occurred during parsing.
17 */
18export declare class ParserMessage {
19 /**
20 * A string that uniquely identifies the messages reported by the TSDoc parser.
21 */
22 readonly messageId: TSDocMessageId;
23 /**
24 * The message text without the default prefix that shows line/column information.
25 */
26 readonly unformattedText: string;
27 readonly textRange: TextRange;
28 readonly tokenSequence: TokenSequence | undefined;
29 readonly docNode: DocNode | undefined;
30 private _text;
31 constructor(parameters: IParserMessageParameters);
32 /**
33 * Generates a line/column prefix. Example with line=2 and column=5
34 * and message="An error occurred":
35 * ```
36 * "(2,5): An error occurred"
37 * ```
38 */
39 private static _formatMessageText;
40 /**
41 * The message text.
42 */
43 get text(): string;
44 toString(): string;
45}
46//# sourceMappingURL=ParserMessage.d.ts.map
\No newline at end of file