@@ -284,10 +284,10 @@ function convertTypeParameters(
284
284
285
285
// There's no way to determine directly from a ts.TypeParameter what it's variance modifiers are
286
286
// so unfortunately we have to go back to the node for this...
287
- const variance = getVariance (
288
- param . getSymbol ( ) ?. declarations ?. find ( ts . isTypeParameterDeclaration )
289
- ?. modifiers
290
- ) ;
287
+ const declaration = param
288
+ . getSymbol ( )
289
+ ?. declarations ?. find ( ts . isTypeParameterDeclaration ) ;
290
+ const variance = getVariance ( declaration ?. modifiers ) ;
291
291
292
292
const paramRefl = new TypeParameterReflection (
293
293
param . symbol . name ,
@@ -296,6 +296,16 @@ function convertTypeParameters(
296
296
parent ,
297
297
variance
298
298
) ;
299
+
300
+ // No way to determine this from the type parameter itself, need to go back to the declaration
301
+ if (
302
+ declaration ?. modifiers ?. some (
303
+ ( m ) => m . kind === ts . SyntaxKind . ConstKeyword
304
+ )
305
+ ) {
306
+ paramRefl . flags . setFlag ( ReflectionFlag . Const , true ) ;
307
+ }
308
+
299
309
context . registerReflection ( paramRefl , param . getSymbol ( ) ) ;
300
310
context . trigger ( ConverterEvents . CREATE_TYPE_PARAMETER , paramRefl ) ;
301
311
@@ -329,6 +339,10 @@ export function createTypeParamReflection(
329
339
context . scope ,
330
340
getVariance ( param . modifiers )
331
341
) ;
342
+ if ( param . modifiers ?. some ( ( m ) => m . kind === ts . SyntaxKind . ConstKeyword ) ) {
343
+ paramRefl . flags . setFlag ( ReflectionFlag . Const , true ) ;
344
+ }
345
+
332
346
context . registerReflection ( paramRefl , param . symbol ) ;
333
347
334
348
if ( ts . isJSDocTemplateTag ( param . parent ) ) {
0 commit comments