[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 * as o from './output/output_ast';
|
---|
| 9 | export declare const enum DefinitionKind {
|
---|
| 10 | Injector = 0,
|
---|
| 11 | Directive = 1,
|
---|
| 12 | Component = 2,
|
---|
| 13 | Pipe = 3
|
---|
| 14 | }
|
---|
| 15 | /**
|
---|
| 16 | * A constant pool allows a code emitter to share constant in an output context.
|
---|
| 17 | *
|
---|
| 18 | * The constant pool also supports sharing access to ivy definitions references.
|
---|
| 19 | */
|
---|
| 20 | export declare class ConstantPool {
|
---|
| 21 | private readonly isClosureCompilerEnabled;
|
---|
| 22 | statements: o.Statement[];
|
---|
| 23 | private literals;
|
---|
| 24 | private literalFactories;
|
---|
| 25 | private injectorDefinitions;
|
---|
| 26 | private directiveDefinitions;
|
---|
| 27 | private componentDefinitions;
|
---|
| 28 | private pipeDefinitions;
|
---|
| 29 | private nextNameIndex;
|
---|
| 30 | constructor(isClosureCompilerEnabled?: boolean);
|
---|
| 31 | getConstLiteral(literal: o.Expression, forceShared?: boolean): o.Expression;
|
---|
| 32 | getDefinition(type: any, kind: DefinitionKind, ctx: OutputContext, forceShared?: boolean): o.Expression;
|
---|
| 33 | getLiteralFactory(literal: o.LiteralArrayExpr | o.LiteralMapExpr): {
|
---|
| 34 | literalFactory: o.Expression;
|
---|
| 35 | literalFactoryArguments: o.Expression[];
|
---|
| 36 | };
|
---|
| 37 | private _getLiteralFactory;
|
---|
| 38 | /**
|
---|
| 39 | * Produce a unique name.
|
---|
| 40 | *
|
---|
| 41 | * The name might be unique among different prefixes if any of the prefixes end in
|
---|
| 42 | * a digit so the prefix should be a constant string (not based on user input) and
|
---|
| 43 | * must not end in a digit.
|
---|
| 44 | */
|
---|
| 45 | uniqueName(prefix: string): string;
|
---|
| 46 | private definitionsOf;
|
---|
| 47 | propertyNameOf(kind: DefinitionKind): string;
|
---|
| 48 | private freshName;
|
---|
| 49 | private keyOf;
|
---|
| 50 | }
|
---|
| 51 | export interface OutputContext {
|
---|
| 52 | genFilePath: string;
|
---|
| 53 | statements: o.Statement[];
|
---|
| 54 | constantPool: ConstantPool;
|
---|
| 55 | importExpr(reference: any, typeParams?: o.Type[] | null, useSummaries?: boolean): o.Expression;
|
---|
| 56 | }
|
---|