1 | /// <amd-module name="@angular/compiler-cli/ngcc/src/rendering/esm5_rendering_formatter" />
|
---|
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 { Statement } from '@angular/compiler';
|
---|
10 | import MagicString from 'magic-string';
|
---|
11 | import * as ts from 'typescript';
|
---|
12 | import { ImportManager } from '../../../src/ngtsc/translator';
|
---|
13 | import { CompiledClass } from '../analysis/types';
|
---|
14 | import { EsmRenderingFormatter } from './esm_rendering_formatter';
|
---|
15 | /**
|
---|
16 | * A RenderingFormatter that works with files that use ECMAScript Module `import` and `export`
|
---|
17 | * statements, but instead of `class` declarations it uses ES5 `function` wrappers for classes.
|
---|
18 | */
|
---|
19 | export declare class Esm5RenderingFormatter extends EsmRenderingFormatter {
|
---|
20 | /**
|
---|
21 | * Add the definitions, directly before the return statement, inside the IIFE of each decorated
|
---|
22 | * class.
|
---|
23 | */
|
---|
24 | addDefinitions(output: MagicString, compiledClass: CompiledClass, definitions: string): void;
|
---|
25 | /**
|
---|
26 | * Convert a `Statement` to JavaScript code in a format suitable for rendering by this formatter.
|
---|
27 | *
|
---|
28 | * @param stmt The `Statement` to print.
|
---|
29 | * @param sourceFile A `ts.SourceFile` that provides context for the statement. See
|
---|
30 | * `ts.Printer#printNode()` for more info.
|
---|
31 | * @param importManager The `ImportManager` to use for managing imports.
|
---|
32 | *
|
---|
33 | * @return The JavaScript code corresponding to `stmt` (in the appropriate format).
|
---|
34 | */
|
---|
35 | printStatement(stmt: Statement, sourceFile: ts.SourceFile, importManager: ImportManager): string;
|
---|
36 | }
|
---|