@@ -39,17 +39,6 @@ export type PrimitiveOrDependencyCtorOrFunctor<
39
39
> = DependencyCtor < TBase , TImpl , TArgs >
40
40
| DependencyFunctor < TBase , TImpl , TArgs >
41
41
| Primitive ;
42
- export declare function invoker < TBase , TImpl extends Impl < TBase > , TArgs extends Args < TBase > > ( value : Invoker < TBase , TImpl , TArgs > ) : any ;
43
- export declare function invokeAsFactory ( potentialTarget ?: any ) : any ;
44
- export interface Invoker < TBase , TImpl extends Impl < TBase > , TArgs extends Args < TBase > > {
45
- invoke ( container : Container , fn : DependencyCtorOrFunctor < TBase , TImpl , TArgs > , dependencies : TArgs ) : ImplOrAny < TImpl > ;
46
- invokeWithDynamicDependencies ( container : Container , fn : DependencyCtorOrFunctor < TBase , TImpl , TArgs > , staticDependencies : TArgs [ number ] [ ] , dynamicDependencies : TArgs [ number ] [ ] ) : ImplOrAny < TImpl > ;
47
- }
48
- export declare class FactoryInvoker < TBase = any , TArgs extends Args < TBase > = Args < TBase > , TImpl extends Impl < TBase > = Impl < TBase > > {
49
- static instance : FactoryInvoker ;
50
- invoke ( container : Container , fn : DependencyCtorOrFunctor < TBase , TImpl , TArgs > , dependencies : TArgs ) : ImplOrAny < TImpl > ;
51
- invokeWithDynamicDependencies ( container : Container , fn : DependencyCtorOrFunctor < TBase , TImpl , TArgs > , staticDependencies : TArgs [ number ] [ ] , dynamicDependencies : TArgs [ number ] [ ] ) : ImplOrAny < TImpl > ;
52
- }
53
42
export declare const resolver : {
54
43
decorates ?: ( key : any ) => key is {
55
44
get ( container : Container , key : any ) : any ;
@@ -85,40 +74,31 @@ export declare class StrategyResolver<TBase, TImpl extends Impl<TBase>, TArgs ex
85
74
get ( container : Container , key : PrimitiveOrDependencyCtor < TBase , TImpl , TArgs > ) : TImpl ;
86
75
}
87
76
export declare class Lazy < TBase , TImpl extends Impl < TBase > = Impl < TBase > , TArgs extends Args < TBase > = Args < TBase > > {
88
- _key : PrimitiveOrDependencyCtor < TBase , TImpl , TArgs > ;
89
77
constructor ( key : PrimitiveOrDependencyCtor < TBase , TImpl , TArgs > ) ;
90
78
get ( container : Container ) : ( ) => ImplOrAny < TImpl > ;
91
79
static of < TBase , TImpl extends Impl < TBase > = Impl < TBase > , TArgs extends Args < TBase > = Args < TBase > > ( key : PrimitiveOrDependencyCtor < TBase , TImpl , TArgs > ) : Lazy < TBase , TImpl , TArgs > ;
92
80
}
93
81
export declare class All < TBase , TImpl extends Impl < TBase > = Impl < TBase > , TArgs extends Args < TBase > = Args < TBase > > {
94
- _key : PrimitiveOrDependencyCtor < TBase , TImpl , TArgs > ;
95
82
constructor ( key : PrimitiveOrDependencyCtor < TBase , TImpl , TArgs > ) ;
96
83
get ( container : Container ) : any [ ] ;
97
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 > ;
98
85
}
99
86
export declare class Optional < TBase , TImpl extends Impl < TBase > = Impl < TBase > , TArgs extends Args < TBase > = Args < TBase > > {
100
- _key : PrimitiveOrDependencyCtor < TBase , TImpl , TArgs > ;
101
- _checkParent : boolean ;
102
87
constructor ( key : PrimitiveOrDependencyCtor < TBase , TImpl , TArgs > , checkParent ?: boolean ) ;
103
88
get ( container : Container ) : any ;
104
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 > ;
105
90
}
106
91
export declare class Parent < TBase , TImpl extends Impl < TBase > = Impl < TBase > , TArgs extends Args < TBase > = Args < TBase > > {
107
- _key : PrimitiveOrDependencyCtor < TBase , TImpl , TArgs > ;
108
92
constructor ( key : PrimitiveOrDependencyCtor < TBase , TImpl , TArgs > ) ;
109
93
get ( container : Container ) : any ;
110
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 > ;
111
95
}
112
96
export declare class Factory < TBase , TImpl extends Impl < TBase > = Impl < TBase > , TArgs extends Args < TBase > = Args < TBase > > {
113
- _key : PrimitiveOrDependencyCtorOrFunctor < TBase , TImpl , TArgs > ;
114
97
constructor ( key : PrimitiveOrDependencyCtorOrFunctor < TBase , TImpl , TArgs > ) ;
115
98
get ( container : Container ) : DependencyFunctor < TBase , TImpl , TArgs > ;
116
99
static of < TBase , TImpl extends Impl < TBase > = Impl < TBase > , TArgs extends Args < TBase > = Args < TBase > > ( key : DependencyCtor < TBase , TImpl , TArgs > ) : Factory < TBase , TImpl , TArgs > ;
117
100
}
118
101
export declare class NewInstance < TBase , TImpl extends Impl < TBase > = Impl < TBase > , TArgs extends Args < TBase > = Args < TBase > > {
119
- key : PrimitiveOrDependencyCtorOrFunctor < TBase , TImpl , TArgs > ;
120
- asKey : PrimitiveOrDependencyCtorOrFunctor < TBase , TImpl , TArgs > ;
121
- dynamicDependencies : TArgs [ number ] [ ] ;
122
102
constructor ( key : PrimitiveOrDependencyCtorOrFunctor < TBase , TImpl , TArgs > , ...dynamicDependencies : TArgs [ number ] [ ] ) ;
123
103
get ( container : Container ) : ImplOrAny < TImpl > ;
124
104
as ( key : PrimitiveOrDependencyCtorOrFunctor < TBase , TImpl , TArgs > ) : this;
@@ -147,38 +127,16 @@ export declare function newInstance<TBase, TImpl extends Impl<TBase> = Impl<TBas
147
127
} , ...dynamicDependencies : TArgs [ number ] [ ] ) : ( target : DependencyCtor < TBase , TImpl , TArgs > & {
148
128
inject ?: TArgs [ number ] [ ] ;
149
129
} , _key : any , index : number ) => void ;
150
- export declare function registration < TBase , TImpl extends Impl < TBase > , TArgs extends Args < TBase > > ( value : Registration < TBase , TImpl , TArgs > ) : any ;
151
- export declare function transient < TBase , TImpl extends Impl < TBase > , TArgs extends Args < TBase > > ( key ?: PrimitiveOrDependencyCtor < TBase , TImpl , TArgs > ) : any ;
152
- export declare function singleton ( registerInChild ?: boolean ) : any ;
153
- export declare function singleton < TBase , TImpl extends Impl < TBase > , TArgs extends Args < TBase > > ( key ?: PrimitiveOrDependencyCtor < TBase , TImpl , TArgs > , registerInChild ?: boolean ) : any ;
154
- export interface Registration < TBase , TImpl extends Impl < TBase > , TArgs extends Args < TBase > > {
155
- registerResolver ( container : Container , key : PrimitiveOrDependencyCtor < TBase , TImpl , TArgs > , fn : DependencyCtorOrFunctor < TBase , TImpl , TArgs > ) : Resolver ;
156
- }
157
- export declare class TransientRegistration < TBase , TImpl extends Impl < TBase > , TArgs extends Args < TBase > > implements Registration < TBase , TImpl , TArgs > {
158
- _key : PrimitiveOrDependencyCtor < TBase , TImpl , TArgs > ;
159
- constructor ( key ?: PrimitiveOrDependencyCtor < TBase , TImpl , TArgs > ) ;
160
- registerResolver ( container : Container , key : PrimitiveOrDependencyCtor < TBase , TImpl , TArgs > , fn : DependencyCtorOrFunctor < TBase , TImpl , TArgs > ) : Resolver ;
161
- }
162
- export declare class SingletonRegistration < TBase , TImpl extends Impl < TBase > , TArgs extends Args < TBase > > implements Registration < TBase , TImpl , TArgs > {
163
- _registerInChild : boolean ;
164
- _key : PrimitiveOrDependencyCtor < TBase , TImpl , TArgs > ;
165
- constructor ( keyOrRegisterInChild ?: PrimitiveOrDependencyCtor < TBase , TImpl , TArgs > | boolean , registerInChild ?: boolean ) ;
166
- registerResolver ( container : Container , key : PrimitiveOrDependencyCtor < TBase , TImpl , TArgs > , fn : DependencyCtorOrFunctor < TBase , TImpl , TArgs > ) : Resolver ;
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 ;
132
+ export interface Invoker < TBase , TImpl extends Impl < TBase > , TArgs extends Args < TBase > > {
133
+ invoke ( container : Container , fn : DependencyCtorOrFunctor < TBase , TImpl , TArgs > , dependencies : TArgs ) : ImplOrAny < TImpl > ;
134
+ invokeWithDynamicDependencies ( container : Container , fn : DependencyCtorOrFunctor < TBase , TImpl , TArgs > , staticDependencies : TArgs [ number ] [ ] , dynamicDependencies : TArgs [ number ] [ ] ) : ImplOrAny < TImpl > ;
167
135
}
168
- /** @internal */
169
- export declare module 'aurelia-metadata' {
170
- interface MetadataType {
171
- invoker : 'aurelia:invoker' ;
172
- getOwn (
173
- metadataKey : 'aurelia:invoker' ,
174
- target : DependencyCtorOrFunctor < any , any , any >
175
- ) : Invoker < any , any , any > ;
176
- registration : 'aurelia:registration' ;
177
- get (
178
- metadataKey : 'aurelia:registration' ,
179
- target : any
180
- ) : SingletonRegistration < any , any , any > | TransientRegistration < any , any , any > ;
181
- }
136
+ export declare class FactoryInvoker < TBase = any , TArgs extends Args < TBase > = Args < TBase > , TImpl extends Impl < TBase > = Impl < TBase > > {
137
+ static instance : FactoryInvoker ;
138
+ invoke ( container : Container , fn : DependencyCtorOrFunctor < TBase , TImpl , TArgs > , dependencies : TArgs ) : ImplOrAny < TImpl > ;
139
+ invokeWithDynamicDependencies ( container : Container , fn : DependencyCtorOrFunctor < TBase , TImpl , TArgs > , staticDependencies : TArgs [ number ] [ ] , dynamicDependencies : TArgs [ number ] [ ] ) : ImplOrAny < TImpl > ;
182
140
}
183
141
export declare const _emptyParameters : [ ] ;
184
142
export declare class InvocationHandler < TBase , TImpl extends Impl < TBase > , TArgs extends Args < TBase > > {
@@ -196,10 +154,6 @@ export declare class Container {
196
154
static instance : Container ;
197
155
parent : Container ;
198
156
root : Container ;
199
- _configuration : ContainerConfiguration ;
200
- _onHandlerCreated : ( handler : InvocationHandler < any , any , any > ) => InvocationHandler < any , any , any > ;
201
- _handlers : Map < any , any > ;
202
- _resolvers : Map < any , any > ;
203
157
constructor ( configuration ?: ContainerConfiguration ) ;
204
158
makeGlobal ( ) : Container ;
205
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 ;
@@ -227,4 +181,19 @@ export declare class Container {
227
181
} ) : InvocationHandler < TBase , TImpl , TArgs > ;
228
182
}
229
183
export declare function autoinject ( potentialTarget ?: DependencyCtor < any , any , any > ) : any ;
230
- export declare function inject < TBase , TImpl extends Impl < TBase > = Impl < TBase > , TArgs extends Args < TBase > = Args < TBase > > ( ...rest : TArgs [ number ] [ ] ) : any ;
184
+ 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 ;
187
+ export declare function singleton ( registerInChild ?: boolean ) : any ;
188
+ export declare function singleton < TBase , TImpl extends Impl < TBase > , TArgs extends Args < TBase > > ( key ?: PrimitiveOrDependencyCtor < TBase , TImpl , TArgs > , registerInChild ?: boolean ) : any ;
189
+ export interface Registration < TBase , TImpl extends Impl < TBase > , TArgs extends Args < TBase > > {
190
+ registerResolver ( container : Container , key : PrimitiveOrDependencyCtor < TBase , TImpl , TArgs > , fn : DependencyCtorOrFunctor < TBase , TImpl , TArgs > ) : Resolver ;
191
+ }
192
+ export declare class TransientRegistration < TBase , TImpl extends Impl < TBase > , TArgs extends Args < TBase > > implements Registration < TBase , TImpl , TArgs > {
193
+ constructor ( key ?: PrimitiveOrDependencyCtor < TBase , TImpl , TArgs > ) ;
194
+ registerResolver ( container : Container , key : PrimitiveOrDependencyCtor < TBase , TImpl , TArgs > , fn : DependencyCtorOrFunctor < TBase , TImpl , TArgs > ) : Resolver ;
195
+ }
196
+ export declare class SingletonRegistration < TBase , TImpl extends Impl < TBase > , TArgs extends Args < TBase > > implements Registration < TBase , TImpl , TArgs > {
197
+ constructor ( keyOrRegisterInChild ?: PrimitiveOrDependencyCtor < TBase , TImpl , TArgs > | boolean , registerInChild ?: boolean ) ;
198
+ registerResolver ( container : Container , key : PrimitiveOrDependencyCtor < TBase , TImpl , TArgs > , fn : DependencyCtorOrFunctor < TBase , TImpl , TArgs > ) : Resolver ;
199
+ }
0 commit comments