File tree Expand file tree Collapse file tree 4 files changed +21
-0
lines changed
Expand file tree Collapse file tree 4 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ title: Changelog
1515 The ` chevronSmall ` helper is now deprecated and will be removed with v0.29.0.
1616- Classes/interfaces marked with ` @hidden ` will no longer appear in the
1717 "Hierarchy" section of the docs.
18+ - TypeDoc now handles wildcard JSDoc types, #2949 .
1819
1920### Thanks!
2021
Original file line number Diff line number Diff line change @@ -93,6 +93,7 @@ export function loadConverters() {
9393 // Only used if skipLibCheck: true
9494 jsDocNullableTypeConverter ,
9595 jsDocNonNullableTypeConverter ,
96+ jsDocAllTypeConverter ,
9697 ]
9798 ) {
9899 for ( const key of actor . kind ) {
@@ -1154,6 +1155,15 @@ const jsDocNonNullableTypeConverter: TypeConverter<ts.JSDocNonNullableType> = {
11541155 convertType : requestBugReport ,
11551156} ;
11561157
1158+ const jsDocAllTypeConverter : TypeConverter < ts . JSDocAllType > = {
1159+ kind : [ ts . SyntaxKind . JSDocAllType ] ,
1160+ convert ( ) {
1161+ return new IntrinsicType ( "any" ) ;
1162+ } ,
1163+ // Should be a UnionType
1164+ convertType : requestBugReport ,
1165+ } ;
1166+
11571167function requestBugReport ( context : Context , nodeOrType : ts . Node | ts . Type ) {
11581168 if ( "kind" in nodeOrType ) {
11591169 const kindName = ts . SyntaxKind [ nodeOrType . kind ] ;
Original file line number Diff line number Diff line change 1+ /**
2+ * @callback Test
3+ * @returns {Promise<*> }
4+ */
5+ export { } ;
Original file line number Diff line number Diff line change @@ -2128,4 +2128,9 @@ describe("Issue Tests", () => {
21282128 const project = convert ( ) ;
21292129 equal ( project . children ?. map ( c => c . name ) , [ "notExcluded" ] ) ;
21302130 } ) ;
2131+
2132+ it ( "#2949 handles JSDoc wildcard types" , ( ) => {
2133+ const project = convert ( ) ;
2134+ equal ( query ( project , "Test" ) . type ?. toString ( ) , "() => Promise<any>" ) ;
2135+ } ) ;
21312136} ) ;
You can’t perform that action at this time.
0 commit comments