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 * as o from '../../output/output_ast';
|
---|
9 | import { R3DependencyMetadata } from '../r3_factory';
|
---|
10 | /**
|
---|
11 | * Creates an array literal expression from the given array, mapping all values to an expression
|
---|
12 | * using the provided mapping function. If the array is empty or null, then null is returned.
|
---|
13 | *
|
---|
14 | * @param values The array to transfer into literal array expression.
|
---|
15 | * @param mapper The logic to use for creating an expression for the array's values.
|
---|
16 | * @returns An array literal expression representing `values`, or null if `values` is empty or
|
---|
17 | * is itself null.
|
---|
18 | */
|
---|
19 | export declare function toOptionalLiteralArray<T>(values: T[] | null, mapper: (value: T) => o.Expression): o.LiteralArrayExpr | null;
|
---|
20 | /**
|
---|
21 | * Creates an object literal expression from the given object, mapping all values to an expression
|
---|
22 | * using the provided mapping function. If the object has no keys, then null is returned.
|
---|
23 | *
|
---|
24 | * @param object The object to transfer into an object literal expression.
|
---|
25 | * @param mapper The logic to use for creating an expression for the object's values.
|
---|
26 | * @returns An object literal expression representing `object`, or null if `object` does not have
|
---|
27 | * any keys.
|
---|
28 | */
|
---|
29 | export declare function toOptionalLiteralMap<T>(object: {
|
---|
30 | [key: string]: T;
|
---|
31 | }, mapper: (value: T) => o.Expression): o.LiteralMapExpr | null;
|
---|
32 | export declare function compileDependencies(deps: R3DependencyMetadata[] | 'invalid' | null): o.LiteralExpr | o.LiteralArrayExpr;
|
---|
33 | export declare function compileDependency(dep: R3DependencyMetadata): o.LiteralMapExpr;
|
---|
34 | /**
|
---|
35 | * Generate an expression that has the given `expr` wrapped in the following form:
|
---|
36 | *
|
---|
37 | * ```
|
---|
38 | * forwardRef(() => expr)
|
---|
39 | * ```
|
---|
40 | */
|
---|
41 | export declare function generateForwardRef(expr: o.Expression): o.Expression;
|
---|