source: trip-planner-front/node_modules/@angular/compiler-cli/ngcc/src/rendering/esm_rendering_formatter.d.ts@ e29cc2e

Last change on this file since e29cc2e was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 4.2 KB
Line 
1/// <amd-module name="@angular/compiler-cli/ngcc/src/rendering/esm_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 */
9import { Statement } from '@angular/compiler';
10import MagicString from 'magic-string';
11import * as ts from 'typescript';
12import { AbsoluteFsPath, PathManipulation } from '../../../src/ngtsc/file_system';
13import { Reexport } from '../../../src/ngtsc/imports';
14import { Import, ImportManager } from '../../../src/ngtsc/translator';
15import { ModuleWithProvidersInfo } from '../analysis/module_with_providers_analyzer';
16import { ExportInfo } from '../analysis/private_declarations_analyzer';
17import { CompiledClass } from '../analysis/types';
18import { NgccReflectionHost, SwitchableVariableDeclaration } from '../host/ngcc_host';
19import { RedundantDecoratorMap, RenderingFormatter } from './rendering_formatter';
20/**
21 * A RenderingFormatter that works with ECMAScript Module import and export statements.
22 */
23export declare class EsmRenderingFormatter implements RenderingFormatter {
24 protected fs: PathManipulation;
25 protected host: NgccReflectionHost;
26 protected isCore: boolean;
27 protected printer: ts.Printer;
28 constructor(fs: PathManipulation, host: NgccReflectionHost, isCore: boolean);
29 /**
30 * Add the imports at the top of the file, after any imports that are already there.
31 */
32 addImports(output: MagicString, imports: Import[], sf: ts.SourceFile): void;
33 /**
34 * Add the exports to the end of the file.
35 */
36 addExports(output: MagicString, entryPointBasePath: AbsoluteFsPath, exports: ExportInfo[], importManager: ImportManager, file: ts.SourceFile): void;
37 /**
38 * Add plain exports to the end of the file.
39 *
40 * Unlike `addExports`, direct exports go directly in a .js and .d.ts file and don't get added to
41 * an entrypoint.
42 */
43 addDirectExports(output: MagicString, exports: Reexport[], importManager: ImportManager, file: ts.SourceFile): void;
44 /**
45 * Add the constants directly after the imports.
46 */
47 addConstants(output: MagicString, constants: string, file: ts.SourceFile): void;
48 /**
49 * Add the definitions directly after their decorated class.
50 */
51 addDefinitions(output: MagicString, compiledClass: CompiledClass, definitions: string): void;
52 /**
53 * Add the adjacent statements after all static properties of the class.
54 */
55 addAdjacentStatements(output: MagicString, compiledClass: CompiledClass, statements: string): void;
56 /**
57 * Remove static decorator properties from classes.
58 */
59 removeDecorators(output: MagicString, decoratorsToRemove: RedundantDecoratorMap): void;
60 /**
61 * Rewrite the IVY switch markers to indicate we are in IVY mode.
62 */
63 rewriteSwitchableDeclarations(outputText: MagicString, sourceFile: ts.SourceFile, declarations: SwitchableVariableDeclaration[]): void;
64 /**
65 * Add the type parameters to the appropriate functions that return `ModuleWithProviders`
66 * structures.
67 *
68 * This function will only get called on typings files.
69 */
70 addModuleWithProvidersParams(outputText: MagicString, moduleWithProviders: ModuleWithProvidersInfo[], importManager: ImportManager): void;
71 /**
72 * Convert a `Statement` to JavaScript code in a format suitable for rendering by this formatter.
73 *
74 * @param stmt The `Statement` to print.
75 * @param sourceFile A `ts.SourceFile` that provides context for the statement. See
76 * `ts.Printer#printNode()` for more info.
77 * @param importManager The `ImportManager` to use for managing imports.
78 *
79 * @return The JavaScript code corresponding to `stmt` (in the appropriate format).
80 */
81 printStatement(stmt: Statement, sourceFile: ts.SourceFile, importManager: ImportManager): string;
82 protected findEndOfImports(sf: ts.SourceFile): number;
83 /**
84 * Check whether the given type is the core Angular `ModuleWithProviders` interface.
85 * @param typeName The type to check.
86 * @returns true if the type is the core Angular `ModuleWithProviders` interface.
87 */
88 private isCoreModuleWithProvidersType;
89}
Note: See TracBrowser for help on using the repository browser.