UNPKG

2.11 kBTypeScriptView Raw
1import * as ts from 'typescript';
2import NgOptions from './options';
3export declare function formatDiagnostics(d: ts.Diagnostic[]): string;
4/**
5 * Implementation of CompilerHost that forwards all methods to another instance.
6 * Useful for partial implementations to override only methods they care about.
7 */
8export declare abstract class DelegatingHost implements ts.CompilerHost {
9 protected delegate: ts.CompilerHost;
10 constructor(delegate: ts.CompilerHost);
11 getSourceFile: (fileName: string, languageVersion: ts.ScriptTarget, onError?: (message: string) => void) => ts.SourceFile;
12 getCancellationToken: () => ts.CancellationToken;
13 getDefaultLibFileName: (options: ts.CompilerOptions) => string;
14 getDefaultLibLocation: () => string;
15 writeFile: ts.WriteFileCallback;
16 getCurrentDirectory: () => string;
17 getDirectories: (path: string) => string[];
18 getCanonicalFileName: (fileName: string) => string;
19 useCaseSensitiveFileNames: () => boolean;
20 getNewLine: () => string;
21 fileExists: (fileName: string) => boolean;
22 readFile: (fileName: string) => string;
23 trace: (s: string) => void;
24 directoryExists: (directoryName: string) => boolean;
25}
26export declare class MetadataWriterHost extends DelegatingHost {
27 private ngOptions;
28 private emitAllFiles;
29 private metadataCollector;
30 private metadataCollector1;
31 constructor(delegate: ts.CompilerHost, ngOptions: NgOptions, emitAllFiles: boolean);
32 private writeMetadata(emitFilePath, sourceFile);
33 writeFile: ts.WriteFileCallback;
34}
35export declare class SyntheticIndexHost extends DelegatingHost {
36 private normalSyntheticIndexName;
37 private indexContent;
38 private indexMetadata;
39 constructor(delegate: ts.CompilerHost, syntheticIndex: {
40 name: string;
41 content: string;
42 metadata: string;
43 });
44 fileExists: (fileName: string) => boolean;
45 readFile: (fileName: string) => string;
46 getSourceFile: (fileName: string, languageVersion: ts.ScriptTarget, onError?: (message: string) => void) => ts.SourceFile;
47 writeFile: ts.WriteFileCallback;
48}