@@ -28,8 +28,8 @@ import type { IConstructionStrategy } from './strategy/IConstructionStrategy';
2828 * If you want to make sure that instances are reused,
2929 * be sure to call {@link ConfigConstructorPool} instead.
3030 */
31- export class ConfigConstructor < Instance > implements IArgumentsConstructor < Instance > {
32- private static readonly ARGS_HANDLERS : IArgumentConstructorHandler [ ] = [
31+ export class ConfigConstructor < TInstance > implements IArgumentsConstructor < TInstance > {
32+ private static readonly argsHandlers : IArgumentConstructorHandler [ ] = [
3333 new ArgumentConstructorHandlerUndefined ( ) ,
3434 new ArgumentConstructorHandlerHash ( ) ,
3535 new ArgumentConstructorHandlerArray ( ) ,
@@ -40,11 +40,11 @@ export class ConfigConstructor<Instance> implements IArgumentsConstructor<Instan
4040 ] ;
4141
4242 public readonly objectLoader : RdfObjectLoader ;
43- public readonly configConstructorPool : IConfigConstructorPool < Instance > ;
44- public readonly constructionStrategy : IConstructionStrategy < Instance > ;
43+ public readonly configConstructorPool : IConfigConstructorPool < TInstance > ;
44+ public readonly constructionStrategy : IConstructionStrategy < TInstance > ;
4545 private readonly moduleState : IModuleState ;
4646
47- public constructor ( options : IConfigConstructorOptions < Instance > ) {
47+ public constructor ( options : IConfigConstructorOptions < TInstance > ) {
4848 this . objectLoader = options . objectLoader ;
4949 this . configConstructorPool = options . configConstructorPool ;
5050 this . constructionStrategy = options . constructionStrategy ;
@@ -54,7 +54,7 @@ export class ConfigConstructor<Instance> implements IArgumentsConstructor<Instan
5454 public async getArgumentValues (
5555 values : Resource [ ] ,
5656 settings : IConstructionSettings ,
57- ) : Promise < Instance > {
57+ ) : Promise < TInstance > {
5858 if ( values . length === 0 ) {
5959 return this . constructionStrategy . createUndefined ( ) ;
6060 }
@@ -69,9 +69,9 @@ export class ConfigConstructor<Instance> implements IArgumentsConstructor<Instan
6969 public async getArgumentValue (
7070 value : Resource ,
7171 settings : IConstructionSettings ,
72- ) : Promise < Instance > {
72+ ) : Promise < TInstance > {
7373 // Check if this args resource can be handled by one of the built-in handlers.
74- for ( const handler of ConfigConstructor . ARGS_HANDLERS ) {
74+ for ( const handler of ConfigConstructor . argsHandlers ) {
7575 if ( handler . canHandle ( value , settings , this ) ) {
7676 return handler . handle ( value , settings , this ) ;
7777 }
@@ -90,7 +90,7 @@ export class ConfigConstructor<Instance> implements IArgumentsConstructor<Instan
9090 public async createArguments (
9191 config : Resource ,
9292 settings : IConstructionSettings ,
93- ) : Promise < Instance [ ] > {
93+ ) : Promise < TInstance [ ] > {
9494 if ( config . property . arguments ) {
9595 if ( ! config . property . arguments . list ) {
9696 throw new ErrorResourcesContext ( 'Detected non-RDF-list as value for config arguments' , { config } ) ;
@@ -110,8 +110,8 @@ export class ConfigConstructor<Instance> implements IArgumentsConstructor<Instan
110110 public async createInstance (
111111 config : Resource ,
112112 settings : IConstructionSettings ,
113- ) : Promise < Instance > {
114- const args : Instance [ ] = await this . createArguments ( config , settings ) ;
113+ ) : Promise < TInstance > {
114+ const args : TInstance [ ] = await this . createArguments ( config , settings ) ;
115115 return this . constructionStrategy . createInstance ( {
116116 settings,
117117 moduleState : this . moduleState ,
@@ -128,19 +128,19 @@ export class ConfigConstructor<Instance> implements IArgumentsConstructor<Instan
128128/**
129129 * Options for a component factory.
130130 */
131- export interface IConfigConstructorOptions < Instance > {
131+ export interface IConfigConstructorOptions < TInstance > {
132132 /**
133133 * The RDF object loader.
134134 */
135135 objectLoader : RdfObjectLoader ;
136136 /**
137137 * The instance pool.
138138 */
139- configConstructorPool : IConfigConstructorPool < Instance > ;
139+ configConstructorPool : IConfigConstructorPool < TInstance > ;
140140 /**
141141 * The strategy for construction.
142142 */
143- constructionStrategy : IConstructionStrategy < Instance > ;
143+ constructionStrategy : IConstructionStrategy < TInstance > ;
144144 /**
145145 * The module state.
146146 */
0 commit comments