44import * as tsdoc from '@microsoft/tsdoc' ;
55import { ExtractorMessageId } from './ExtractorMessageId' ;
66
7+ /**
8+ * Specifies a category of messages for use with {@link ExtractorMessage}.
9+ * @public
10+ */
711export const enum ExtractorMessageCategory {
8- Compiler ,
9- TSDoc ,
10- Extractor
12+ /**
13+ * Messages originating from the TypeScript compiler.
14+ *
15+ * @remarks
16+ * These strings begin with the prefix "TS" and have a numeric error code.
17+ * Example: `TS2551`
18+ */
19+ Compiler = 'Compiler' ,
20+
21+ /**
22+ * Messages related to parsing of TSDoc comments.
23+ *
24+ * @remarks
25+ * These strings begin with the prefix "tsdoc-".
26+ * Example: `tsdoc-link-tag-unescaped-text`
27+ */
28+ TSDoc = 'TSDoc' ,
29+
30+ /**
31+ * Messages related to API Extractor's analysis.
32+ *
33+ * @remarks
34+ * These strings begin with the prefix "ae-".
35+ * Example: `ae-extra-release-tag`
36+ */
37+ Extractor = 'Extractor'
1138}
1239
40+ /**
41+ * Constructor options for `ExtractorMessage`.
42+ */
1343export interface IExtractorMessageOptions {
1444 category : ExtractorMessageCategory ;
1545 messageId : tsdoc . TSDocMessageId | ExtractorMessageId | string ;
@@ -20,21 +50,45 @@ export interface IExtractorMessageOptions {
2050}
2151
2252/**
23- * Represents an error or warning that occurred during parsing.
53+ * This object is used to report an error or warning that occurred during API Extractor's analysis.
54+ *
55+ * @public
2456 */
2557export class ExtractorMessage {
58+ /**
59+ * The category of issue.
60+ */
2661 public readonly category : ExtractorMessageCategory ;
2762
63+ /**
64+ * A text string that uniquely identifies the issue type. This identifier can be used to suppress
65+ * or configure the reporting of issues, and also to search for help about an issue.
66+ */
2867 public readonly messageId : tsdoc . TSDocMessageId | ExtractorMessageId | string ;
2968
69+ /**
70+ * The text description of this issue.
71+ */
3072 public readonly text : string ;
3173
74+ /**
75+ * The absolute path to the affected input source file, if there is one.
76+ */
3277 public readonly sourceFilePath : string | undefined ;
3378
79+ /**
80+ * The line number where the issue occurred in the input source file. This is not used if `sourceFilePath`
81+ * is undefined.
82+ */
3483 public readonly sourceFileLine : number | undefined ;
3584
85+ /**
86+ * The column number where the issue occurred in the input source file. This is not used if `sourceFilePath`
87+ * is undefined.
88+ */
3689 public readonly sourceFileColumn : number | undefined ;
3790
91+ /** @internal */
3892 public constructor ( options : IExtractorMessageOptions ) {
3993 this . category = options . category ;
4094 this . messageId = options . messageId ;
0 commit comments