@@ -20,6 +20,7 @@ import {
2020} from '../common/dgeni-definitions' ;
2121import { getDirectiveMetadata } from '../common/directive-metadata' ;
2222import { normalizeFunctionParameters } from '../common/normalize-function-parameters' ;
23+ import { isPublicDoc } from '../common/private-docs' ;
2324import { getInputBindingData , getOutputBindingData } from '../common/property-bindings' ;
2425import { sortCategorizedMethodMembers , sortCategorizedPropertyMembers } from '../common/sort-members' ;
2526
@@ -37,21 +38,16 @@ export class Categorizer implements Processor {
3738 $runBefore = [ 'docs-processed' ] ;
3839
3940 $process ( docs : DocCollection ) {
40- docs
41- . filter ( doc => doc . docType === 'class' || doc . docType === 'interface' )
42- . forEach ( doc => this . _decorateClassLikeDoc ( doc ) ) ;
41+ docs . filter ( doc => doc . docType === 'class' || doc . docType === 'interface' )
42+ . forEach ( doc => this . _decorateClassLikeDoc ( doc ) ) ;
4343
44- docs
45- . filter ( doc => doc . docType === 'function' )
46- . forEach ( doc => this . _decorateFunctionExportDoc ( doc ) ) ;
44+ docs . filter ( doc => doc . docType === 'function' )
45+ . forEach ( doc => this . _decorateFunctionExportDoc ( doc ) ) ;
4746
48- docs
49- . filter ( doc => doc . docType === 'const' )
50- . forEach ( doc => this . _decorateConstExportDoc ( doc ) ) ;
47+ docs . filter ( doc => doc . docType === 'const' ) . forEach ( doc => this . _decorateConstExportDoc ( doc ) ) ;
5148
52- docs
53- . filter ( doc => doc . docType === 'type-alias' )
54- . forEach ( doc => this . _decorateTypeAliasExportDoc ( doc ) ) ;
49+ docs . filter ( doc => doc . docType === 'type-alias' )
50+ . forEach ( doc => this . _decorateTypeAliasExportDoc ( doc ) ) ;
5551 }
5652
5753 /**
@@ -60,13 +56,12 @@ export class Categorizer implements Processor {
6056 */
6157 private _decorateClassLikeDoc ( classLikeDoc : CategorizedClassLikeDoc ) {
6258 // Resolve all methods and properties from the classDoc.
63- classLikeDoc . methods = classLikeDoc . members
64- . filter ( isMethod )
65- . filter ( filterDuplicateMembers ) as CategorizedMethodMemberDoc [ ] ;
59+ classLikeDoc . methods = classLikeDoc . members . filter ( isMethod ) . filter ( filterDuplicateMembers ) as
60+ CategorizedMethodMemberDoc [ ] ;
6661
67- classLikeDoc . properties = classLikeDoc . members
68- . filter ( isProperty )
69- . filter ( filterDuplicateMembers ) as CategorizedPropertyMemberDoc [ ] ;
62+ classLikeDoc . properties =
63+ classLikeDoc . members . filter ( isProperty ) . filter ( filterDuplicateMembers ) as
64+ CategorizedPropertyMemberDoc [ ] ;
7065
7166 // Special decorations for real class documents that don't apply for interfaces.
7267 if ( classLikeDoc . docType === 'class' ) {
@@ -94,9 +89,16 @@ export class Categorizer implements Processor {
9489 // Classes can only extend a single class. This means that there can't be multiple extend
9590 // clauses for the Dgeni document. To make the template syntax simpler and more readable,
9691 // store the extended class in a variable.
97- classDoc . extendedDoc = classDoc . extendsClauses [ 0 ] ? classDoc . extendsClauses [ 0 ] . doc ! : null ;
92+ classDoc . extendedDoc = classDoc . extendsClauses [ 0 ] ? classDoc . extendsClauses [ 0 ] . doc ! : undefined ;
9893 classDoc . directiveMetadata = getDirectiveMetadata ( classDoc ) ;
9994
95+ // In case the extended document is not public, we don't want to print it in the
96+ // rendered class API doc. This causes confusion and also is not helpful as the
97+ // extended document is not part of the docs and cannot be viewed.
98+ if ( classDoc . extendedDoc !== undefined && ! isPublicDoc ( classDoc . extendedDoc ) ) {
99+ classDoc . extendedDoc = undefined ;
100+ }
101+
100102 // Categorize the current visited classDoc into its Angular type.
101103 if ( isDirective ( classDoc ) && classDoc . directiveMetadata ) {
102104 classDoc . isDirective = true ;
@@ -151,7 +153,8 @@ export class Categorizer implements Processor {
151153 decorateDeprecatedDoc ( propertyDoc ) ;
152154
153155 const metadata = propertyDoc . containerDoc . docType === 'class' ?
154- ( propertyDoc . containerDoc as CategorizedClassDoc ) . directiveMetadata : null ;
156+ ( propertyDoc . containerDoc as CategorizedClassDoc ) . directiveMetadata :
157+ null ;
155158
156159 const inputMetadata = metadata ? getInputBindingData ( propertyDoc , metadata ) : null ;
157160 const outputMetadata = metadata ? getOutputBindingData ( propertyDoc , metadata ) : null ;
@@ -172,7 +175,6 @@ export class Categorizer implements Processor {
172175
173176 classDoc . methods . forEach ( ( methodDoc , index ) => {
174177 if ( methodDoc . overloads . length > 0 ) {
175-
176178 // Add each method overload to the methods that will be shown in the docs.
177179 // Note that we cannot add the overloads immediately to the methods array because
178180 // that would cause the iteration to visit the new overloads.
0 commit comments