source: trip-planner-front/node_modules/@angular/compiler-cli/ngcc/src/packages/transformer.d.ts@ 6a3a178

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

initial commit

  • Property mode set to 100644
File size: 3.3 KB
Line 
1/// <amd-module name="@angular/compiler-cli/ngcc/src/packages/transformer" />
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 * as ts from 'typescript';
10import { ParsedConfiguration } from '../../..';
11import { ReadonlyFileSystem } from '../../../src/ngtsc/file_system';
12import { Logger } from '../../../src/ngtsc/logging';
13import { ModuleWithProvidersAnalyses } from '../analysis/module_with_providers_analyzer';
14import { ExportInfo } from '../analysis/private_declarations_analyzer';
15import { SwitchMarkerAnalyses } from '../analysis/switch_marker_analyzer';
16import { CompiledFile } from '../analysis/types';
17import { NgccReflectionHost } from '../host/ngcc_host';
18import { RenderingFormatter } from '../rendering/rendering_formatter';
19import { FileToWrite } from '../rendering/utils';
20import { EntryPointBundle } from './entry_point_bundle';
21export declare type TransformResult = {
22 success: true;
23 diagnostics: ts.Diagnostic[];
24 transformedFiles: FileToWrite[];
25} | {
26 success: false;
27 diagnostics: ts.Diagnostic[];
28};
29/**
30 * A Package is stored in a directory on disk and that directory can contain one or more package
31 * formats - e.g. fesm2015, UMD, etc. Additionally, each package provides typings (`.d.ts` files).
32 *
33 * Each of these formats exposes one or more entry points, which are source files that need to be
34 * parsed to identify the decorated exported classes that need to be analyzed and compiled by one or
35 * more `DecoratorHandler` objects.
36 *
37 * Each entry point to a package is identified by a `package.json` which contains properties that
38 * indicate what formatted bundles are accessible via this end-point.
39 *
40 * Each bundle is identified by a root `SourceFile` that can be parsed and analyzed to
41 * identify classes that need to be transformed; and then finally rendered and written to disk.
42 *
43 * Along with the source files, the corresponding source maps (either inline or external) and
44 * `.d.ts` files are transformed accordingly.
45 *
46 * - Flat file packages have all the classes in a single file.
47 * - Other packages may re-export classes from other non-entry point files.
48 * - Some formats may contain multiple "modules" in a single file.
49 */
50export declare class Transformer {
51 private fs;
52 private logger;
53 private tsConfig;
54 constructor(fs: ReadonlyFileSystem, logger: Logger, tsConfig?: ParsedConfiguration | null);
55 /**
56 * Transform the source (and typings) files of a bundle.
57 * @param bundle the bundle to transform.
58 * @returns information about the files that were transformed.
59 */
60 transform(bundle: EntryPointBundle): TransformResult;
61 getHost(bundle: EntryPointBundle): NgccReflectionHost;
62 getRenderingFormatter(host: NgccReflectionHost, bundle: EntryPointBundle): RenderingFormatter;
63 analyzeProgram(reflectionHost: NgccReflectionHost, bundle: EntryPointBundle): ProgramAnalyses;
64}
65export declare function hasErrors(diagnostics: ts.Diagnostic[]): boolean;
66interface ProgramAnalyses {
67 decorationAnalyses: Map<ts.SourceFile, CompiledFile>;
68 switchMarkerAnalyses: SwitchMarkerAnalyses;
69 privateDeclarationsAnalyses: ExportInfo[];
70 moduleWithProvidersAnalyses: ModuleWithProvidersAnalyses | null;
71 diagnostics: ts.Diagnostic[];
72}
73export {};
Note: See TracBrowser for help on using the repository browser.