@@ -6,7 +6,7 @@ export function formatProperties(props: rae.PropertyNode[]) {
6
6
7
7
for ( const prop of props ) {
8
8
result [ prop . name ] = {
9
- type : formatType ( prop . type , prop . optional ) ,
9
+ type : formatType ( prop . type , prop . optional , prop . documentation ?. tags ) ,
10
10
default : prop . documentation ?. defaultValue ,
11
11
required : ! prop . optional || undefined ,
12
12
description : prop . documentation ?. description ,
@@ -21,7 +21,7 @@ export function formatParameters(params: rae.Parameter[]) {
21
21
22
22
for ( const param of params ) {
23
23
result [ param . name ] = {
24
- type : formatType ( param . type , param . optional , true ) ,
24
+ type : formatType ( param . type , param . optional , param . documentation ?. tags , true ) ,
25
25
default : param . defaultValue ,
26
26
optional : param . optional || undefined ,
27
27
description : param . documentation ?. description ,
@@ -46,8 +46,16 @@ export function formatEnum(enumNode: rae.EnumNode) {
46
46
export function formatType (
47
47
type : rae . TypeNode ,
48
48
removeUndefined : boolean ,
49
+ jsdocTags : rae . DocumentationTag [ ] | undefined = undefined ,
49
50
expandObjects : boolean = false ,
50
51
) : string {
52
+ const typeTag = jsdocTags ?. find ( ( tag ) => tag . name === 'type' ) ;
53
+ const typeValue = typeTag ?. value ;
54
+
55
+ if ( typeValue ) {
56
+ return typeValue ;
57
+ }
58
+
51
59
if ( type instanceof rae . ReferenceNode ) {
52
60
if ( / ^ R e a c t E l e m e n t ( < .* > ) ? / . test ( type . name ) ) {
53
61
return 'ReactElement' ;
0 commit comments