[6a3a178] | 1 | /// <amd-module name="@angular/compiler-cli/linker/src/file_linker/emit_scopes/iife_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 * as o from '@angular/compiler/src/output/output_ast';
|
---|
| 10 | import { AstFactory } from '../../../../src/ngtsc/translator';
|
---|
| 11 | import { Translator } from '../translator';
|
---|
| 12 | import { EmitScope } from './emit_scope';
|
---|
| 13 | /**
|
---|
| 14 | * This class is a specialization of the `EmitScope` class that is designed for the situation where
|
---|
| 15 | * there is no clear shared scope for constant statements. In this case they are bundled with the
|
---|
| 16 | * translated definition inside an IIFE.
|
---|
| 17 | */
|
---|
| 18 | export declare class IifeEmitScope<TStatement, TExpression> extends EmitScope<TStatement, TExpression> {
|
---|
| 19 | private readonly factory;
|
---|
| 20 | constructor(ngImport: TExpression, translator: Translator<TStatement, TExpression>, factory: AstFactory<TStatement, TExpression>);
|
---|
| 21 | /**
|
---|
| 22 | * Translate the given Output AST definition expression into a generic `TExpression`.
|
---|
| 23 | *
|
---|
| 24 | * Wraps the output from `EmitScope.translateDefinition()` and `EmitScope.getConstantStatements()`
|
---|
| 25 | * in an IIFE.
|
---|
| 26 | */
|
---|
| 27 | translateDefinition(definition: o.Expression): TExpression;
|
---|
| 28 | /**
|
---|
| 29 | * It is not valid to call this method, since there will be no shared constant statements - they
|
---|
| 30 | * are already emitted in the IIFE alongside the translated definition.
|
---|
| 31 | */
|
---|
| 32 | getConstantStatements(): TStatement[];
|
---|
| 33 | }
|
---|