@@ -20,6 +20,7 @@ import {
20
20
} from '../common/dgeni-definitions' ;
21
21
import { getDirectiveMetadata } from '../common/directive-metadata' ;
22
22
import { normalizeFunctionParameters } from '../common/normalize-function-parameters' ;
23
+ import { isPublicDoc } from '../common/private-docs' ;
23
24
import { getInputBindingData , getOutputBindingData } from '../common/property-bindings' ;
24
25
import { sortCategorizedMethodMembers , sortCategorizedPropertyMembers } from '../common/sort-members' ;
25
26
@@ -37,21 +38,16 @@ export class Categorizer implements Processor {
37
38
$runBefore = [ 'docs-processed' ] ;
38
39
39
40
$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 ) ) ;
43
43
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 ) ) ;
47
46
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 ) ) ;
51
48
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 ) ) ;
55
51
}
56
52
57
53
/**
@@ -60,13 +56,12 @@ export class Categorizer implements Processor {
60
56
*/
61
57
private _decorateClassLikeDoc ( classLikeDoc : CategorizedClassLikeDoc ) {
62
58
// 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 [ ] ;
66
61
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 [ ] ;
70
65
71
66
// Special decorations for real class documents that don't apply for interfaces.
72
67
if ( classLikeDoc . docType === 'class' ) {
@@ -94,9 +89,16 @@ export class Categorizer implements Processor {
94
89
// Classes can only extend a single class. This means that there can't be multiple extend
95
90
// clauses for the Dgeni document. To make the template syntax simpler and more readable,
96
91
// 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 ;
98
93
classDoc . directiveMetadata = getDirectiveMetadata ( classDoc ) ;
99
94
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
+
100
102
// Categorize the current visited classDoc into its Angular type.
101
103
if ( isDirective ( classDoc ) && classDoc . directiveMetadata ) {
102
104
classDoc . isDirective = true ;
@@ -151,7 +153,8 @@ export class Categorizer implements Processor {
151
153
decorateDeprecatedDoc ( propertyDoc ) ;
152
154
153
155
const metadata = propertyDoc . containerDoc . docType === 'class' ?
154
- ( propertyDoc . containerDoc as CategorizedClassDoc ) . directiveMetadata : null ;
156
+ ( propertyDoc . containerDoc as CategorizedClassDoc ) . directiveMetadata :
157
+ null ;
155
158
156
159
const inputMetadata = metadata ? getInputBindingData ( propertyDoc , metadata ) : null ;
157
160
const outputMetadata = metadata ? getOutputBindingData ( propertyDoc , metadata ) : null ;
@@ -172,7 +175,6 @@ export class Categorizer implements Processor {
172
175
173
176
classDoc . methods . forEach ( ( methodDoc , index ) => {
174
177
if ( methodDoc . overloads . length > 0 ) {
175
-
176
178
// Add each method overload to the methods that will be shown in the docs.
177
179
// Note that we cannot add the overloads immediately to the methods array because
178
180
// that would cause the iteration to visit the new overloads.
0 commit comments