1 | /// <amd-module name="@angular/compiler-cli/ngcc/src/rendering/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 { Reexport } from '../../../src/ngtsc/imports';
|
---|
13 | import { Import, ImportManager } from '../../../src/ngtsc/translator';
|
---|
14 | import { ModuleWithProvidersInfo } from '../analysis/module_with_providers_analyzer';
|
---|
15 | import { ExportInfo } from '../analysis/private_declarations_analyzer';
|
---|
16 | import { CompiledClass } from '../analysis/types';
|
---|
17 | import { SwitchableVariableDeclaration } from '../host/ngcc_host';
|
---|
18 | /**
|
---|
19 | * The collected decorators that have become redundant after the compilation
|
---|
20 | * of Ivy static fields. The map is keyed by the container node, such that we
|
---|
21 | * can tell if we should remove the entire decorator property
|
---|
22 | */
|
---|
23 | export declare type RedundantDecoratorMap = Map<ts.Node, ts.Node[]>;
|
---|
24 | export declare const RedundantDecoratorMap: MapConstructor;
|
---|
25 | /**
|
---|
26 | * Implement this interface with methods that know how to render a specific format,
|
---|
27 | * such as ESM5 or UMD.
|
---|
28 | */
|
---|
29 | export interface RenderingFormatter {
|
---|
30 | addConstants(output: MagicString, constants: string, file: ts.SourceFile): void;
|
---|
31 | addImports(output: MagicString, imports: Import[], sf: ts.SourceFile): void;
|
---|
32 | addExports(output: MagicString, entryPointBasePath: string, exports: ExportInfo[], importManager: ImportManager, file: ts.SourceFile): void;
|
---|
33 | addDirectExports(output: MagicString, exports: Reexport[], importManager: ImportManager, file: ts.SourceFile): void;
|
---|
34 | addDefinitions(output: MagicString, compiledClass: CompiledClass, definitions: string): void;
|
---|
35 | addAdjacentStatements(output: MagicString, compiledClass: CompiledClass, statements: string): void;
|
---|
36 | removeDecorators(output: MagicString, decoratorsToRemove: RedundantDecoratorMap): void;
|
---|
37 | rewriteSwitchableDeclarations(outputText: MagicString, sourceFile: ts.SourceFile, declarations: SwitchableVariableDeclaration[]): void;
|
---|
38 | addModuleWithProvidersParams(outputText: MagicString, moduleWithProviders: ModuleWithProvidersInfo[], importManager: ImportManager): void;
|
---|
39 | printStatement(stmt: Statement, sourceFile: ts.SourceFile, importManager: ImportManager): string;
|
---|
40 | }
|
---|