dnet45/modules/uoa-repository-dashboard-gui/trunk/node_modules/@angular/core/src/di/metadata.d.ts @ 49598
1 |
/**
|
---|---|
2 |
* Type of the Inject decorator / constructor function.
|
3 |
*
|
4 |
* @stable
|
5 |
*/
|
6 |
export interface InjectDecorator { |
7 |
/**
|
8 |
* @whatItDoes A parameter decorator that specifies a dependency.
|
9 |
* @howToUse
|
10 |
* ```
|
11 |
* @Injectable()
|
12 |
* class Car {
|
13 |
* constructor(@Inject("MyEngine") public engine:Engine) {}
|
14 |
* }
|
15 |
* ```
|
16 |
*
|
17 |
* @description
|
18 |
* For more details, see the {@linkDocs guide/dependency-injection "Dependency Injection Guide"}.
|
19 |
*
|
20 |
* ### Example
|
21 |
*
|
22 |
* {@example core/di/ts/metadata_spec.ts region='Inject'}
|
23 |
*
|
24 |
* When `@Inject()` is not present, {@link Injector} will use the type annotation of the
|
25 |
* parameter.
|
26 |
*
|
27 |
* ### Example
|
28 |
*
|
29 |
* {@example core/di/ts/metadata_spec.ts region='InjectWithoutDecorator'}
|
30 |
*
|
31 |
* @stable
|
32 |
*/
|
33 |
(token: any): any; |
34 |
new (token: any): Inject; |
35 |
}
|
36 |
/**
|
37 |
* Type of the Inject metadata.
|
38 |
*
|
39 |
* @stable
|
40 |
*/
|
41 |
export interface Inject { |
42 |
token: any; |
43 |
}
|
44 |
/**
|
45 |
* Inject decorator and metadata.
|
46 |
*
|
47 |
* @stable
|
48 |
* @Annotation
|
49 |
*/
|
50 |
export declare const Inject: InjectDecorator; |
51 |
/**
|
52 |
* Type of the Optional decorator / constructor function.
|
53 |
*
|
54 |
* @stable
|
55 |
*/
|
56 |
export interface OptionalDecorator { |
57 |
/**
|
58 |
* @whatItDoes A parameter metadata that marks a dependency as optional.
|
59 |
* {@link Injector} provides `null` if the dependency is not found.
|
60 |
* @howToUse
|
61 |
* ```
|
62 |
* @Injectable()
|
63 |
* class Car {
|
64 |
* constructor(@Optional() public engine:Engine) {}
|
65 |
* }
|
66 |
* ```
|
67 |
*
|
68 |
* @description
|
69 |
* For more details, see the {@linkDocs guide/dependency-injection "Dependency Injection Guide"}.
|
70 |
*
|
71 |
* ### Example
|
72 |
*
|
73 |
* {@example core/di/ts/metadata_spec.ts region='Optional'}
|
74 |
*
|
75 |
* @stable
|
76 |
*/
|
77 |
(): any; |
78 |
new (): Optional; |
79 |
}
|
80 |
/**
|
81 |
* Type of the Optional metadata.
|
82 |
*
|
83 |
* @stable
|
84 |
*/
|
85 |
export interface Optional { |
86 |
}
|
87 |
/**
|
88 |
* Optional decorator and metadata.
|
89 |
*
|
90 |
* @stable
|
91 |
* @Annotation
|
92 |
*/
|
93 |
export declare const Optional: OptionalDecorator; |
94 |
/**
|
95 |
* Type of the Injectable decorator / constructor function.
|
96 |
*
|
97 |
* @stable
|
98 |
*/
|
99 |
export interface InjectableDecorator { |
100 |
/**
|
101 |
* @whatItDoes A marker metadata that marks a class as available to {@link Injector} for creation.
|
102 |
* @howToUse
|
103 |
* ```
|
104 |
* @Injectable()
|
105 |
* class Car {}
|
106 |
* ```
|
107 |
*
|
108 |
* @description
|
109 |
* For more details, see the {@linkDocs guide/dependency-injection "Dependency Injection Guide"}.
|
110 |
*
|
111 |
* ### Example
|
112 |
*
|
113 |
* {@example core/di/ts/metadata_spec.ts region='Injectable'}
|
114 |
*
|
115 |
* {@link Injector} will throw an error when trying to instantiate a class that
|
116 |
* does not have `@Injectable` marker, as shown in the example below.
|
117 |
*
|
118 |
* {@example core/di/ts/metadata_spec.ts region='InjectableThrows'}
|
119 |
*
|
120 |
* @stable
|
121 |
*/
|
122 |
(): any; |
123 |
new (): Injectable; |
124 |
}
|
125 |
/**
|
126 |
* Type of the Injectable metadata.
|
127 |
*
|
128 |
* @stable
|
129 |
*/
|
130 |
export interface Injectable { |
131 |
}
|
132 |
/**
|
133 |
* Injectable decorator and metadata.
|
134 |
*
|
135 |
* @stable
|
136 |
* @Annotation
|
137 |
*/
|
138 |
export declare const Injectable: InjectableDecorator; |
139 |
/**
|
140 |
* Type of the Self decorator / constructor function.
|
141 |
*
|
142 |
* @stable
|
143 |
*/
|
144 |
export interface SelfDecorator { |
145 |
/**
|
146 |
* @whatItDoes Specifies that an {@link Injector} should retrieve a dependency only from itself.
|
147 |
* @howToUse
|
148 |
* ```
|
149 |
* @Injectable()
|
150 |
* class Car {
|
151 |
* constructor(@Self() public engine:Engine) {}
|
152 |
* }
|
153 |
* ```
|
154 |
*
|
155 |
* @description
|
156 |
* For more details, see the {@linkDocs guide/dependency-injection "Dependency Injection Guide"}.
|
157 |
*
|
158 |
* ### Example
|
159 |
*
|
160 |
* {@example core/di/ts/metadata_spec.ts region='Self'}
|
161 |
*
|
162 |
* @stable
|
163 |
*/
|
164 |
(): any; |
165 |
new (): Self; |
166 |
}
|
167 |
/**
|
168 |
* Type of the Self metadata.
|
169 |
*
|
170 |
* @stable
|
171 |
*/
|
172 |
export interface Self { |
173 |
}
|
174 |
/**
|
175 |
* Self decorator and metadata.
|
176 |
*
|
177 |
* @stable
|
178 |
* @Annotation
|
179 |
*/
|
180 |
export declare const Self: SelfDecorator; |
181 |
/**
|
182 |
* Type of the SkipSelf decorator / constructor function.
|
183 |
*
|
184 |
* @stable
|
185 |
*/
|
186 |
export interface SkipSelfDecorator { |
187 |
/**
|
188 |
* @whatItDoes Specifies that the dependency resolution should start from the parent injector.
|
189 |
* @howToUse
|
190 |
* ```
|
191 |
* @Injectable()
|
192 |
* class Car {
|
193 |
* constructor(@SkipSelf() public engine:Engine) {}
|
194 |
* }
|
195 |
* ```
|
196 |
*
|
197 |
* @description
|
198 |
* For more details, see the {@linkDocs guide/dependency-injection "Dependency Injection Guide"}.
|
199 |
*
|
200 |
* ### Example
|
201 |
*
|
202 |
* {@example core/di/ts/metadata_spec.ts region='SkipSelf'}
|
203 |
*
|
204 |
* @stable
|
205 |
*/
|
206 |
(): any; |
207 |
new (): SkipSelf; |
208 |
}
|
209 |
/**
|
210 |
* Type of the SkipSelf metadata.
|
211 |
*
|
212 |
* @stable
|
213 |
*/
|
214 |
export interface SkipSelf { |
215 |
}
|
216 |
/**
|
217 |
* SkipSelf decorator and metadata.
|
218 |
*
|
219 |
* @stable
|
220 |
* @Annotation
|
221 |
*/
|
222 |
export declare const SkipSelf: SkipSelfDecorator; |
223 |
/**
|
224 |
* Type of the Host decorator / constructor function.
|
225 |
*
|
226 |
* @stable
|
227 |
*/
|
228 |
export interface HostDecorator { |
229 |
/**
|
230 |
* @whatItDoes Specifies that an injector should retrieve a dependency from any injector until
|
231 |
* reaching the host element of the current component.
|
232 |
* @howToUse
|
233 |
* ```
|
234 |
* @Injectable()
|
235 |
* class Car {
|
236 |
* constructor(@Host() public engine:Engine) {}
|
237 |
* }
|
238 |
* ```
|
239 |
*
|
240 |
* @description
|
241 |
* For more details, see the {@linkDocs guide/dependency-injection "Dependency Injection Guide"}.
|
242 |
*
|
243 |
* ### Example
|
244 |
*
|
245 |
* {@example core/di/ts/metadata_spec.ts region='Host'}
|
246 |
*
|
247 |
* @stable
|
248 |
*/
|
249 |
(): any; |
250 |
new (): Host; |
251 |
}
|
252 |
/**
|
253 |
* Type of the Host metadata.
|
254 |
*
|
255 |
* @stable
|
256 |
*/
|
257 |
export interface Host { |
258 |
}
|
259 |
/**
|
260 |
* Host decorator and metadata.
|
261 |
*
|
262 |
* @stable
|
263 |
* @Annotation
|
264 |
*/
|
265 |
export declare const Host: HostDecorator; |