tsc.d.ts
1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import * as ts from 'typescript';
import AngularCompilerOptions from './options';
import { VinylFile } from './vinyl_file';
/**
* Our interface to the TypeScript standard compiler.
* If you write an Angular compiler plugin for another build tool,
* you should implement a similar interface.
*/
export interface CompilerInterface {
readConfiguration(project: string | VinylFile, basePath: string, existingOptions?: ts.CompilerOptions): {
parsed: ts.ParsedCommandLine;
ngOptions: AngularCompilerOptions;
};
typeCheck(compilerHost: ts.CompilerHost, program: ts.Program): void;
emit(program: ts.Program): number;
}
export declare class UserError extends Error {
private _nativeError;
constructor(message: string);
message: string;
name: string;
stack: any;
toString(): string;
}
export declare function formatDiagnostics(diags: ts.Diagnostic[]): string;
export declare function check(diags: ts.Diagnostic[]): void;
export declare function validateAngularCompilerOptions(options: AngularCompilerOptions): ts.Diagnostic[];
export declare class Tsc implements CompilerInterface {
private readFile;
private readDirectory;
private parseConfigHost;
constructor(readFile?: (path: string, encoding?: string) => string, readDirectory?: (path: string, extensions?: string[], exclude?: string[], include?: string[]) => string[]);
readConfiguration(project: string | VinylFile, basePath: string, existingOptions?: ts.CompilerOptions): {
parsed: ts.ParsedCommandLine;
ngOptions: any;
};
typeCheck(compilerHost: ts.CompilerHost, program: ts.Program): void;
emit(program: ts.Program): number;
}
export declare const tsc: CompilerInterface;