@@ -3,7 +3,7 @@ import * as path from 'path';
3
3
import { Component , RendererComponent } from 'typedoc/dist/lib/output/components' ;
4
4
import { ReflectionKind } from 'typedoc/dist/lib/models' ;
5
5
import { FileOperations } from '../utils/file-operations' ;
6
- import { AttributeType } from '../utils/enums/json-keys' ;
6
+ import { getAttributeType } from '../utils/enums/json-keys' ;
7
7
import { Constants } from '../utils/constants' ;
8
8
import { RendererEvent } from 'typedoc/dist/lib/output/events' ;
9
9
import { Parser } from '../utils/parser' ;
@@ -77,6 +77,7 @@ export class RenderComponenet extends RendererComponent {
77
77
case ReflectionKind . Property :
78
78
case ReflectionKind . CallSignature :
79
79
case ReflectionKind . EnumMember :
80
+ case ReflectionKind . Constructor :
80
81
/**
81
82
* Skip reflections with type @ReflectionKind.Function because they are aslo @ReflectionKInd.CallSignature
82
83
* but the handling process here is not appropriate for them.
@@ -88,7 +89,11 @@ export class RenderComponenet extends RendererComponent {
88
89
const parent = this . getParentBasedOnType ( reflection , reflection . kind ) ;
89
90
const parentName = parent . name ;
90
91
const attributeName = reflection . name ;
91
- const attributeData = this . getAttributeData ( parentName , AttributeType [ reflection . kind ] , attributeName ) ;
92
+ console . log ( attributeName ) ;
93
+ if ( ReflectionKind . Constructor === reflection . kind )
94
+ debugger ;
95
+
96
+ const attributeData = this . getAttributeData ( parentName , getAttributeType ( reflection . kind ) , attributeName , reflection . flags . isStatic ) ;
92
97
if ( attributeData ) {
93
98
this . updateComment ( reflection , attributeData ) ;
94
99
}
@@ -101,12 +106,24 @@ export class RenderComponenet extends RendererComponent {
101
106
const funcData = this . globalFuncsData [ funcName ] ;
102
107
this . updateComment ( reflection . signatures [ 0 ] , funcData ) ;
103
108
break ;
109
+ case ReflectionKind . Variable :
110
+ if ( ! this . globalFuncsData ) {
111
+ break ;
112
+ }
113
+ const variableName = reflection . name ;
114
+ const variableData = this . globalFuncsData [ variableName ] ;
115
+ this . updateComment ( reflection , variableData ) ;
116
+ break ;
104
117
case ReflectionKind . GetSignature :
105
118
case ReflectionKind . SetSignature :
106
119
const accessorParent = this . getParentBasedOnType ( reflection , reflection . kind ) ;
107
120
const accessor = reflection . parent ;
108
121
const accessorSignature = reflection . kind ;
109
- const data = this . getAccessorAttributeData ( accessorParent . name , AttributeType [ accessor . kind ] , accessor . name , AttributeType [ accessorSignature ] ) ;
122
+ const data = this . getAccessorAttributeData ( accessorParent . name ,
123
+ getAttributeType ( accessor . kind ) ,
124
+ accessor . name ,
125
+ getAttributeType ( accessorSignature ) ,
126
+ reflection . flags . isStatic ) ;
110
127
if ( data ) {
111
128
this . updateComment ( reflection , data ) ;
112
129
}
@@ -122,15 +139,22 @@ export class RenderComponenet extends RendererComponent {
122
139
}
123
140
}
124
141
125
- private getAttributeData ( parentName , attribute , attributeName ) {
142
+ private getAttributeData ( parentName , attribute , attributeName , isStatic ) {
126
143
const data = this . getAttribute ( parentName , attribute ) ;
144
+
127
145
if ( data ) {
146
+ if ( isStatic ) {
147
+ if ( data [ Constants . STATIC_ATTRIBUTES_CATETORY_NAME ] ) {
148
+ return data [ Constants . STATIC_ATTRIBUTES_CATETORY_NAME ] [ attributeName ] ;
149
+ }
150
+ }
151
+
128
152
return data [ attributeName ] ;
129
153
}
130
154
}
131
155
132
- private getAccessorAttributeData ( parentName , attribute , attributeName , accessorType ) {
133
- const data = this . getAttributeData ( parentName , attribute , attributeName ) ;
156
+ private getAccessorAttributeData ( parentName , attribute , attributeName , accessorType , isStatic ) {
157
+ const data = this . getAttributeData ( parentName , attribute , attributeName , isStatic ) ;
134
158
if ( data ) {
135
159
return data [ accessorType ] ;
136
160
}
0 commit comments