@@ -267,6 +267,94 @@ export interface IExtractorTsdocMetadataConfig {
267267 tsdocMetadataPath ?: string ;
268268}
269269
270+ /**
271+ * Used with {@link IExtractorMessageRoutingConfig.logLevel}.
272+ *
273+ * @public
274+ */
275+ export const enum ExtractorMessageLogLevel {
276+ /**
277+ * The message will be written to the output log as an error.
278+ *
279+ * @remarks
280+ * Errors cause the build to fail and return a nonzero exit code.
281+ */
282+ Error = 'Error' ,
283+
284+ /**
285+ * The message will be written to the build output as an warning.
286+ * @remarks
287+ * Warnings cause a production build fail and return a nonzero exit code. For a non-production build
288+ * (e.g. using the `--local` option with `api-extractor run`), the warning is displayed but the build will not fail.
289+ */
290+ Warning = 'Warning' ,
291+
292+ /**
293+ * The message will not be reported to the output log.
294+ */
295+ None = 'None'
296+ }
297+
298+ /**
299+ * Configures how API Extractor messages are reported.
300+ *
301+ * @public
302+ */
303+ export interface IExtractorMessageReportingRuleConfig {
304+ /**
305+ * Specifies whether the message should be written to the the tool's output log.
306+ *
307+ * @remarks
308+ * Note that the `addToApiReviewFile` property may supersede this option.
309+ */
310+ logLevel : ExtractorMessageLogLevel ;
311+
312+ /**
313+ * If API Extractor is configured to write an API review file (.api.ts), then the message will be written
314+ * inside that file. If the API review file is NOT being written, then the message is instead logged according
315+ * to the `logLevel` option.
316+ */
317+ addToApiReviewFile : boolean ;
318+ }
319+
320+ /**
321+ * Specifies a table of reporting rules for different message IDs, and also the default rule used for IDs that
322+ * do not appear in the table.
323+ *
324+ * @public
325+ */
326+ export interface IExtractorMessageReportingTableConfig {
327+ /**
328+ * The key is a message ID for the associated type of message, or "default" to specify the default policy.
329+ * For example, the key might be `TS2551` (a compiler message), `tsdoc-link-tag-unescaped-text` (a TSDOc message),
330+ * or `ae-extra-release-tag` (a message related to the API Extractor analysis).
331+ */
332+ [ messageId : string ] : IExtractorMessageReportingRuleConfig ;
333+ }
334+
335+ /**
336+ * Configures how API Extractor reports issues that it encounters.
337+ *
338+ * @public
339+ */
340+ export interface IExtractorMessagesConfig {
341+ /**
342+ * Configures handling of diagnostic messages generating the TypeScript compiler while analyzing the
343+ * input .d.ts files.
344+ */
345+ compilerMessageReporting : IExtractorMessageReportingTableConfig ;
346+
347+ /**
348+ * Configures handling of messages reported by the TSDoc parser when analyzing code comments.
349+ */
350+ tsdocMessageReporting : IExtractorMessageReportingTableConfig ;
351+
352+ /**
353+ * Configures handling of messages reported by API Extractor during its analysis.
354+ */
355+ extractorMessageReporting : IExtractorMessageReportingTableConfig ;
356+ }
357+
270358/**
271359 * Configuration options for the API Extractor tool. These options can be loaded
272360 * from a JSON config file.
@@ -324,6 +412,11 @@ export interface IExtractorConfig {
324412 */
325413 tsdocMetadata ?: IExtractorTsdocMetadataConfig ;
326414
415+ /**
416+ * {@inheritdoc IExtractorMessagesConfig }
417+ */
418+ messages ?: IExtractorMessagesConfig ;
419+
327420 /**
328421 * This option causes the typechecker to be invoked with the --skipLibCheck option. This option is not
329422 * recommended and may cause API Extractor to produce incomplete or incorrect declarations, but it
0 commit comments