-
Notifications
You must be signed in to change notification settings - Fork 130
/
compiler.d.ts
47 lines (47 loc) · 1.45 KB
/
compiler.d.ts
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
41
42
43
44
45
46
47
import * as ts from 'typescript';
import { RawSourceMap } from './types';
import { File } from './input';
import { Host } from './host';
import { Project } from './project';
export interface ICompiler {
prepare(_project: Project): void;
inputFile(file: File): any;
inputDone(): any;
/**
* Corrects the paths in the sourcemap.
* Returns true when the file is located
* under the base path.
*/
correctSourceMap(map: RawSourceMap): boolean;
}
/**
* Compiles a whole project, with full type checking
*/
export declare class ProjectCompiler implements ICompiler {
host: Host;
project: Project;
program: ts.Program;
prepare(_project: Project): void;
inputFile(file: File): void;
inputDone(): void;
private _commonBaseDiff;
/**
* Calculates the difference between the common base directory calculated based on the base paths of the input files
* and the common source directory calculated by TypeScript.
*/
private readonly commonBaseDiff;
correctSourceMap(map: RawSourceMap): boolean;
private removeSourceMapComment(content);
}
export declare class FileCompiler implements ICompiler {
host: Host;
project: Project;
program: ts.Program;
private errorsPerFile;
private previousErrorsPerFile;
private compilationResult;
prepare(_project: Project): void;
inputFile(file: File): void;
inputDone(): void;
correctSourceMap(map: RawSourceMap): boolean;
}