File tree Expand file tree Collapse file tree 5 files changed +14
-15
lines changed
packages/typedoc-plugin-markdown/src/theme/context/partials Expand file tree Collapse file tree 5 files changed +14
-15
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ export function body(
54
54
} else {
55
55
md . push (
56
56
this . partials . members (
57
- group . children as DeclarationReflection [ ] ,
57
+ group . children . filter ( child => child . isDeclaration ( ) ) ,
58
58
{
59
59
headingLevel : options . headingLevel ,
60
60
} ,
@@ -83,9 +83,9 @@ export function body(
83
83
children : model . children ,
84
84
} as ReflectionGroup ) ,
85
85
) ;
86
- } else {
86
+ } else if ( model . children ) {
87
87
md . push (
88
- this . partials . members ( model . children as DeclarationReflection [ ] , {
88
+ this . partials . members ( model . children , {
89
89
headingLevel : options . headingLevel ,
90
90
} ) ,
91
91
) ;
Original file line number Diff line number Diff line change 5
5
sortNoneSectionFirst ,
6
6
} from '@plugin/theme/lib/index.js' ;
7
7
import {
8
- DeclarationReflection ,
9
8
ReflectionCategory ,
10
9
ReflectionKind ,
11
10
} from 'typedoc' ;
@@ -26,9 +25,9 @@ export function categories(
26
25
}
27
26
md . push ( this . partials . groupIndex ( category ) ) ;
28
27
} else {
29
- const categoryChildren = category . children ? .filter (
28
+ const categoryChildren = category . children . filter (
30
29
( child ) => child . kind !== ReflectionKind . Constructor ,
31
- ) ;
30
+ ) . filter ( child => child . isDeclaration ( ) ) ;
32
31
if ( categoryChildren . length ) {
33
32
if ( ! isNoneSection ( category ) ) {
34
33
md . push ( heading ( options . headingLevel , category . title ) ) ;
@@ -37,7 +36,7 @@ export function categories(
37
36
md . push ( this . helpers . getCommentParts ( category . description ) ) ;
38
37
}
39
38
md . push (
40
- this . partials . members ( categoryChildren as DeclarationReflection [ ] , {
39
+ this . partials . members ( categoryChildren , {
41
40
headingLevel : isNoneSection ( category )
42
41
? options . headingLevel
43
42
: options . headingLevel + 1 ,
Original file line number Diff line number Diff line change @@ -97,7 +97,7 @@ export function groups(
97
97
) {
98
98
md . push (
99
99
this . partials . propertiesTable (
100
- group . children as DeclarationReflection [ ] ,
100
+ group . children . filter ( child => child . isDeclaration ( ) ) ,
101
101
{
102
102
isEventProps,
103
103
kind : options . kind ,
@@ -107,13 +107,13 @@ export function groups(
107
107
} else if ( isEnumGroup && this . helpers . useTableFormat ( 'enums' ) ) {
108
108
md . push (
109
109
this . partials . enumMembersTable (
110
- group . children as DeclarationReflection [ ] ,
110
+ group . children . filter ( child => child . isDeclaration ( ) ) ,
111
111
) ,
112
112
) ;
113
113
} else {
114
114
if ( group . children ) {
115
115
md . push (
116
- this . partials . members ( group . children as DeclarationReflection [ ] , {
116
+ this . partials . members ( group . children . filter ( child => child . isDeclaration ( ) ) , {
117
117
headingLevel : isNoneSection ( group )
118
118
? options . headingLevel
119
119
: options . headingLevel + 1 ,
Original file line number Diff line number Diff line change @@ -14,8 +14,8 @@ export function members(
14
14
}
15
15
return true ;
16
16
} ;
17
- const items = model ? .filter ( ( item ) => ! this . router . hasOwnDocument ( item ) ) ;
18
- items ? .forEach ( ( item , index ) => {
17
+ const items = model . filter ( ( item ) => ! this . router . hasOwnDocument ( item ) ) ;
18
+ items . forEach ( ( item , index ) => {
19
19
md . push (
20
20
this . partials . memberContainer ( item , {
21
21
headingLevel : options . headingLevel ,
Original file line number Diff line number Diff line change @@ -19,18 +19,18 @@ export function groupIndex(group: ReflectionGroup | ReflectionCategory) {
19
19
if ( this . options . getValue ( 'indexFormat' ) . toLowerCase ( ) . includes ( 'table' ) ) {
20
20
return getGroupIndexTable (
21
21
this ,
22
- group . children as DeclarationReflection [ ] | DocumentReflection [ ] ,
22
+ group . children ,
23
23
) ;
24
24
}
25
25
return getGroupIndexList (
26
26
this ,
27
- group . children as DeclarationReflection [ ] | DocumentReflection [ ] ,
27
+ group . children ,
28
28
) ;
29
29
}
30
30
31
31
export function getGroupIndexList (
32
32
context : MarkdownThemeContext ,
33
- children : DeclarationReflection [ ] | DocumentReflection [ ] ,
33
+ children : ( DeclarationReflection | DocumentReflection ) [ ] ,
34
34
) {
35
35
const filteredChildren =
36
36
children
You can’t perform that action at this time.
0 commit comments