static-injector 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (146) hide show
  1. package/import/commonjs/index.js +1248 -0
  2. package/import/es2015/decorator/injectable.js +14 -0
  3. package/import/es2015/decorator/interface/provider.js +8 -0
  4. package/import/es2015/di/forward_ref.js +53 -0
  5. package/import/es2015/di/inject_switch.js +31 -0
  6. package/import/es2015/di/injection_token.js +71 -0
  7. package/import/es2015/di/injector.js +63 -0
  8. package/import/es2015/di/injector_compatibility.js +172 -0
  9. package/import/es2015/di/injector_marker.js +8 -0
  10. package/import/es2015/di/injector_token.js +21 -0
  11. package/import/es2015/di/interface/defs.js +72 -0
  12. package/import/es2015/di/interface/injector.js +25 -0
  13. package/import/es2015/di/interface/provider.js +8 -0
  14. package/import/es2015/di/metadata.js +49 -0
  15. package/import/es2015/di/null_injector.js +19 -0
  16. package/import/es2015/di/provider_token.js +8 -0
  17. package/import/es2015/di/r3_injector.js +382 -0
  18. package/import/es2015/di/scope.js +14 -0
  19. package/import/es2015/index.js +11 -0
  20. package/import/es2015/interface/lifecycle_hooks.js +8 -0
  21. package/import/es2015/interface/type.js +8 -0
  22. package/import/es2015/render3/definition_factory.js +15 -0
  23. package/import/es2015/render3/error_code.js +29 -0
  24. package/import/es2015/render3/errors_di.js +14 -0
  25. package/import/es2015/render3/fields.js +11 -0
  26. package/import/es2015/render3/instructions/di.js +23 -0
  27. package/import/es2015/render3/util/stringify_utils.js +37 -0
  28. package/import/es2015/util/array_utils.js +17 -0
  29. package/import/es2015/util/closure.js +19 -0
  30. package/import/es2015/util/decorators.js +30 -0
  31. package/import/es2015/util/empty.js +14 -0
  32. package/import/es2015/util/property.js +15 -0
  33. package/import/es2015/util/stringify.js +30 -0
  34. package/import/fesm2015/index.js +1211 -0
  35. package/import/typings/decorator/injectable.d.ts +82 -0
  36. package/import/typings/decorator/interface/provider.d.ts +312 -0
  37. package/import/typings/di/forward_ref.d.ts +49 -0
  38. package/import/typings/di/inject_switch.d.ts +17 -0
  39. package/import/typings/di/injection_token.d.ts +57 -0
  40. package/import/typings/di/injector.d.ts +76 -0
  41. package/import/typings/di/injector_compatibility.d.ts +77 -0
  42. package/import/typings/di/injector_marker.d.ts +23 -0
  43. package/import/typings/di/injector_token.d.ts +18 -0
  44. package/import/typings/di/interface/defs.d.ts +155 -0
  45. package/import/typings/di/interface/injector.d.ts +48 -0
  46. package/import/typings/di/interface/provider.d.ts +312 -0
  47. package/import/typings/di/metadata.d.ts +176 -0
  48. package/import/typings/di/null_injector.d.ts +11 -0
  49. package/import/typings/di/provider_token.d.ts +17 -0
  50. package/import/typings/di/r3_injector.d.ts +92 -0
  51. package/import/typings/di/scope.d.ts +14 -0
  52. package/import/typings/index.d.ts +11 -0
  53. package/import/typings/interface/lifecycle_hooks.d.ts +28 -0
  54. package/import/typings/interface/type.d.ts +21 -0
  55. package/import/typings/render3/definition_factory.d.ts +24 -0
  56. package/import/typings/render3/error_code.d.ts +24 -0
  57. package/import/typings/render3/errors_di.d.ts +2 -0
  58. package/import/typings/render3/fields.d.ts +8 -0
  59. package/import/typings/render3/instructions/di.d.ts +20 -0
  60. package/import/typings/render3/util/stringify_utils.d.ts +20 -0
  61. package/import/typings/util/array_utils.d.ts +10 -0
  62. package/import/typings/util/closure.d.ts +17 -0
  63. package/import/typings/util/decorators.d.ts +27 -0
  64. package/import/typings/util/empty.d.ts +14 -0
  65. package/import/typings/util/property.d.ts +8 -0
  66. package/import/typings/util/stringify.d.ts +8 -0
  67. package/package.json +34 -0
  68. package/readme.md +27 -0
  69. package/transform/compiler/index.d.ts +5 -0
  70. package/transform/compiler/index.js +17 -0
  71. package/transform/compiler/src/core.d.ts +19 -0
  72. package/transform/compiler/src/core.js +9 -0
  73. package/transform/compiler/src/injectable_compiler_2.d.ts +53 -0
  74. package/transform/compiler/src/injectable_compiler_2.js +159 -0
  75. package/transform/compiler/src/output/output_ast.d.ts +534 -0
  76. package/transform/compiler/src/output/output_ast.js +986 -0
  77. package/transform/compiler/src/parse_util.d.ts +50 -0
  78. package/transform/compiler/src/parse_util.js +61 -0
  79. package/transform/compiler/src/render3/partial/api.d.ts +166 -0
  80. package/transform/compiler/src/render3/partial/api.js +11 -0
  81. package/transform/compiler/src/render3/partial/util.d.ts +16 -0
  82. package/transform/compiler/src/render3/partial/util.js +44 -0
  83. package/transform/compiler/src/render3/r3_factory.d.ts +97 -0
  84. package/transform/compiler/src/render3/r3_factory.js +239 -0
  85. package/transform/compiler/src/render3/r3_identifiers.d.ts +20 -0
  86. package/transform/compiler/src/render3/r3_identifiers.js +51 -0
  87. package/transform/compiler/src/render3/util.d.ts +21 -0
  88. package/transform/compiler/src/render3/util.js +41 -0
  89. package/transform/compiler/src/render3/view/util.d.ts +30 -0
  90. package/transform/compiler/src/render3/view/util.js +57 -0
  91. package/transform/compiler-cli/src/ngtsc/annotations/src/factory.d.ts +11 -0
  92. package/transform/compiler-cli/src/ngtsc/annotations/src/factory.js +21 -0
  93. package/transform/compiler-cli/src/ngtsc/annotations/src/injectable.d.ts +42 -0
  94. package/transform/compiler-cli/src/ngtsc/annotations/src/injectable.js +278 -0
  95. package/transform/compiler-cli/src/ngtsc/annotations/src/util.d.ts +91 -0
  96. package/transform/compiler-cli/src/ngtsc/annotations/src/util.js +370 -0
  97. package/transform/compiler-cli/src/ngtsc/diagnostics/error.d.ts +24 -0
  98. package/transform/compiler-cli/src/ngtsc/diagnostics/error.js +76 -0
  99. package/transform/compiler-cli/src/ngtsc/diagnostics/error_code.d.ts +188 -0
  100. package/transform/compiler-cli/src/ngtsc/diagnostics/error_code.js +206 -0
  101. package/transform/compiler-cli/src/ngtsc/diagnostics/index.d.ts +2 -0
  102. package/transform/compiler-cli/src/ngtsc/diagnostics/index.js +14 -0
  103. package/transform/compiler-cli/src/ngtsc/imports/index.d.ts +1 -0
  104. package/transform/compiler-cli/src/ngtsc/imports/index.js +13 -0
  105. package/transform/compiler-cli/src/ngtsc/imports/src/core.d.ts +36 -0
  106. package/transform/compiler-cli/src/ngtsc/imports/src/core.js +25 -0
  107. package/transform/compiler-cli/src/ngtsc/reflection/index.d.ts +3 -0
  108. package/transform/compiler-cli/src/ngtsc/reflection/index.js +15 -0
  109. package/transform/compiler-cli/src/ngtsc/reflection/src/host.d.ts +667 -0
  110. package/transform/compiler-cli/src/ngtsc/reflection/src/host.js +98 -0
  111. package/transform/compiler-cli/src/ngtsc/reflection/src/type_to_value.d.ts +24 -0
  112. package/transform/compiler-cli/src/ngtsc/reflection/src/type_to_value.js +271 -0
  113. package/transform/compiler-cli/src/ngtsc/reflection/src/typescript.d.ts +50 -0
  114. package/transform/compiler-cli/src/ngtsc/reflection/src/typescript.js +396 -0
  115. package/transform/compiler-cli/src/ngtsc/reflection/src/util.d.ts +12 -0
  116. package/transform/compiler-cli/src/ngtsc/reflection/src/util.js +45 -0
  117. package/transform/compiler-cli/src/ngtsc/transform/index.d.ts +2 -0
  118. package/transform/compiler-cli/src/ngtsc/transform/index.js +14 -0
  119. package/transform/compiler-cli/src/ngtsc/transform/src/api.d.ts +115 -0
  120. package/transform/compiler-cli/src/ngtsc/transform/src/api.js +30 -0
  121. package/transform/compiler-cli/src/ngtsc/transform/src/utils.d.ts +15 -0
  122. package/transform/compiler-cli/src/ngtsc/transform/src/utils.js +84 -0
  123. package/transform/compiler-cli/src/ngtsc/translator/index.d.ts +5 -0
  124. package/transform/compiler-cli/src/ngtsc/translator/index.js +17 -0
  125. package/transform/compiler-cli/src/ngtsc/translator/src/api/ast_factory.d.ts +274 -0
  126. package/transform/compiler-cli/src/ngtsc/translator/src/api/ast_factory.js +9 -0
  127. package/transform/compiler-cli/src/ngtsc/translator/src/api/import_generator.d.ts +27 -0
  128. package/transform/compiler-cli/src/ngtsc/translator/src/api/import_generator.js +9 -0
  129. package/transform/compiler-cli/src/ngtsc/translator/src/context.d.ts +18 -0
  130. package/transform/compiler-cli/src/ngtsc/translator/src/context.js +27 -0
  131. package/transform/compiler-cli/src/ngtsc/translator/src/import_manager.d.ts +29 -0
  132. package/transform/compiler-cli/src/ngtsc/translator/src/import_manager.js +70 -0
  133. package/transform/compiler-cli/src/ngtsc/translator/src/translator.d.ts +58 -0
  134. package/transform/compiler-cli/src/ngtsc/translator/src/translator.js +270 -0
  135. package/transform/compiler-cli/src/ngtsc/translator/src/typescript_ast_factory.d.ts +54 -0
  136. package/transform/compiler-cli/src/ngtsc/translator/src/typescript_ast_factory.js +245 -0
  137. package/transform/compiler-cli/src/ngtsc/translator/src/typescript_translator.d.ts +13 -0
  138. package/transform/compiler-cli/src/ngtsc/translator/src/typescript_translator.js +21 -0
  139. package/transform/compiler-cli/src/ngtsc/util/src/typescript.d.ts +11 -0
  140. package/transform/compiler-cli/src/ngtsc/util/src/typescript.js +39 -0
  141. package/transform/index.d.ts +1 -0
  142. package/transform/index.js +13 -0
  143. package/transform/injectable-transform.d.ts +41 -0
  144. package/transform/injectable-transform.js +195 -0
  145. package/transform/node-Iteration.d.ts +2 -0
  146. package/transform/node-Iteration.js +12 -0
