[6a3a178] | 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 { ConstantPool } from '../../constant_pool';
|
---|
| 9 | import { Interpolation } from '../../expression_parser/ast';
|
---|
| 10 | import * as o from '../../output/output_ast';
|
---|
| 11 | import { ParseSourceSpan } from '../../parse_util';
|
---|
| 12 | import * as t from '../r3_ast';
|
---|
| 13 | import { R3QueryMetadata } from './api';
|
---|
| 14 | /** Name of the temporary to use during data binding */
|
---|
| 15 | export declare const TEMPORARY_NAME = "_t";
|
---|
| 16 | /** Name of the context parameter passed into a template function */
|
---|
| 17 | export declare const CONTEXT_NAME = "ctx";
|
---|
| 18 | /** Name of the RenderFlag passed into a template function */
|
---|
| 19 | export declare const RENDER_FLAGS = "rf";
|
---|
| 20 | /** The prefix reference variables */
|
---|
| 21 | export declare const REFERENCE_PREFIX = "_r";
|
---|
| 22 | /** The name of the implicit context reference */
|
---|
| 23 | export declare const IMPLICIT_REFERENCE = "$implicit";
|
---|
| 24 | /** Non bindable attribute name **/
|
---|
| 25 | export declare const NON_BINDABLE_ATTR = "ngNonBindable";
|
---|
| 26 | /** Name for the variable keeping track of the context returned by `ɵɵrestoreView`. */
|
---|
| 27 | export declare const RESTORED_VIEW_CONTEXT_NAME = "restoredCtx";
|
---|
| 28 | /**
|
---|
| 29 | * Creates an allocator for a temporary variable.
|
---|
| 30 | *
|
---|
| 31 | * A variable declaration is added to the statements the first time the allocator is invoked.
|
---|
| 32 | */
|
---|
| 33 | export declare function temporaryAllocator(statements: o.Statement[], name: string): () => o.ReadVarExpr;
|
---|
| 34 | export declare function unsupported(this: void | Function, feature: string): never;
|
---|
| 35 | export declare function invalid<T>(this: t.Visitor, arg: o.Expression | o.Statement | t.Node): never;
|
---|
| 36 | export declare function asLiteral(value: any): o.Expression;
|
---|
| 37 | export declare function conditionallyCreateMapObjectLiteral(keys: {
|
---|
| 38 | [key: string]: string | string[];
|
---|
| 39 | }, keepDeclared?: boolean): o.Expression | null;
|
---|
| 40 | /**
|
---|
| 41 | * Remove trailing null nodes as they are implied.
|
---|
| 42 | */
|
---|
| 43 | export declare function trimTrailingNulls(parameters: o.Expression[]): o.Expression[];
|
---|
| 44 | export declare function getQueryPredicate(query: R3QueryMetadata, constantPool: ConstantPool): o.Expression;
|
---|
| 45 | /**
|
---|
| 46 | * A representation for an object literal used during codegen of definition objects. The generic
|
---|
| 47 | * type `T` allows to reference a documented type of the generated structure, such that the
|
---|
| 48 | * property names that are set can be resolved to their documented declaration.
|
---|
| 49 | */
|
---|
| 50 | export declare class DefinitionMap<T = any> {
|
---|
| 51 | values: {
|
---|
| 52 | key: string;
|
---|
| 53 | quoted: boolean;
|
---|
| 54 | value: o.Expression;
|
---|
| 55 | }[];
|
---|
| 56 | set(key: keyof T, value: o.Expression | null): void;
|
---|
| 57 | toLiteralMap(): o.LiteralMapExpr;
|
---|
| 58 | }
|
---|
| 59 | /**
|
---|
| 60 | * Extract a map of properties to values for a given element or template node, which can be used
|
---|
| 61 | * by the directive matching machinery.
|
---|
| 62 | *
|
---|
| 63 | * @param elOrTpl the element or template in question
|
---|
| 64 | * @return an object set up for directive matching. For attributes on the element/template, this
|
---|
| 65 | * object maps a property name to its (static) value. For any bindings, this map simply maps the
|
---|
| 66 | * property name to an empty string.
|
---|
| 67 | */
|
---|
| 68 | export declare function getAttrsForDirectiveMatching(elOrTpl: t.Element | t.Template): {
|
---|
| 69 | [name: string]: string;
|
---|
| 70 | };
|
---|
| 71 | /** Returns a call expression to a chained instruction, e.g. `property(params[0])(params[1])`. */
|
---|
| 72 | export declare function chainedInstruction(reference: o.ExternalReference, calls: o.Expression[][], span?: ParseSourceSpan | null): o.Expression;
|
---|
| 73 | /**
|
---|
| 74 | * Gets the number of arguments expected to be passed to a generated instruction in the case of
|
---|
| 75 | * interpolation instructions.
|
---|
| 76 | * @param interpolation An interpolation ast
|
---|
| 77 | */
|
---|
| 78 | export declare function getInterpolationArgsLength(interpolation: Interpolation): number;
|
---|