@@ -203,26 +203,6 @@ export class CommentPlugin extends ConverterComponent {
203203 this . removeExcludedTags ( comment ) ;
204204 }
205205
206- private getHiddenItems ( reflection : Reflection ) {
207- const hiddenItems = new Set < Reflection > ( ) ;
208- if ( reflection . kindOf ( ReflectionKind . FunctionOrMethod ) ) {
209- const decl = reflection as DeclarationReflection ;
210- if ( decl . signatures ) {
211- for ( const sig of decl . signatures ) {
212- if ( ! sig . comment ) {
213- hiddenItems . add ( sig ) ;
214- }
215- }
216- }
217- if ( ! decl . signatures ?. some ( ( sig ) => sig . comment ) ) {
218- hiddenItems . add ( decl ) ;
219- }
220- } else {
221- hiddenItems . add ( reflection ) ;
222- }
223- return hiddenItems || [ ] ;
224- }
225-
226206 /**
227207 * Triggered when the converter begins resolving a project.
228208 *
@@ -245,31 +225,29 @@ export class CommentPlugin extends ConverterComponent {
245225 }
246226
247227 if ( this . isHidden ( ref ) ) {
248- this . getHiddenItems ( ref ) . forEach ( ( item ) => hidden . add ( item ) ) ;
228+ hidden . add ( ref ) ;
249229 }
250230 }
251231 hidden . forEach ( ( reflection ) => project . removeReflection ( reflection ) ) ;
252232
253233 // remove functions with empty signatures after their signatures have been removed
254234 const [ allRemoved , someRemoved ] = partition (
255- filterMap ( hidden , ( reflection ) =>
256- reflection . parent ?. kindOf (
257- ReflectionKind . FunctionOrMethod | ReflectionKind . Constructor
258- )
259- ? reflection . parent
260- : void 0
261- ) as DeclarationReflection [ ] ,
262- ( method ) => method . signatures ? .length === 0
235+ unique (
236+ filterMap ( hidden , ( reflection ) =>
237+ reflection . parent ?. kindOf ( ReflectionKind . SignatureContainer )
238+ ? reflection . parent
239+ : void 0
240+ ) as DeclarationReflection [ ]
241+ ) ,
242+ ( method ) => method . getNonIndexSignatures ( ) . length === 0
263243 ) ;
264244 allRemoved . forEach ( ( reflection ) => {
265245 project . removeReflection ( reflection ) ;
266246 } ) ;
267247 someRemoved . forEach ( ( reflection ) => {
268- reflection . sources = unique (
269- reflection . signatures ! . flatMap < SourceReference > (
270- ( s ) => s . sources ?? [ ]
271- )
272- ) ;
248+ reflection . sources = reflection
249+ . getNonIndexSignatures ( )
250+ . flatMap < SourceReference > ( ( s ) => s . sources ?? [ ] ) ;
273251 } ) ;
274252 }
275253
@@ -425,26 +403,36 @@ export class CommentPlugin extends ConverterComponent {
425403
426404 if ( ! comment ) {
427405 if ( this . excludeNotDocumented ) {
428- // Only allow excludeNotDocumented to exclude root level reflections
429- if ( ! ( reflection instanceof DeclarationReflection ) ) {
406+ // Don't let excludeNotDocumented remove parameters.
407+ if (
408+ ! ( reflection instanceof DeclarationReflection ) &&
409+ ! ( reflection instanceof SignatureReflection )
410+ ) {
430411 return false ;
431412 }
432413
433414 // excludeNotDocumented should hide a module only if it has no visible children
434415 if ( reflection . kindOf ( ReflectionKind . SomeModule ) ) {
435- if ( ! reflection . children ) {
416+ if ( ! ( reflection as DeclarationReflection ) . children ) {
436417 return true ;
437418 }
438- return reflection . children . every ( ( child ) =>
439- this . isHidden ( child )
440- ) ;
419+ return (
420+ reflection as DeclarationReflection
421+ ) . children ! . every ( ( child ) => this . isHidden ( child ) ) ;
441422 }
442423
443424 // enum members should all be included if the parent enum is documented
444425 if ( reflection . kind === ReflectionKind . EnumMember ) {
445426 return false ;
446427 }
447428
429+ // signature containers should only be hidden if all their signatures are hidden
430+ if ( reflection . kindOf ( ReflectionKind . SignatureContainer ) ) {
431+ return ( reflection as DeclarationReflection )
432+ . getAllSignatures ( )
433+ . every ( ( child ) => this . isHidden ( child ) ) ;
434+ }
435+
448436 // excludeNotDocumented should never hide parts of "type" reflections
449437 return inTypeLiteral ( reflection ) === false ;
450438 }
0 commit comments