UNPKG

3.03 kBTypeScriptView Raw
1import * as ts from 'typescript';
2import { ResolveModuleName, ResolveTypeReferenceDirective } from './resolution';
3export declare class CompilerHost implements ts.WatchCompilerHostOfConfigFile<ts.EmitAndSemanticDiagnosticsBuilderProgram> {
4 private typescript;
5 private program?;
6 getProgram(): ts.Program;
7 getAllKnownFiles(): Set<string>;
8 configFileName: string;
9 optionsToExtend: ts.CompilerOptions;
10 private directoryWatchers;
11 private fileWatchers;
12 private knownFiles;
13 private gatheredDiagnostic;
14 private afterCompile;
15 private readonly tsHost;
16 protected lastProcessing?: Promise<ts.Diagnostic[]>;
17 private compilationStarted;
18 resolveModuleNames: ((moduleNames: string[], containingFile: string, reusedNames?: string[] | undefined, redirectedReference?: ts.ResolvedProjectReference | undefined) => (ts.ResolvedModule | undefined)[]) | undefined;
19 resolveTypeReferenceDirectives: ((typeReferenceDirectiveNames: string[], containingFile: string, redirectedReference?: ts.ResolvedProjectReference | undefined) => (ts.ResolvedTypeReferenceDirective | undefined)[]) | undefined;
20 constructor(typescript: typeof ts, programConfigFile: string, compilerOptions: ts.CompilerOptions, checkSyntacticErrors: boolean, userResolveModuleName?: ResolveModuleName, userResolveTypeReferenceDirective?: ResolveTypeReferenceDirective);
21 processChanges(): Promise<{
22 results: ts.Diagnostic[];
23 updatedFiles: string[];
24 removedFiles: string[];
25 }>;
26 setTimeout(callback: (...args: any[]) => void, _ms: number, ...args: any[]): any;
27 clearTimeout(timeoutId: any): void;
28 onWatchStatusChange(_diagnostic: ts.Diagnostic, _newLine: string, _options: ts.CompilerOptions): void;
29 watchDirectory(path: string, callback: ts.DirectoryWatcherCallback, recursive?: boolean): ts.FileWatcher;
30 watchFile(path: string, callback: ts.FileWatcherCallback, _pollingInterval?: number): ts.FileWatcher;
31 fileExists(path: string): boolean;
32 readFile(path: string, encoding?: string): string | undefined;
33 directoryExists(path: string): boolean;
34 getDirectories(path: string): string[];
35 readDirectory(path: string, extensions?: ReadonlyArray<string>, exclude?: ReadonlyArray<string>, include?: ReadonlyArray<string>, depth?: number): string[];
36 createProgram: typeof ts.createEmitAndSemanticDiagnosticsBuilderProgram;
37 getCurrentDirectory(): string;
38 getDefaultLibFileName(options: ts.CompilerOptions): string;
39 getEnvironmentVariable(name: string): string | undefined;
40 getNewLine(): string;
41 realpath(path: string): string;
42 trace(s: string): void;
43 useCaseSensitiveFileNames(): boolean;
44 onUnRecoverableConfigFileDiagnostic(_diag: ts.Diagnostic): void;
45 afterProgramCreate(program: ts.EmitAndSemanticDiagnosticsBuilderProgram): void;
46 createDirectory(_path: string): void;
47 writeFile(_path: string, _data: string, _writeByteOrderMark?: boolean): void;
48 onCachedDirectoryStructureHostCreate?(_host: any): void;
49}
50
\No newline at end of file