1
- import { type interfaces , LazyServiceIdentifer } from 'inversify' ;
1
+ import { type interfaces , LazyServiceIdentifier } from 'inversify' ;
2
2
3
3
export type Newable < T > = interfaces . Newable < T > ;
4
4
5
5
export type ServiceIdentifier < T > = interfaces . ServiceIdentifier < T > ;
6
6
7
7
export type FactoryFunction < T > = ( ) => interfaces . ServiceIdentifier < T > ;
8
8
9
- export type ServiceDescriptor < T > = T | LazyServiceIdentifer < T > | FactoryFunction < T > ;
9
+ export type ServiceDescriptor < T > = T | LazyServiceIdentifier < T > | FactoryFunction < T > ;
10
10
11
- export { LazyServiceIdentifer } ;
11
+ export { LazyServiceIdentifier } ;
12
12
13
13
export interface ServicesAccessor {
14
14
get < T > ( id : ServiceIdentifier < T > ) : T ;
15
15
}
16
16
17
17
const _registry : [ ServiceIdentifier < unknown > , ServiceDescriptor < unknown > ] [ ] = [ ] ;
18
18
19
- export function registerSingleton < T > ( id : ServiceIdentifier < T > , useValue : T | LazyServiceIdentifer < T > ) : void ;
19
+ export function registerSingleton < T > ( id : ServiceIdentifier < T > , useValue : T | LazyServiceIdentifier < T > ) : void ;
20
20
export function registerSingleton < T > ( id : ServiceIdentifier < T > , useFactory : FactoryFunction < T > ) : void ;
21
21
export function registerSingleton < T > (
22
22
id : ServiceIdentifier < T > ,
@@ -25,16 +25,16 @@ export function registerSingleton<T>(
25
25
) : void ;
26
26
export function registerSingleton < T > (
27
27
id : ServiceIdentifier < T > ,
28
- ctorOrDescriptor : T | LazyServiceIdentifer < T > | Newable < T > | FactoryFunction < T > ,
28
+ ctorOrDescriptor : T | LazyServiceIdentifier < T > | Newable < T > | FactoryFunction < T > ,
29
29
supportsDelayedInstantiation ?: boolean ,
30
30
) : void {
31
- if ( ctorOrDescriptor instanceof LazyServiceIdentifer ) {
31
+ if ( ctorOrDescriptor instanceof LazyServiceIdentifier ) {
32
32
_registry . push ( [ id , ctorOrDescriptor ] ) ;
33
33
return ;
34
34
}
35
35
36
36
if ( typeof ctorOrDescriptor === 'function' && supportsDelayedInstantiation ) {
37
- _registry . push ( [ id , new LazyServiceIdentifer < T > ( ( ) => ctorOrDescriptor as Newable < T > ) ] ) ;
37
+ _registry . push ( [ id , new LazyServiceIdentifier < T > ( ( ) => ctorOrDescriptor as Newable < T > ) ] ) ;
38
38
return ;
39
39
}
40
40
0 commit comments