@@ -80,17 +80,17 @@ export declare class Lazy<TBase, TImpl extends Impl<TBase> = Impl<TBase>, TArgs
80
80
}
81
81
export declare class All < TBase , TImpl extends Impl < TBase > = Impl < TBase > , TArgs extends Args < TBase > = Args < TBase > > {
82
82
constructor ( key : PrimitiveOrDependencyCtor < TBase , TImpl , TArgs > ) ;
83
- get ( container : Container ) : any [ ] ;
83
+ get ( container : Container ) : TImpl [ ] ;
84
84
static of < TBase , TImpl extends Impl < TBase > = Impl < TBase > , TArgs extends Args < TBase > = Args < TBase > > ( key : PrimitiveOrDependencyCtor < TBase , TImpl , TArgs > ) : All < TBase , TImpl , TArgs > ;
85
85
}
86
86
export declare class Optional < TBase , TImpl extends Impl < TBase > = Impl < TBase > , TArgs extends Args < TBase > = Args < TBase > > {
87
87
constructor ( key : PrimitiveOrDependencyCtor < TBase , TImpl , TArgs > , checkParent ?: boolean ) ;
88
- get ( container : Container ) : any ;
88
+ get ( container : Container ) : TImpl ;
89
89
static of < TBase , TImpl extends Impl < TBase > = Impl < TBase > , TArgs extends Args < TBase > = Args < TBase > > ( key : PrimitiveOrDependencyCtor < TBase , TImpl , TArgs > , checkParent ?: boolean ) : Optional < TBase , TImpl , TArgs > ;
90
90
}
91
91
export declare class Parent < TBase , TImpl extends Impl < TBase > = Impl < TBase > , TArgs extends Args < TBase > = Args < TBase > > {
92
92
constructor ( key : PrimitiveOrDependencyCtor < TBase , TImpl , TArgs > ) ;
93
- get ( container : Container ) : any ;
93
+ get ( container : Container ) : TImpl ;
94
94
static of < TBase , TImpl extends Impl < TBase > = Impl < TBase > , TArgs extends Args < TBase > = Args < TBase > > ( key : PrimitiveOrDependencyCtor < TBase , TImpl , TArgs > ) : Parent < TBase , TImpl , TArgs > ;
95
95
}
96
96
export declare class Factory < TBase , TImpl extends Impl < TBase > = Impl < TBase > , TArgs extends Args < TBase > = Args < TBase > > {
@@ -127,14 +127,14 @@ export declare function newInstance<TBase, TImpl extends Impl<TBase> = Impl<TBas
127
127
} , ...dynamicDependencies : TArgs [ number ] [ ] ) : ( target : DependencyCtor < TBase , TImpl , TArgs > & {
128
128
inject ?: TArgs [ number ] [ ] ;
129
129
} , _key : any , index : number ) => void ;
130
- export declare function invoker < TBase , TImpl extends Impl < TBase > , TArgs extends Args < TBase > > ( value : Invoker < TBase , TImpl , TArgs > ) : any ;
131
- export declare function invokeAsFactory ( potentialTarget ?: any ) : any ;
130
+ export declare function invoker < TBase , TImpl extends Impl < TBase > , TArgs extends Args < TBase > > ( value : Invoker < TBase , TImpl , TArgs > ) : ( target : DependencyCtor < TBase , TImpl , TArgs > ) => void ;
131
+ export declare function invokeAsFactory < TBase , TImpl extends Impl < TBase > , TArgs extends Args < TBase > > ( potentialTarget ?: DependencyCtor < TBase , TImpl , TArgs > ) : void | ( ( target : DependencyCtor < TBase , TImpl , TArgs > ) => void ) ;
132
132
export interface Invoker < TBase , TImpl extends Impl < TBase > , TArgs extends Args < TBase > > {
133
133
invoke ( container : Container , fn : DependencyCtorOrFunctor < TBase , TImpl , TArgs > , dependencies : TArgs ) : ImplOrAny < TImpl > ;
134
134
invokeWithDynamicDependencies ( container : Container , fn : DependencyCtorOrFunctor < TBase , TImpl , TArgs > , staticDependencies : TArgs [ number ] [ ] , dynamicDependencies : TArgs [ number ] [ ] ) : ImplOrAny < TImpl > ;
135
135
}
136
- export declare class FactoryInvoker < TBase = any , TArgs extends Args < TBase > = Args < TBase > , TImpl extends Impl < TBase > = Impl < TBase > > {
137
- static instance : FactoryInvoker ;
136
+ export declare class FactoryInvoker < TBase , TImpl extends Impl < TBase > = Impl < TBase > , TArgs extends Args < TBase > = Args < TBase > > implements Invoker < TBase , TImpl , TArgs > {
137
+ static instance : FactoryInvoker < any > ;
138
138
invoke ( container : Container , fn : DependencyCtorOrFunctor < TBase , TImpl , TArgs > , dependencies : TArgs ) : ImplOrAny < TImpl > ;
139
139
invokeWithDynamicDependencies ( container : Container , fn : DependencyCtorOrFunctor < TBase , TImpl , TArgs > , staticDependencies : TArgs [ number ] [ ] , dynamicDependencies : TArgs [ number ] [ ] ) : ImplOrAny < TImpl > ;
140
140
}
@@ -144,7 +144,7 @@ export declare class InvocationHandler<TBase, TImpl extends Impl<TBase>, TArgs e
144
144
invoker : Invoker < TBase , TImpl , TArgs > ;
145
145
dependencies : TArgs ;
146
146
constructor ( fn : DependencyCtorOrFunctor < TBase , TImpl , TArgs > , invoker : Invoker < TBase , TImpl , TArgs > , dependencies : TArgs ) ;
147
- invoke ( container : Container , dynamicDependencies ?: any [ ] ) : any ;
147
+ invoke ( container : Container , dynamicDependencies ?: TArgs [ ] ) : TImpl ;
148
148
}
149
149
export interface ContainerConfiguration {
150
150
onHandlerCreated ?: ( handler : InvocationHandler < any , any , any > ) => InvocationHandler < any , any , any > ;
@@ -158,18 +158,19 @@ export declare class Container {
158
158
makeGlobal ( ) : Container ;
159
159
setHandlerCreatedCallback < TBase , TImpl extends Impl < TBase > = Impl < TBase > , TArgs extends Args < TBase > = Args < TBase > > ( onHandlerCreated : ( handler : InvocationHandler < TBase , TImpl , TArgs > ) => InvocationHandler < TBase , TImpl , TArgs > ) : void ;
160
160
registerInstance < TBase , TImpl extends Impl < TBase > = Impl < TBase > , TArgs extends Args < TBase > = Args < TBase > > ( key : PrimitiveOrDependencyCtor < TBase , TImpl , TArgs > , instance ?: TImpl ) : Resolver ;
161
- registerSingleton < TBase , TImpl extends Impl < TBase > = Impl < TBase > , TArgs extends Args < TBase > = Args < TBase > > ( key : any , fn ?: DependencyCtorOrFunctor < TBase , TImpl , TArgs > ) : Resolver ;
162
- registerTransient < TBase , TImpl extends Impl < TBase > = Impl < TBase > , TArgs extends Args < TBase > = Args < TBase > > ( key : string , fn : DependencyCtorOrFunctor < TBase , TImpl , TArgs > ) : Resolver ;
161
+ registerSingleton < TBase , TImpl extends Impl < TBase > = Impl < TBase > , TArgs extends Args < TBase > = Args < TBase > > ( key : Primitive , fn : DependencyCtorOrFunctor < TBase , TImpl , TArgs > ) : Resolver ;
162
+ registerSingleton < TBase , TImpl extends Impl < TBase > = Impl < TBase > , TArgs extends Args < TBase > = Args < TBase > > ( key : DependencyCtor < TBase , TImpl , TArgs > , fn ?: DependencyCtorOrFunctor < TBase , TImpl , TArgs > ) : Resolver ;
163
+ registerTransient < TBase , TImpl extends Impl < TBase > = Impl < TBase > , TArgs extends Args < TBase > = Args < TBase > > ( key : Primitive , fn : DependencyCtorOrFunctor < TBase , TImpl , TArgs > ) : Resolver ;
163
164
registerTransient < TBase , TImpl extends Impl < TBase > = Impl < TBase > , TArgs extends Args < TBase > = Args < TBase > > ( key : DependencyCtor < TBase , TImpl , TArgs > , fn ?: DependencyCtorOrFunctor < TBase , TImpl , TArgs > ) : Resolver ;
164
165
registerHandler < TBase , TImpl extends Impl < TBase > = Impl < TBase > , TArgs extends Args < TBase > = Args < TBase > > ( key : PrimitiveOrDependencyCtor < TBase , TImpl , TArgs > , handler : ( container ?: Container , key ?: PrimitiveOrDependencyCtor < TBase , TImpl , TArgs > , resolver ?: Resolver ) => any ) : Resolver ;
165
166
registerAlias < TBase , TImpl extends Impl < TBase > = Impl < TBase > , TArgs extends Args < TBase > = Args < TBase > > ( originalKey : PrimitiveOrDependencyCtor < TBase , TImpl , TArgs > , aliasKey : PrimitiveOrDependencyCtor < TBase , TImpl , TArgs > ) : Resolver ;
166
167
registerResolver < TBase , TImpl extends Impl < TBase > = Impl < TBase > , TArgs extends Args < TBase > = Args < TBase > > ( key : PrimitiveOrDependencyCtor < TBase , TImpl , TArgs > , resolver : Resolver ) : Resolver ;
167
- autoRegister < TBase , TImpl extends Impl < TBase > = Impl < TBase > , TArgs extends Args < TBase > = Args < TBase > > ( key : string , fn : DependencyCtorOrFunctor < TBase , TImpl , TArgs > ) : Resolver ;
168
+ autoRegister < TBase , TImpl extends Impl < TBase > = Impl < TBase > , TArgs extends Args < TBase > = Args < TBase > > ( key : Primitive , fn : DependencyCtorOrFunctor < TBase , TImpl , TArgs > ) : Resolver ;
168
169
autoRegister < TBase , TImpl extends Impl < TBase > = Impl < TBase > , TArgs extends Args < TBase > = Args < TBase > > ( key : DependencyCtor < TBase , TImpl , TArgs > , fn ?: DependencyCtorOrFunctor < TBase , TImpl , TArgs > ) : Resolver ;
169
170
autoRegisterAll ( fns : DependencyCtor < any , any , any > [ ] ) : void ;
170
171
unregister ( key : any ) : void ;
171
172
hasResolver < TBase , TImpl extends Impl < TBase > = Impl < TBase > , TArgs extends Args < TBase > = Args < TBase > > ( key : PrimitiveOrDependencyCtor < TBase , TImpl , TArgs > , checkParent ?: boolean ) : boolean ;
172
- getResolver < TBase , TImpl extends Impl < TBase > = Impl < TBase > , TArgs extends Args < TBase > = Args < TBase > > ( key : PrimitiveOrDependencyCtorOrFunctor < TBase , TImpl , TArgs > ) : any ;
173
+ getResolver < TStrategyKey extends keyof StrategyState < TBase , TImpl , TArgs > , TBase , TImpl extends Impl < TBase > = Impl < TBase > , TArgs extends Args < TBase > = Args < TBase > > ( key : PrimitiveOrDependencyCtorOrFunctor < TBase , TImpl , TArgs > ) : StrategyResolver < TBase , TImpl , TArgs , TStrategyKey > ;
173
174
get < TBase , TImpl extends Impl < TBase > = Impl < TBase > , TArgs extends Args < TBase > = Args < TBase > > ( key : PrimitiveOrDependencyCtor < TBase , TImpl , TArgs > ) : ImplOrAny < TImpl > ;
174
175
get < TBase , TImpl extends Impl < TBase > = Impl < TBase > , TArgs extends Args < TBase > = Args < TBase > > ( key : typeof Container ) : Container ;
175
176
_get ( key : any ) : any ;
@@ -182,8 +183,8 @@ export declare class Container {
182
183
}
183
184
export declare function autoinject ( potentialTarget ?: DependencyCtor < any , any , any > ) : any ;
184
185
export declare function inject < TBase , TImpl extends Impl < TBase > = Impl < TBase > , TArgs extends Args < TBase > = Args < TBase > > ( ...rest : TArgs [ number ] [ ] ) : any ;
185
- export declare function registration < TBase , TImpl extends Impl < TBase > , TArgs extends Args < TBase > > ( value : Registration < TBase , TImpl , TArgs > ) : any ;
186
- export declare function transient < TBase , TImpl extends Impl < TBase > , TArgs extends Args < TBase > > ( key ?: PrimitiveOrDependencyCtor < TBase , TImpl , TArgs > ) : any ;
186
+ export declare function registration < TBase , TImpl extends Impl < TBase > , TArgs extends Args < TBase > > ( value : Registration < TBase , TImpl , TArgs > ) : ( target : DependencyCtor < TBase , TImpl , TArgs > ) => void ;
187
+ export declare function transient < TBase , TImpl extends Impl < TBase > , TArgs extends Args < TBase > > ( key ?: PrimitiveOrDependencyCtor < TBase , TImpl , TArgs > ) : ( target : DependencyCtor < TBase , TImpl , TArgs > ) => void ;
187
188
export declare function singleton ( registerInChild ?: boolean ) : any ;
188
189
export declare function singleton < TBase , TImpl extends Impl < TBase > , TArgs extends Args < TBase > > ( key ?: PrimitiveOrDependencyCtor < TBase , TImpl , TArgs > , registerInChild ?: boolean ) : any ;
189
190
export interface Registration < TBase , TImpl extends Impl < TBase > , TArgs extends Args < TBase > > {
0 commit comments