import * as ts from 'typescript'; import SysHost from './host'; /** * Compiler host used to wrap a {@link SysHost} for use by the typescript compiler * @private */ declare class CompilerHost implements ts.CompilerHost { protected h: SysHost; private currentDirectory?; constructor(h: SysHost); /** * Return an instance of ts.SourceFile representing the given file. * * Implementation of ts.CompilerHost.getSourceFile() * * @param filename The path and name of the file that should be loaded. * @param languageVersion The script target the file should be interpreted with. * @param onError A callback that will be invoked if an error occurs. * @returns An instance of ts.SourceFile representing the given file. * * @note * originally obtained from (Apache-2): * https://github.com/TypeStrong/typedoc/blob/90f7046607f47c44cd8747f9b9d47548cb35d55d/src/lib/converter/utils/compiler-host.ts#L31-L43 */ getSourceFile(filename: string, languageVersion: ts.ScriptTarget, onError?: (message: string) => void): ts.SourceFile | undefined; /** * Return the full path of the default library that should be used. * * Implementation of ts.CompilerHost.getDefaultLibFilename() * * @returns The full path of the default library. */ getDefaultLibFileName(options: ts.CompilerOptions): string; getDirectories(path: string): string[]; /** * Return the full path of the current directory. * * Implementation of ts.CompilerHost.getCurrentDirectory() * * @returns The full path of the current directory. */ getCurrentDirectory(): string; /** * Return whether file names are case sensitive on the current platform or not. * * Implementation of ts.CompilerHost.useCaseSensitiveFileNames() * * @returns TRUE if file names are case sensitive on the current platform, FALSE otherwise. */ useCaseSensitiveFileNames(): boolean; /** * Check whether the given file exists. * * Implementation of ts.CompilerHost.fileExists(fileName) * * @param fileName * @returns {boolean} */ fileExists(fileName: string): boolean; /** * Check whether the given directory exists. * * Implementation of ts.CompilerHost.directoryExists(directoryName) * * @param directoryName * @returns {boolean} */ directoryExists(directoryName: string): boolean; /** * Return the contents of the given file. * * Implementation of ts.CompilerHost.readFile(fileName) * * @param fileName * @returns {string} */ readFile(fileName: string): string | undefined; /** * Return the canonical file name of the given file. * * Implementation of ts.CompilerHost.getCanonicalFileName() * * @param fileName The file name whose canonical variant should be resolved. * @returns The canonical file name of the given file. */ getCanonicalFileName(fileName: string): string; /** * Return the new line char sequence of the current platform. * * Implementation of ts.CompilerHost.getNewLine() * * @returns The new line char sequence of the current platform. */ getNewLine(): string; /** * Write a compiled javascript file to disc. * * As code-to-json will not emit compiled javascript files this is a null operation. * * Implementation of ts.CompilerHost.writeFile() * * @param fileName The name of the file that should be written. * @param data The contents of the file. * @param writeByteOrderMark Whether the UTF-8 BOM should be written or not. * @param onError A callback that will be invoked if an error occurs. */ writeFile(_fileName: string, _data: string, _writeByteOrderMark: boolean, _onError?: (message: string) => void): void; } export default CompilerHost; //# sourceMappingURL=compiler-host.d.ts.map