/// import * as ts from 'typescript'; import { ChainableHost } from './hosts-base'; import { RawSourceMap } from 'source-map'; import { Visitor } from './visitor'; export declare class AstCacheHost extends ChainableHost { private cache; getSourceFile(fileName: string, languageVersion: ts.ScriptTarget, onError?: (message: string) => void): ts.SourceFile; } export declare class TransformationHost extends ChainableHost { private transformations; private transformer; constructor(visitors: Visitor[], languageServiceProvider?: () => ts.LanguageService); getSourceFile(fileName: string, languageVersion: ts.ScriptTarget, onError?: (message: string) => void): ts.SourceFile; getSourceMap(fileName: string): RawSourceMap; translateDiagnostic(diagnostic: ts.Diagnostic): ts.Diagnostic; } export declare class SemanticHost extends ChainableHost implements ts.LanguageServiceHost, ts.CompilerHost { private files; private compilerOptions; private libDir; constructor(files: string[], compilerOptions?: ts.CompilerOptions, libDir?: string); getProjectVersion(): string; getScriptFileNames(): string[]; getScriptVersion(fileName: string): string; getScriptSnapshot(fileName: string): ts.IScriptSnapshot; getLocalizedDiagnosticMessages(): any; getCompilationSettings(): ts.CompilerOptions; log(s: string): void; trace(s: string): void; error(s: string): void; resolveModuleNames(moduleNames: string[], containingFile: string): ts.ResolvedModule[]; directoryExists(directoryName: string): boolean; acquireDocument(fileName: string, compilationSettings: ts.CompilerOptions, scriptSnapshot: ts.IScriptSnapshot, version: string): ts.SourceFile; /** * Request an updated version of an already existing SourceFile with a given fileName * and compilationSettings. The update will in-turn call updateLanguageServiceSourceFile * to get an updated SourceFile. * * @param fileName The name of the file requested * @param compilationSettings Some compilation settings like target affects the * shape of a the resulting SourceFile. This allows the DocumentRegistry to store * multiple copies of the same file for different compilation settings. * @param scriptSnapshot Text of the file. * @param version Current version of the file. */ updateDocument(fileName: string, compilationSettings: ts.CompilerOptions, scriptSnapshot: ts.IScriptSnapshot, version: string): ts.SourceFile; /** * Informs the DocumentRegistry that a file is not needed any longer. * * Note: It is not allowed to call release on a SourceFile that was not acquired from * this registry originally. * * @param fileName The name of the file to be released * @param compilationSettings The compilation settings used to acquire the file */ releaseDocument(fileName: string, compilationSettings: ts.CompilerOptions): void; reportStats(): string; }