1 | /// <amd-module name="@angular/compiler-cli/linker/src/file_linker/emit_scopes/emit_scope" />
|
---|
2 | /**
|
---|
3 | * @license
|
---|
4 | * Copyright Google LLC All Rights Reserved.
|
---|
5 | *
|
---|
6 | * Use of this source code is governed by an MIT-style license that can be
|
---|
7 | * found in the LICENSE file at https://angular.io/license
|
---|
8 | */
|
---|
9 | import { ConstantPool } from '@angular/compiler';
|
---|
10 | import * as o from '@angular/compiler/src/output/output_ast';
|
---|
11 | import { Translator } from '../translator';
|
---|
12 | /**
|
---|
13 | * This class represents (from the point of view of the `FileLinker`) the scope in which
|
---|
14 | * statements and expressions related to a linked partial declaration will be emitted.
|
---|
15 | *
|
---|
16 | * It holds a copy of a `ConstantPool` that is used to capture any constant statements that need to
|
---|
17 | * be emitted in this context.
|
---|
18 | *
|
---|
19 | * This implementation will emit the definition and the constant statements separately.
|
---|
20 | */
|
---|
21 | export declare class EmitScope<TStatement, TExpression> {
|
---|
22 | protected readonly ngImport: TExpression;
|
---|
23 | protected readonly translator: Translator<TStatement, TExpression>;
|
---|
24 | readonly constantPool: ConstantPool;
|
---|
25 | constructor(ngImport: TExpression, translator: Translator<TStatement, TExpression>);
|
---|
26 | /**
|
---|
27 | * Translate the given Output AST definition expression into a generic `TExpression`.
|
---|
28 | *
|
---|
29 | * Use a `LinkerImportGenerator` to handle any imports in the definition.
|
---|
30 | */
|
---|
31 | translateDefinition(definition: o.Expression): TExpression;
|
---|
32 | /**
|
---|
33 | * Return any constant statements that are shared between all uses of this `EmitScope`.
|
---|
34 | */
|
---|
35 | getConstantStatements(): TStatement[];
|
---|
36 | }
|
---|