@@ -259,7 +259,7 @@ export class ApiReportGenerator {
259
259
) : void {
260
260
// Should we process this declaration at all?
261
261
// eslint-disable-next-line no-bitwise
262
- if ( ( astDeclaration . modifierFlags & ts . ModifierFlags . Private ) !== 0 ) {
262
+ if ( ! ApiReportGenerator . _shouldIncludeInReport ( astDeclaration ) ) {
263
263
span . modification . skipAll ( ) ;
264
264
return ;
265
265
}
@@ -402,23 +402,27 @@ export class ApiReportGenerator {
402
402
astDeclaration
403
403
) ;
404
404
405
- if ( sortChildren ) {
406
- span . modification . sortChildren = true ;
407
- child . modification . sortKey = Collector . getSortKeyIgnoringUnderscore (
408
- childAstDeclaration . astSymbol . localName
409
- ) ;
410
- }
405
+ if ( ApiReportGenerator . _shouldIncludeInReport ( childAstDeclaration ) ) {
406
+ if ( sortChildren ) {
407
+ span . modification . sortChildren = true ;
408
+ child . modification . sortKey = Collector . getSortKeyIgnoringUnderscore (
409
+ childAstDeclaration . astSymbol . localName
410
+ ) ;
411
+ }
411
412
412
- if ( ! insideTypeLiteral ) {
413
- const messagesToReport : ExtractorMessage [ ] =
414
- collector . messageRouter . fetchAssociatedMessagesForReviewFile ( childAstDeclaration ) ;
415
- const aedocSynopsis : string = ApiReportGenerator . _getAedocSynopsis (
416
- collector ,
417
- childAstDeclaration ,
418
- messagesToReport
419
- ) ;
413
+ if ( ! insideTypeLiteral ) {
414
+ const messagesToReport : ExtractorMessage [ ] =
415
+ collector . messageRouter . fetchAssociatedMessagesForReviewFile ( childAstDeclaration ) ;
420
416
421
- child . modification . prefix = aedocSynopsis + child . modification . prefix ;
417
+ // NOTE: This generates ae-undocumented messages as a side effect
418
+ const aedocSynopsis : string = ApiReportGenerator . _getAedocSynopsis (
419
+ collector ,
420
+ childAstDeclaration ,
421
+ messagesToReport
422
+ ) ;
423
+
424
+ child . modification . prefix = aedocSynopsis + child . modification . prefix ;
425
+ }
422
426
}
423
427
}
424
428
@@ -427,6 +431,12 @@ export class ApiReportGenerator {
427
431
}
428
432
}
429
433
434
+ private static _shouldIncludeInReport ( astDeclaration : AstDeclaration ) : boolean {
435
+ // Private declarations are not included in the API report
436
+ // eslint-disable-next-line no-bitwise
437
+ return ( astDeclaration . modifierFlags & ts . ModifierFlags . Private ) === 0 ;
438
+ }
439
+
430
440
/**
431
441
* For declarations marked as `@preapproved`, this is used instead of _modifySpan().
432
442
*/
0 commit comments