1 | /**
|
---|
2 | * @license
|
---|
3 | * Copyright Google LLC All Rights Reserved.
|
---|
4 | *
|
---|
5 | * Use of this source code is governed by an MIT-style license that can be
|
---|
6 | * found in the LICENSE file at https://angular.io/license
|
---|
7 | */
|
---|
8 | /// <amd-module name="@angular/compiler-cli/src/perform_compile" />
|
---|
9 | import { Position } from '@angular/compiler';
|
---|
10 | import * as ts from 'typescript';
|
---|
11 | import { AbsoluteFsPath, ReadonlyFileSystem } from '../src/ngtsc/file_system';
|
---|
12 | import * as api from './transformers/api';
|
---|
13 | export declare type Diagnostics = ReadonlyArray<ts.Diagnostic | api.Diagnostic>;
|
---|
14 | export declare function filterErrorsAndWarnings(diagnostics: Diagnostics): Diagnostics;
|
---|
15 | export declare function formatDiagnosticPosition(position: Position, host?: ts.FormatDiagnosticsHost): string;
|
---|
16 | export declare function flattenDiagnosticMessageChain(chain: api.DiagnosticMessageChain, host?: ts.FormatDiagnosticsHost, indent?: number): string;
|
---|
17 | export declare function formatDiagnostic(diagnostic: api.Diagnostic, host?: ts.FormatDiagnosticsHost): string;
|
---|
18 | export declare function formatDiagnostics(diags: Diagnostics, host?: ts.FormatDiagnosticsHost): string;
|
---|
19 | /** Used to read configuration files. */
|
---|
20 | export declare type ConfigurationHost = Pick<ReadonlyFileSystem, 'readFile' | 'exists' | 'lstat' | 'resolve' | 'join' | 'dirname' | 'extname' | 'pwd'>;
|
---|
21 | export interface ParsedConfiguration {
|
---|
22 | project: string;
|
---|
23 | options: api.CompilerOptions;
|
---|
24 | rootNames: string[];
|
---|
25 | projectReferences?: readonly ts.ProjectReference[] | undefined;
|
---|
26 | emitFlags: api.EmitFlags;
|
---|
27 | errors: ts.Diagnostic[];
|
---|
28 | }
|
---|
29 | export declare function calcProjectFileAndBasePath(project: string, host?: ConfigurationHost): {
|
---|
30 | projectFile: AbsoluteFsPath;
|
---|
31 | basePath: AbsoluteFsPath;
|
---|
32 | };
|
---|
33 | export declare function readConfiguration(project: string, existingOptions?: api.CompilerOptions, host?: ConfigurationHost): ParsedConfiguration;
|
---|
34 | export interface PerformCompilationResult {
|
---|
35 | diagnostics: Diagnostics;
|
---|
36 | program?: api.Program;
|
---|
37 | emitResult?: ts.EmitResult;
|
---|
38 | }
|
---|
39 | export declare function exitCodeFromResult(diags: Diagnostics | undefined): number;
|
---|
40 | export declare function performCompilation({ rootNames, options, host, oldProgram, emitCallback, mergeEmitResultsCallback, gatherDiagnostics, customTransformers, emitFlags, modifiedResourceFiles }: {
|
---|
41 | rootNames: string[];
|
---|
42 | options: api.CompilerOptions;
|
---|
43 | host?: api.CompilerHost;
|
---|
44 | oldProgram?: api.Program;
|
---|
45 | emitCallback?: api.TsEmitCallback;
|
---|
46 | mergeEmitResultsCallback?: api.TsMergeEmitResultsCallback;
|
---|
47 | gatherDiagnostics?: (program: api.Program) => Diagnostics;
|
---|
48 | customTransformers?: api.CustomTransformers;
|
---|
49 | emitFlags?: api.EmitFlags;
|
---|
50 | modifiedResourceFiles?: Set<string> | null;
|
---|
51 | }): PerformCompilationResult;
|
---|
52 | export declare function defaultGatherDiagnostics(program: api.Program): Diagnostics;
|
---|