@@ -0,0 +1,312 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.io/license
7
+ */
8
+ import { Type } from "../../interface/type";
9
+ /**
10
+ * Configures the `Injector` to return a value for a token.
11
+ * Base for `ValueProvider` decorator.
12
+ *
13
+ * @publicApi
14
+ */
15
+ export interface ValueSansProvider {
16
+ /**
17
+ * The value to inject.
18
+ */
19
+ useValue: any;
20
+ }
21
+ /**
22
+ * Configures the `Injector` to return a value for a token.
23
+ * @see ["Dependency Injection Guide"](guide/dependency-injection).
24
+ *
25
+ * @usageNotes
26
+ *
27
+ * ### Example
28
+ *
29
+ * {@example core/di/ts/provider_spec.ts region='ValueProvider'}
30
+ *
31
+ * ### Multi-value example
32
+ *
33
+ * {@example core/di/ts/provider_spec.ts region='MultiProviderAspect'}
34
+ *
35
+ * @publicApi
36
+ */
37
+ export interface ValueProvider extends ValueSansProvider {
38
+ /**
39
+ * An injection token. Typically an instance of `Type` or `InjectionToken`, but can be `any`.
40
+ */
41
+ provide: any;
42
+ /**
43
+ * When true, injector returns an array of instances. This is useful to allow multiple
44
+ * providers spread across many files to provide configuration information to a common token.
45
+ */
46
+ multi?: boolean;
47
+ }
48
+ /**
49
+ * Configures the `Injector` to return an instance of `useClass` for a token.
50
+ * Base for `StaticClassProvider` decorator.
51
+ *
52
+ * @publicApi
53
+ */
54
+ export interface StaticClassSansProvider {
55
+ /**
56
+ * An optional class to instantiate for the `token`. By default, the `provide`
57
+ * class is instantiated.
58
+ */
59
+ useClass: Type<any>;
60
+ /**
61
+ * A list of `token`s to be resolved by the injector. The list of values is then
62
+ * used as arguments to the `useClass` constructor.
63
+ */
64
+ deps: any[];
65
+ }
66
+ /**
67
+ * Configures the `Injector` to return an instance of `useClass` for a token.
68
+ * @see ["Dependency Injection Guide"](guide/dependency-injection).
69
+ *
70
+ * @usageNotes
71
+ *
72
+ * {@example core/di/ts/provider_spec.ts region='StaticClassProvider'}
73
+ *
74
+ * Note that following two providers are not equal:
75
+ *
76
+ * {@example core/di/ts/provider_spec.ts region='StaticClassProviderDifference'}
77
+ *
78
+ * ### Multi-value example
79
+ *
80
+ * {@example core/di/ts/provider_spec.ts region='MultiProviderAspect'}
81
+ *
82
+ * @publicApi
83
+ */
84
+ export interface StaticClassProvider extends StaticClassSansProvider {
85
+ /**
86
+ * An injection token. Typically an instance of `Type` or `InjectionToken`, but can be `any`.
87
+ */
88
+ provide: any;
89
+ /**
90
+ * When true, injector returns an array of instances. This is useful to allow multiple
91
+ * providers spread across many files to provide configuration information to a common token.
92
+ */
93
+ multi?: boolean;
94
+ }
95
+ /**
96
+ * Configures the `Injector` to return an instance of a token.
97
+ *
98
+ * @see ["Dependency Injection Guide"](guide/dependency-injection).
99
+ *
100
+ * @usageNotes
101
+ *
102
+ * ```ts
103
+ * @Injectable(SomeModule, {deps: []})
104
+ * class MyService {}
105
+ * ```
106
+ *
107
+ * @publicApi
108
+ */
109
+ export interface ConstructorSansProvider {
110
+ /**
111
+ * A list of `token`s to be resolved by the injector.
112
+ */
113
+ deps?: any[];
114
+ }
115
+ /**
116
+ * Configures the `Injector` to return an instance of a token.
117
+ *
118
+ * @see ["Dependency Injection Guide"](guide/dependency-injection).
119
+ *
120
+ * @usageNotes
121
+ *
122
+ * {@example core/di/ts/provider_spec.ts region='ConstructorProvider'}
123
+ *
124
+ * ### Multi-value example
125
+ *
126
+ * {@example core/di/ts/provider_spec.ts region='MultiProviderAspect'}
127
+ *
128
+ * @publicApi
129
+ */
130
+ export interface ConstructorProvider extends ConstructorSansProvider {
131
+ /**
132
+ * An injection token. Typically an instance of `Type` or `InjectionToken`, but can be `any`.
133
+ */
134
+ provide: Type<any>;
135
+ /**
136
+ * When true, injector returns an array of instances. This is useful to allow multiple
137
+ * providers spread across many files to provide configuration information to a common token.
138
+ */
139
+ multi?: boolean;
140
+ }
141
+ /**
142
+ * Configures the `Injector` to return a value of another `useExisting` token.
143
+ *
144
+ * @see `ExistingProvider`
145
+ * @see ["Dependency Injection Guide"](guide/dependency-injection).
146
+ *
147
+ * @publicApi
148
+ */
149
+ export interface ExistingSansProvider {
150
+ /**
151
+ * Existing `token` to return. (Equivalent to `injector.get(useExisting)`)
152
+ */
153
+ useExisting: any;
154
+ }
155
+ /**
156
+ * Configures the `Injector` to return a value of another `useExisting` token.
157
+ *
158
+ * @see ["Dependency Injection Guide"](guide/dependency-injection).
159
+ *
160
+ * @usageNotes
161
+ *
162
+ * {@example core/di/ts/provider_spec.ts region='ExistingProvider'}
163
+ *
164
+ * ### Multi-value example
165
+ *
166
+ * {@example core/di/ts/provider_spec.ts region='MultiProviderAspect'}
167
+ *
168
+ * @publicApi
169
+ */
170
+ export interface ExistingProvider extends ExistingSansProvider {
171
+ /**
172
+ * An injection token. Typically an instance of `Type` or `InjectionToken`, but can be `any`.
173
+ */
174
+ provide: any;
175
+ /**
176
+ * When true, injector returns an array of instances. This is useful to allow multiple
177
+ * providers spread across many files to provide configuration information to a common token.
178
+ */
179
+ multi?: boolean;
180
+ }
181
+ /**
182
+ * Configures the `Injector` to return a value by invoking a `useFactory` function.
183
+ *
184
+ * @see `FactoryProvider`
185
+ * @see ["Dependency Injection Guide"](guide/dependency-injection).
186
+ *
187
+ * @publicApi
188
+ */
189
+ export interface FactorySansProvider {
190
+ /**
191
+ * A function to invoke to create a value for this `token`. The function is invoked with
192
+ * resolved values of `token`s in the `deps` field.
193
+ */
194
+ useFactory: Function;
195
+ /**
196
+ * A list of `token`s to be resolved by the injector. The list of values is then
197
+ * used as arguments to the `useFactory` function.
198
+ */
199
+ deps?: any[];
200
+ }
201
+ /**
202
+ * Configures the `Injector` to return a value by invoking a `useFactory` function.
203
+ * @see ["Dependency Injection Guide"](guide/dependency-injection).
204
+ *
205
+ * @usageNotes
206
+ *
207
+ * {@example core/di/ts/provider_spec.ts region='FactoryProvider'}
208
+ *
209
+ * Dependencies can also be marked as optional:
210
+ *
211
+ * {@example core/di/ts/provider_spec.ts region='FactoryProviderOptionalDeps'}
212
+ *
213
+ * ### Multi-value example
214
+ *
215
+ * {@example core/di/ts/provider_spec.ts region='MultiProviderAspect'}
216
+ *
217
+ * @publicApi
218
+ */
219
+ export interface FactoryProvider extends FactorySansProvider {
220
+ /**
221
+ * An injection token. (Typically an instance of `Type` or `InjectionToken`, but can be `any`).
222
+ */
223
+ provide: any;
224
+ /**
225
+ * When true, injector returns an array of instances. This is useful to allow multiple
226
+ * providers spread across many files to provide configuration information to a common token.
227
+ */
228
+ multi?: boolean;
229
+ }
230
+ /**
231
+ * Describes how an `Injector` should be configured as static (that is, without reflection).
232
+ * A static provider provides tokens to an injector for various types of dependencies.
233
+ *
234
+ * @see `Injector.create()`.
235
+ * @see ["Dependency Injection Guide"](guide/dependency-injection-providers).
236
+ *
237
+ * @publicApi
238
+ */
239
+ export declare type StaticProvider = ValueProvider | ExistingProvider | StaticClassProvider | ConstructorProvider | FactoryProvider | any[];
240
+ /**
241
+ * Configures the `Injector` to return an instance of `Type` when `Type' is used as the token.
242
+ *
243
+ * Create an instance by invoking the `new` operator and supplying additional arguments.
244
+ * This form is a short form of `TypeProvider`;
245
+ *
246
+ * For more details, see the ["Dependency Injection Guide"](guide/dependency-injection).
247
+ *
248
+ * @usageNotes
249
+ *
250
+ * {@example core/di/ts/provider_spec.ts region='TypeProvider'}
251
+ *
252
+ * @publicApi
253
+ */
254
+ export interface TypeProvider extends Type<any> {
255
+ }
256
+ /**
257
+ * Configures the `Injector` to return a value by invoking a `useClass` function.
258
+ * Base for `ClassProvider` decorator.
259
+ *
260
+ * @see ["Dependency Injection Guide"](guide/dependency-injection).
261
+ *
262
+ * @publicApi
263
+ */
264
+ export interface ClassSansProvider {
265
+ /**
266
+ * Class to instantiate for the `token`.
267
+ */
268
+ useClass: Type<any>;
269
+ }
270
+ /**
271
+ * Configures the `Injector` to return an instance of `useClass` for a token.
272
+ * @see ["Dependency Injection Guide"](guide/dependency-injection).
273
+ *
274
+ * @usageNotes
275
+ *
276
+ * {@example core/di/ts/provider_spec.ts region='ClassProvider'}
277
+ *
278
+ * Note that following two providers are not equal:
279
+ *
280
+ * {@example core/di/ts/provider_spec.ts region='ClassProviderDifference'}
281
+ *
282
+ * ### Multi-value example
283
+ *
284
+ * {@example core/di/ts/provider_spec.ts region='MultiProviderAspect'}
285
+ *
286
+ * @publicApi
287
+ */
288
+ export interface ClassProvider extends ClassSansProvider {
289
+ /**
290
+ * An injection token. (Typically an instance of `Type` or `InjectionToken`, but can be `any`).
291
+ */
292
+ provide: any;
293
+ /**
294
+ * When true, injector returns an array of instances. This is useful to allow multiple
295
+ * providers spread across many files to provide configuration information to a common token.
296
+ */
297
+ multi?: boolean;
298
+ }
299
+ /**
300
+ * Describes how the `Injector` should be configured.
301
+ * @see ["Dependency Injection Guide"](guide/dependency-injection).
302
+ *
303
+ * @see `StaticProvider`
304
+ *
305
+ * @publicApi
306
+ */
307
+ export declare type Provider = TypeProvider | ValueProvider | ClassProvider | ConstructorProvider | ExistingProvider | FactoryProvider | any[];
308
+ /**
309
+ * Describes a function that is used to process provider lists (such as provider
310
+ * overrides).
311
+ */
312
+ export declare type ProcessProvidersFunction = (providers: Provider[]) => Provider[];
@@ -0,0 +1,176 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.io/license
7
+ */
8
+ /**
9
+ * Type of the Inject decorator / constructor function.
10
+ *
11
+ * @publicApi
12
+ */
13
+ export interface InjectDecorator {
14
+ /**
15
+ * Parameter decorator on a dependency parameter of a class constructor
16
+ * that specifies a custom provider of the dependency.
17
+ *
18
+ * @usageNotes
19
+ * The following example shows a class constructor that specifies a
20
+ * custom provider of a dependency using the parameter decorator.
21
+ *
22
+ * When `@Inject()` is not present, the injector uses the type annotation of the
23
+ * parameter as the provider.
24
+ *
25
+ * <code-example path="core/di/ts/metadata_spec.ts" region="InjectWithoutDecorator">
26
+ * </code-example>
27
+ *
28
+ * @see ["Dependency Injection Guide"](guide/dependency-injection)
29
+ *
30
+ */
31
+ (token: any): any;
32
+ new (token: any): Inject;
33
+ }
34
+ /**
35
+ * Type of the Inject metadata.
36
+ *
37
+ * @publicApi
38
+ */
39
+ export interface Inject {
40
+ /**
41
+ * A [DI token](guide/glossary#di-token) that maps to the dependency to be injected.
42
+ */
43
+ token: any;
44
+ }
45
+ /**
46
+ * Inject decorator and metadata.
47
+ *
48
+ * @Annotation
49
+ * @publicApi
50
+ */
51
+ export declare const Inject: InjectDecorator;
52
+ /**
53
+ * Type of the Optional decorator / constructor function.
54
+ *
55
+ * @publicApi
56
+ */
57
+ export interface OptionalDecorator {
58
+ /**
59
+ * Parameter decorator to be used on constructor parameters,
60
+ * which marks the parameter as being an optional dependency.
61
+ * The DI framework provides `null` if the dependency is not found.
62
+ *
63
+ * Can be used together with other parameter decorators
64
+ * that modify how dependency injection operates.
65
+ *
66
+ * @usageNotes
67
+ *
68
+ * The following code allows the possibility of a `null` result:
69
+ *
70
+ * <code-example path="core/di/ts/metadata_spec.ts" region="Optional">
71
+ * </code-example>
72
+ *
73
+ * @see ["Dependency Injection Guide"](guide/dependency-injection).
74
+ */
75
+ (): any;
76
+ new (): Optional;
77
+ }
78
+ /**
79
+ * Type of the Optional metadata.
80
+ *
81
+ * @publicApi
82
+ */
83
+ export interface Optional {
84
+ }
85
+ /**
86
+ * Optional decorator and metadata.
87
+ *
88
+ * @Annotation
89
+ * @publicApi
90
+ */
91
+ export declare const Optional: OptionalDecorator;
92
+ /**
93
+ * Type of the Self decorator / constructor function.
94
+ *
95
+ * @publicApi
96
+ */
97
+ export interface SelfDecorator {
98
+ /**
99
+ * Parameter decorator to be used on constructor parameters,
100
+ * which tells the DI framework to start dependency resolution from the local injector.
101
+ *
102
+ * Resolution works upward through the injector hierarchy, so the children
103
+ * of this class must configure their own providers or be prepared for a `null` result.
104
+ *
105
+ * @usageNotes
106
+ *
107
+ * In the following example, the dependency can be resolved
108
+ * by the local injector when instantiating the class itself, but not
109
+ * when instantiating a child.
110
+ *
111
+ * <code-example path="core/di/ts/metadata_spec.ts" region="Self">
112
+ * </code-example>
113
+ *
114
+ * @see `SkipSelf`
115
+ * @see `Optional`
116
+ *
117
+ */
118
+ (): any;
119
+ new (): Self;
120
+ }
121
+ /**
122
+ * Type of the Self metadata.
123
+ *
124
+ * @publicApi
125
+ */
126
+ export interface Self {
127
+ }
128
+ /**
129
+ * Self decorator and metadata.
130
+ *
131
+ * @Annotation
132
+ * @publicApi
133
+ */
134
+ export declare const Self: SelfDecorator;
135
+ /**
136
+ * Type of the `SkipSelf` decorator / constructor function.
137
+ *
138
+ * @publicApi
139
+ */
140
+ export interface SkipSelfDecorator {
141
+ /**
142
+ * Parameter decorator to be used on constructor parameters,
143
+ * which tells the DI framework to start dependency resolution from the parent injector.
144
+ * Resolution works upward through the injector hierarchy, so the local injector
145
+ * is not checked for a provider.
146
+ *
147
+ * @usageNotes
148
+ *
149
+ * In the following example, the dependency can be resolved when
150
+ * instantiating a child, but not when instantiating the class itself.
151
+ *
152
+ * <code-example path="core/di/ts/metadata_spec.ts" region="SkipSelf">
153
+ * </code-example>
154
+ *
155
+ * @see [Dependency Injection guide](guide/dependency-injection-in-action#skip).
156
+ * @see `Self`
157
+ * @see `Optional`
158
+ *
159
+ */
160
+ (): any;
161
+ new (): SkipSelf;
162
+ }
163
+ /**
164
+ * Type of the `SkipSelf` metadata.
165
+ *
166
+ * @publicApi
167
+ */
168
+ export interface SkipSelf {
169
+ }
170
+ /**
171
+ * `SkipSelf` decorator and metadata.
172
+ *
173
+ * @Annotation
174
+ * @publicApi
175
+ */
176
+ export declare const SkipSelf: SkipSelfDecorator;