@@ -284,10 +284,10 @@ function convertTypeParameters(
284284
285285 // There's no way to determine directly from a ts.TypeParameter what it's variance modifiers are
286286 // 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 ) ;
291291
292292 const paramRefl = new TypeParameterReflection (
293293 param . symbol . name ,
@@ -296,6 +296,16 @@ function convertTypeParameters(
296296 parent ,
297297 variance
298298 ) ;
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+
299309 context . registerReflection ( paramRefl , param . getSymbol ( ) ) ;
300310 context . trigger ( ConverterEvents . CREATE_TYPE_PARAMETER , paramRefl ) ;
301311
@@ -329,6 +339,10 @@ export function createTypeParamReflection(
329339 context . scope ,
330340 getVariance ( param . modifiers )
331341 ) ;
342+ if ( param . modifiers ?. some ( ( m ) => m . kind === ts . SyntaxKind . ConstKeyword ) ) {
343+ paramRefl . flags . setFlag ( ReflectionFlag . Const , true ) ;
344+ }
345+
332346 context . registerReflection ( paramRefl , param . symbol ) ;
333347
334348 if ( ts . isJSDocTemplateTag ( param . parent ) ) {
0 commit comments