File tree Expand file tree Collapse file tree 5 files changed +14
-17
lines changed
packages/typedoc-plugin-markdown/src/theme/context/partials Expand file tree Collapse file tree 5 files changed +14
-17
lines changed Original file line number Diff line number Diff line change 66} from '@plugin/theme/lib/index.js' ;
77import {
88 ContainerReflection ,
9- DeclarationReflection ,
109 ReflectionGroup ,
1110 ReflectionKind ,
1211} from 'typedoc' ;
@@ -54,7 +53,7 @@ export function body(
5453 } else {
5554 md . push (
5655 this . partials . members (
57- group . children as DeclarationReflection [ ] ,
56+ group . children . filter ( child => child . isDeclaration ( ) ) ,
5857 {
5958 headingLevel : options . headingLevel ,
6059 } ,
@@ -83,9 +82,9 @@ export function body(
8382 children : model . children ,
8483 } as ReflectionGroup ) ,
8584 ) ;
86- } else {
85+ } else if ( model . children ) {
8786 md . push (
88- this . partials . members ( model . children as DeclarationReflection [ ] , {
87+ this . partials . members ( model . children , {
8988 headingLevel : options . headingLevel ,
9089 } ) ,
9190 ) ;
Original file line number Diff line number Diff line change 55 sortNoneSectionFirst ,
66} from '@plugin/theme/lib/index.js' ;
77import {
8- DeclarationReflection ,
98 ReflectionCategory ,
109 ReflectionKind ,
1110} from 'typedoc' ;
@@ -26,9 +25,9 @@ export function categories(
2625 }
2726 md . push ( this . partials . groupIndex ( category ) ) ;
2827 } else {
29- const categoryChildren = category . children ? .filter (
28+ const categoryChildren = category . children . filter (
3029 ( child ) => child . kind !== ReflectionKind . Constructor ,
31- ) ;
30+ ) . filter ( child => child . isDeclaration ( ) ) ;
3231 if ( categoryChildren . length ) {
3332 if ( ! isNoneSection ( category ) ) {
3433 md . push ( heading ( options . headingLevel , category . title ) ) ;
@@ -37,7 +36,7 @@ export function categories(
3736 md . push ( this . helpers . getCommentParts ( category . description ) ) ;
3837 }
3938 md . push (
40- this . partials . members ( categoryChildren as DeclarationReflection [ ] , {
39+ this . partials . members ( categoryChildren , {
4140 headingLevel : isNoneSection ( category )
4241 ? options . headingLevel
4342 : options . headingLevel + 1 ,
Original file line number Diff line number Diff line change 66} from '@plugin/theme/lib/index.js' ;
77import {
88 ContainerReflection ,
9- DeclarationReflection ,
109 i18n ,
1110 ProjectReflection ,
1211 ReflectionKind ,
@@ -97,7 +96,7 @@ export function groups(
9796 ) {
9897 md . push (
9998 this . partials . propertiesTable (
100- group . children as DeclarationReflection [ ] ,
99+ group . children . filter ( child => child . isDeclaration ( ) ) ,
101100 {
102101 isEventProps,
103102 kind : options . kind ,
@@ -107,13 +106,13 @@ export function groups(
107106 } else if ( isEnumGroup && this . helpers . useTableFormat ( 'enums' ) ) {
108107 md . push (
109108 this . partials . enumMembersTable (
110- group . children as DeclarationReflection [ ] ,
109+ group . children . filter ( child => child . isDeclaration ( ) ) ,
111110 ) ,
112111 ) ;
113112 } else {
114113 if ( group . children ) {
115114 md . push (
116- this . partials . members ( group . children as DeclarationReflection [ ] , {
115+ this . partials . members ( group . children . filter ( child => child . isDeclaration ( ) ) , {
117116 headingLevel : isNoneSection ( group )
118117 ? options . headingLevel
119118 : options . headingLevel + 1 ,
Original file line number Diff line number Diff line change @@ -14,8 +14,8 @@ export function members(
1414 }
1515 return true ;
1616 } ;
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 ) => {
1919 md . push (
2020 this . partials . memberContainer ( item , {
2121 headingLevel : options . headingLevel ,
Original file line number Diff line number Diff line change @@ -19,18 +19,18 @@ export function groupIndex(group: ReflectionGroup | ReflectionCategory) {
1919 if ( this . options . getValue ( 'indexFormat' ) . toLowerCase ( ) . includes ( 'table' ) ) {
2020 return getGroupIndexTable (
2121 this ,
22- group . children as DeclarationReflection [ ] | DocumentReflection [ ] ,
22+ group . children ,
2323 ) ;
2424 }
2525 return getGroupIndexList (
2626 this ,
27- group . children as DeclarationReflection [ ] | DocumentReflection [ ] ,
27+ group . children ,
2828 ) ;
2929}
3030
3131export function getGroupIndexList (
3232 context : MarkdownThemeContext ,
33- children : DeclarationReflection [ ] | DocumentReflection [ ] ,
33+ children : ( DeclarationReflection | DocumentReflection ) [ ] ,
3434) {
3535 const filteredChildren =
3636 children
You can’t perform that action at this time.
0 commit comments