source: trip-planner-front/node_modules/@angular/compiler/src/render3/r3_factory.d.ts

Last change on this file was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 3.5 KB
Line 
1import * as o from '../output/output_ast';
2import { R3CompiledExpression, R3Reference } from './util';
3/**
4 * Metadata required by the factory generator to generate a `factory` function for a type.
5 */
6export interface R3ConstructorFactoryMetadata {
7 /**
8 * String name of the type being generated (used to name the factory function).
9 */
10 name: string;
11 /**
12 * An expression representing the interface type being constructed.
13 */
14 type: R3Reference;
15 /**
16 * An expression representing the constructor type, intended for use within a class definition
17 * itself.
18 *
19 * This can differ from the outer `type` if the class is being compiled by ngcc and is inside
20 * an IIFE structure that uses a different name internally.
21 */
22 internalType: o.Expression;
23 /** Number of arguments for the `type`. */
24 typeArgumentCount: number;
25 /**
26 * Regardless of whether `fnOrClass` is a constructor function or a user-defined factory, it
27 * may have 0 or more parameters, which will be injected according to the `R3DependencyMetadata`
28 * for those parameters. If this is `null`, then the type's constructor is nonexistent and will
29 * be inherited from `fnOrClass` which is interpreted as the current type. If this is `'invalid'`,
30 * then one or more of the parameters wasn't resolvable and any attempt to use these deps will
31 * result in a runtime error.
32 */
33 deps: R3DependencyMetadata[] | 'invalid' | null;
34 /**
35 * Type of the target being created by the factory.
36 */
37 target: FactoryTarget;
38}
39export declare enum R3FactoryDelegateType {
40 Class = 0,
41 Function = 1
42}
43export interface R3DelegatedFnOrClassMetadata extends R3ConstructorFactoryMetadata {
44 delegate: o.Expression;
45 delegateType: R3FactoryDelegateType;
46 delegateDeps: R3DependencyMetadata[];
47}
48export interface R3ExpressionFactoryMetadata extends R3ConstructorFactoryMetadata {
49 expression: o.Expression;
50}
51export declare type R3FactoryMetadata = R3ConstructorFactoryMetadata | R3DelegatedFnOrClassMetadata | R3ExpressionFactoryMetadata;
52export declare enum FactoryTarget {
53 Directive = 0,
54 Component = 1,
55 Injectable = 2,
56 Pipe = 3,
57 NgModule = 4
58}
59export interface R3DependencyMetadata {
60 /**
61 * An expression representing the token or value to be injected.
62 * Or `null` if the dependency could not be resolved - making it invalid.
63 */
64 token: o.Expression | null;
65 /**
66 * If an @Attribute decorator is present, this is the literal type of the attribute name, or
67 * the unknown type if no literal type is available (e.g. the attribute name is an expression).
68 * Otherwise it is null;
69 */
70 attributeNameType: o.Expression | null;
71 /**
72 * Whether the dependency has an @Host qualifier.
73 */
74 host: boolean;
75 /**
76 * Whether the dependency has an @Optional qualifier.
77 */
78 optional: boolean;
79 /**
80 * Whether the dependency has an @Self qualifier.
81 */
82 self: boolean;
83 /**
84 * Whether the dependency has an @SkipSelf qualifier.
85 */
86 skipSelf: boolean;
87}
88/**
89 * Construct a factory function expression for the given `R3FactoryMetadata`.
90 */
91export declare function compileFactoryFunction(meta: R3FactoryMetadata): R3CompiledExpression;
92export declare function createFactoryType(meta: R3FactoryMetadata): o.ExpressionType;
93export declare function isDelegatedFactoryMetadata(meta: R3FactoryMetadata): meta is R3DelegatedFnOrClassMetadata;
94export declare function isExpressionFactoryMetadata(meta: R3FactoryMetadata): meta is R3ExpressionFactoryMetadata;
Note: See TracBrowser for help on using the repository browser.