File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -221,10 +221,23 @@ export const rawTypeToTypeInformation = (
221
221
// Special case, when the generic type is "Function" then the first N - 1 innerTypes are
222
222
// parameter types and the Nth innerType is the return type
223
223
if ( genericTypeString === 'Function' ) {
224
+ const genericProvidedParams = innerTypes . slice ( 0 , innerTypes . length - 2 ) ;
225
+
224
226
return {
225
227
collection,
226
228
type : 'Function' ,
227
- parameters : innerTypes . slice ( 0 , innerTypes . length - 2 ) ,
229
+ parameters :
230
+ // If no param types are provided in the <A, B, C> syntax then we should fallback to the normal one
231
+ genericProvidedParams . length === 0
232
+ ? subTypedKeys
233
+ ? subTypedKeys . map < MethodParameterDocumentation > ( typedKey => ( {
234
+ name : typedKey . key ,
235
+ description : typedKey . description ,
236
+ required : typedKey . required ,
237
+ ...typedKey . type ,
238
+ } ) )
239
+ : [ ]
240
+ : genericProvidedParams ,
228
241
returns : innerTypes [ innerTypes . length - 1 ] ,
229
242
} ;
230
243
}
You can’t perform that action at this time.
0 commit comments