1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | import { ChangeDetectionStrategy, ViewEncapsulation } from '../../core';
|
9 | import * as o from '../../output/output_ast';
|
10 | export interface R3PartialDeclaration {
|
11 | |
12 |
|
13 |
|
14 | minVersion: string;
|
15 | |
16 |
|
17 |
|
18 |
|
19 | version: string;
|
20 | |
21 |
|
22 |
|
23 |
|
24 | ngImport: o.Expression;
|
25 | |
26 |
|
27 |
|
28 | type: o.Expression;
|
29 | }
|
30 |
|
31 |
|
32 |
|
33 | export interface R3DeclareDirectiveMetadata extends R3PartialDeclaration {
|
34 | |
35 |
|
36 |
|
37 | selector?: string;
|
38 | |
39 |
|
40 |
|
41 |
|
42 | inputs?: {
|
43 | [classPropertyName: string]: string | [string, string];
|
44 | };
|
45 | |
46 |
|
47 |
|
48 | outputs?: {
|
49 | [classPropertyName: string]: string;
|
50 | };
|
51 | |
52 |
|
53 |
|
54 | host?: {
|
55 | |
56 |
|
57 |
|
58 | attributes?: {
|
59 | [key: string]: o.Expression;
|
60 | };
|
61 | |
62 |
|
63 |
|
64 | listeners: {
|
65 | [key: string]: string;
|
66 | };
|
67 | |
68 |
|
69 |
|
70 | properties?: {
|
71 | [key: string]: string;
|
72 | };
|
73 | |
74 |
|
75 |
|
76 |
|
77 | classAttribute?: string;
|
78 | |
79 |
|
80 |
|
81 |
|
82 | styleAttribute?: string;
|
83 | };
|
84 | |
85 |
|
86 |
|
87 | queries?: R3DeclareQueryMetadata[];
|
88 | |
89 |
|
90 |
|
91 | viewQueries?: R3DeclareQueryMetadata[];
|
92 | |
93 |
|
94 |
|
95 | providers?: o.Expression;
|
96 | |
97 |
|
98 |
|
99 | exportAs?: string[];
|
100 | |
101 |
|
102 |
|
103 | usesInheritance?: boolean;
|
104 | |
105 |
|
106 |
|
107 | usesOnChanges?: boolean;
|
108 | }
|
109 |
|
110 |
|
111 |
|
112 | export interface R3DeclareComponentMetadata extends R3DeclareDirectiveMetadata {
|
113 | |
114 |
|
115 |
|
116 |
|
117 |
|
118 |
|
119 | template: o.Expression;
|
120 | |
121 |
|
122 |
|
123 |
|
124 | isInline?: boolean;
|
125 | |
126 |
|
127 |
|
128 | styles?: string[];
|
129 | |
130 |
|
131 |
|
132 |
|
133 |
|
134 |
|
135 | components?: R3DeclareUsedDirectiveMetadata[];
|
136 | |
137 |
|
138 |
|
139 |
|
140 |
|
141 |
|
142 | directives?: R3DeclareUsedDirectiveMetadata[];
|
143 | |
144 |
|
145 |
|
146 |
|
147 | pipes?: {
|
148 | [pipeName: string]: o.Expression | (() => o.Expression);
|
149 | };
|
150 | /**
|
151 | * The list of view providers defined in the component.
|
152 | */
|
153 | viewProviders?: o.Expression;
|
154 | /**
|
155 | * A collection of animation triggers that will be used in the component template.
|
156 | */
|
157 | animations?: o.Expression;
|
158 | /**
|
159 | * Strategy used for detecting changes in the component.
|
160 | * Defaults to `ChangeDetectionStrategy.Default`.
|
161 | */
|
162 | changeDetection?: ChangeDetectionStrategy;
|
163 | /**
|
164 | * An encapsulation policy for the component's styling.
|
165 | * Defaults to `ViewEncapsulation.Emulated`.
|
166 | */
|
167 | encapsulation?: ViewEncapsulation;
|
168 | /**
|
169 | * Overrides the default interpolation start and end delimiters. Defaults to {{ and }}.
|
170 | */
|
171 | interpolation?: [string, string];
|
172 | /**
|
173 | * Whether whitespace in the template should be preserved. Defaults to false.
|
174 | */
|
175 | preserveWhitespaces?: boolean;
|
176 | }
|
177 | export interface R3DeclareUsedDirectiveMetadata {
|
178 | /**
|
179 | * Selector of the directive.
|
180 | */
|
181 | selector: string;
|
182 | /**
|
183 | * Reference to the directive class (possibly a forward reference wrapped in a `forwardRef`
|
184 | * invocation).
|
185 | */
|
186 | type: o.Expression | (() => o.Expression);
|
187 | /**
|
188 | * Property names of the directive's inputs.
|
189 | */
|
190 | inputs?: string[];
|
191 | /**
|
192 | * Event names of the directive's outputs.
|
193 | */
|
194 | outputs?: string[];
|
195 | /**
|
196 | * Names by which this directive exports itself for references.
|
197 | */
|
198 | exportAs?: string[];
|
199 | }
|
200 | export interface R3DeclareQueryMetadata {
|
201 | /**
|
202 | * Name of the property on the class to update with query results.
|
203 | */
|
204 | propertyName: string;
|
205 | /**
|
206 | * Whether to read only the first matching result, or an array of results. Defaults to false.
|
207 | */
|
208 | first?: boolean;
|
209 | /**
|
210 | * Either an expression representing a type (possibly wrapped in a `forwardRef()`) or
|
211 | * `InjectionToken` for the query predicate, or a set of string selectors.
|
212 | */
|
213 | predicate: o.Expression | string[];
|
214 | /**
|
215 | * Whether to include only direct children or all descendants. Defaults to false.
|
216 | */
|
217 | descendants?: boolean;
|
218 | /**
|
219 | * True to only fire changes if there are underlying changes to the query.
|
220 | */
|
221 | emitDistinctChangesOnly?: boolean;
|
222 | /**
|
223 | * An expression representing a type to read from each matched node, or null if the default value
|
224 | * for a given node is to be returned.
|
225 | */
|
226 | read?: o.Expression;
|
227 | /**
|
228 | * Whether or not this query should collect only static results. Defaults to false.
|
229 | *
|
230 | * If static is true, the query's results will be set on the component after nodes are created,
|
231 | * but before change detection runs. This means that any results that relied upon change detection
|
232 | * to run (e.g. results inside *ngIf or *ngFor views) will not be collected. Query results are
|
233 | * available in the ngOnInit hook.
|
234 | *
|
235 | * If static is false, the query's results will be set on the component after change detection
|
236 | * runs. This means that the query results can contain nodes inside *ngIf or *ngFor views, but
|
237 | * the results will not be available in the ngOnInit hook (only in the ngAfterContentInit for
|
238 | * content hooks and ngAfterViewInit for view hooks).
|
239 | */
|
240 | static?: boolean;
|
241 | }
|
242 | /**
|
243 | * Describes the shape of the objects that the `ɵɵngDeclareNgModule()` accepts.
|
244 | */
|
245 | export interface R3DeclareNgModuleMetadata extends R3PartialDeclaration {
|
246 | /**
|
247 | * An array of expressions representing the bootstrap components specified by the module.
|
248 | */
|
249 | bootstrap?: o.Expression[];
|
250 | /**
|
251 | * An array of expressions representing the directives and pipes declared by the module.
|
252 | */
|
253 | declarations?: o.Expression[];
|
254 | /**
|
255 | * An array of expressions representing the imports of the module.
|
256 | */
|
257 | imports?: o.Expression[];
|
258 | /**
|
259 | * An array of expressions representing the exports of the module.
|
260 | */
|
261 | exports?: o.Expression[];
|
262 | /**
|
263 | * The set of schemas that declare elements to be allowed in the NgModule.
|
264 | */
|
265 | schemas?: o.Expression[];
|
266 | /** Unique ID or expression representing the unique ID of an NgModule. */
|
267 | id?: o.Expression;
|
268 | }
|
269 | /**
|
270 | * Describes the shape of the objects that the `ɵɵngDeclareInjector()` accepts.
|
271 | */
|
272 | export interface R3DeclareInjectorMetadata extends R3PartialDeclaration {
|
273 | /**
|
274 | * The list of providers provided by the injector.
|
275 | */
|
276 | providers?: o.Expression;
|
277 | /**
|
278 | * The list of imports into the injector.
|
279 | */
|
280 | imports?: o.Expression[];
|
281 | }
|
282 | /**
|
283 | * Describes the shape of the object that the `ɵɵngDeclarePipe()` function accepts.
|
284 | *
|
285 | * This interface serves primarily as documentation, as conformance to this interface is not
|
286 | * enforced during linking.
|
287 | */
|
288 | export interface R3DeclarePipeMetadata extends R3PartialDeclaration {
|
289 | /**
|
290 | * The name to use in templates to refer to this pipe.
|
291 | */
|
292 | name: string;
|
293 | /**
|
294 | * Whether this pipe is "pure".
|
295 | *
|
296 | * A pure pipe's `transform()` method is only invoked when its input arguments change.
|
297 | *
|
298 | * Default: true.
|
299 | */
|
300 | pure?: boolean;
|
301 | }
|
302 | /**
|
303 | * Describes the shape of the object that the `ɵɵngDeclareFactory()` function accepts.
|
304 | *
|
305 | * This interface serves primarily as documentation, as conformance to this interface is not
|
306 | * enforced during linking.
|
307 | */
|
308 | export interface R3DeclareFactoryMetadata extends R3PartialDeclaration {
|
309 | /**
|
310 | * A collection of dependencies that this factory relies upon.
|
311 | *
|
312 | * If this is `null`, then the type's constructor is nonexistent and will be inherited from an
|
313 | * ancestor of the type.
|
314 | *
|
315 | * If this is `'invalid'`, then one or more of the parameters wasn't resolvable and any attempt to
|
316 | * use these deps will result in a runtime error.
|
317 | */
|
318 | deps: R3DeclareDependencyMetadata[] | 'invalid' | null;
|
319 | /**
|
320 | * Type of the target being created by the factory.
|
321 | */
|
322 | target: FactoryTarget;
|
323 | }
|
324 | export declare enum FactoryTarget {
|
325 | Directive = 0,
|
326 | Component = 1,
|
327 | Injectable = 2,
|
328 | Pipe = 3,
|
329 | NgModule = 4
|
330 | }
|
331 | /**
|
332 | * Describes the shape of the object that the `ɵɵngDeclareInjectable()` function accepts.
|
333 | *
|
334 | * This interface serves primarily as documentation, as conformance to this interface is not
|
335 | * enforced during linking.
|
336 | */
|
337 | export interface R3DeclareInjectableMetadata extends R3PartialDeclaration {
|
338 | /**
|
339 | * If provided, specifies that the declared injectable belongs to a particular injector:
|
340 | * - `InjectorType` such as `NgModule`,
|
341 | * - `'root'` the root injector
|
342 | * - `'any'` all injectors.
|
343 | * If not provided, then it does not belong to any injector. Must be explicitly listed in the
|
344 | * providers of an injector.
|
345 | */
|
346 | providedIn?: o.Expression;
|
347 | /**
|
348 | * If provided, an expression that evaluates to a class to use when creating an instance of this
|
349 | * injectable.
|
350 | */
|
351 | useClass?: o.Expression;
|
352 | /**
|
353 | * If provided, an expression that evaluates to a function to use when creating an instance of
|
354 | * this injectable.
|
355 | */
|
356 | useFactory?: o.Expression;
|
357 | /**
|
358 | * If provided, an expression that evaluates to a token of another injectable that this injectable
|
359 | * aliases.
|
360 | */
|
361 | useExisting?: o.Expression;
|
362 | /**
|
363 | * If provided, an expression that evaluates to the value of the instance of this injectable.
|
364 | */
|
365 | useValue?: o.Expression;
|
366 | /**
|
367 | * An array of dependencies to support instantiating this injectable via `useClass` or
|
368 | * `useFactory`.
|
369 | */
|
370 | deps?: R3DeclareDependencyMetadata[];
|
371 | }
|
372 | /**
|
373 | * Metadata indicating how a dependency should be injected into a factory.
|
374 | */
|
375 | export interface R3DeclareDependencyMetadata {
|
376 | /**
|
377 | * An expression representing the token or value to be injected, or `null` if the dependency is
|
378 | * not valid.
|
379 | *
|
380 | * If this dependency is due to the `@Attribute()` decorator, then this is an expression
|
381 | * evaluating to the name of the attribute.
|
382 | */
|
383 | token: o.Expression | null;
|
384 | /**
|
385 | * Whether the dependency is injecting an attribute value.
|
386 | * Default: false.
|
387 | */
|
388 | attribute?: boolean;
|
389 | /**
|
390 | * Whether the dependency has an @Host qualifier.
|
391 | * Default: false,
|
392 | */
|
393 | host?: boolean;
|
394 | /**
|
395 | * Whether the dependency has an @Optional qualifier.
|
396 | * Default: false,
|
397 | */
|
398 | optional?: boolean;
|
399 | /**
|
400 | * Whether the dependency has an @Self qualifier.
|
401 | * Default: false,
|
402 | */
|
403 | self?: boolean;
|
404 | /**
|
405 | * Whether the dependency has an @SkipSelf qualifier.
|
406 | * Default: false,
|
407 | */
|
408 | skipSelf?: boolean;
|
409 | }
|
410 | /**
|
411 | * Describes the shape of the object that the `ɵɵngDeclareClassMetadata()` function accepts.
|
412 | *
|
413 | * This interface serves primarily as documentation, as conformance to this interface is not
|
414 | * enforced during linking.
|
415 | */
|
416 | export interface R3DeclareClassMetadata extends R3PartialDeclaration {
|
417 | /**
|
418 | * The Angular decorators of the class.
|
419 | */
|
420 | decorators: o.Expression;
|
421 | /**
|
422 | * Optionally specifies the constructor parameters, their types and the Angular decorators of each
|
423 | * parameter. This property is omitted if the class does not have a constructor.
|
424 | */
|
425 | ctorParameters?: o.Expression;
|
426 | /**
|
427 | * Optionally specifies the Angular decorators applied to the class properties. This property is
|
428 | * omitted if no properties have any decorators.
|
429 | */
|
430 | propDecorators?: o.Expression;
|
431 | }
|
432 |
|
\ | No newline at end of file |