@@ -8,6 +8,7 @@ import type {
88 ClassReferenceLoadedClassOrInterface ,
99} from '../parse/ClassIndex' ;
1010import type { ConstructorData } from '../parse/ConstructorLoader' ;
11+ import type { GenericsData } from '../parse/GenericsLoader' ;
1112import type { PackageMetadata } from '../parse/PackageMetadataLoader' ;
1213import type { DefaultNested ,
1314 DefaultValue ,
@@ -33,6 +34,7 @@ export class ComponentConstructor {
3334 private readonly pathDestination : PathDestinationDefinition ;
3435 private readonly classAndInterfaceIndex : ClassIndex < ClassReferenceLoadedClassOrInterface > ;
3536 private readonly classConstructors : ClassIndex < ConstructorData < ParameterRangeResolved > > ;
37+ private readonly classGenerics : ClassIndex < GenericsData < ParameterRangeResolved > > ;
3638 private readonly classExtensions : ClassIndex < ExtensionData < ParameterRangeResolved > [ ] > ;
3739 private readonly externalComponents : ExternalComponents ;
3840 private readonly contextParser : ContextParser ;
@@ -44,6 +46,7 @@ export class ComponentConstructor {
4446 this . pathDestination = args . pathDestination ;
4547 this . classAndInterfaceIndex = args . classAndInterfaceIndex ;
4648 this . classConstructors = args . classConstructors ;
49+ this . classGenerics = args . classGenerics ;
4750 this . classExtensions = args . classExtensions ;
4851 this . externalComponents = args . externalComponents ;
4952 this . contextParser = args . contextParser ;
@@ -84,6 +87,7 @@ export class ComponentConstructor {
8487 } ,
8588 classReference ,
8689 this . classConstructors [ className ] ,
90+ this . classGenerics [ className ] ,
8791 this . classExtensions [ className ] ,
8892 ) ) ;
8993 }
@@ -166,22 +170,24 @@ export class ComponentConstructor {
166170 * @param externalContextsCallback Callback for external contexts.
167171 * @param classReference Class reference of the class component.
168172 * @param constructorData Constructor data of the owning class.
173+ * @param genericsData Generics data of the owning class.
169174 * @param classExtensions Class extensions of the owning class.
170175 */
171176 public async constructComponent (
172177 context : JsonLdContextNormalized ,
173178 externalContextsCallback : ExternalContextCallback ,
174179 classReference : ClassReferenceLoadedClassOrInterface ,
175180 constructorData : ConstructorData < ParameterRangeResolved > | undefined ,
181+ genericsData : GenericsData < ParameterRangeResolved > | undefined ,
176182 classExtensions : ExtensionData < ParameterRangeResolved > [ ] | undefined ,
177183 ) : Promise < ComponentDefinition > {
178184 // Determine generic type parameters
179- const genericTypeParameters = constructorData ?
185+ const genericTypeParameters = genericsData ?
180186 await this . constructGenericTypeParameters (
181187 context ,
182188 externalContextsCallback ,
183189 classReference ,
184- constructorData . genericTypeParameters ,
190+ genericsData . genericTypeParameters ,
185191 ) :
186192 undefined ;
187193
@@ -799,6 +805,7 @@ export interface ComponentConstructorArgs {
799805 pathDestination : PathDestinationDefinition ;
800806 classAndInterfaceIndex : ClassIndex < ClassReferenceLoadedClassOrInterface > ;
801807 classConstructors : ClassIndex < ConstructorData < ParameterRangeResolved > > ;
808+ classGenerics : ClassIndex < GenericsData < ParameterRangeResolved > > ;
802809 classExtensions : ClassIndex < ExtensionData < ParameterRangeResolved > [ ] > ;
803810 externalComponents : ExternalComponents ;
804811 contextParser : ContextParser ;
0 commit comments