WatchCompilerHostOfFilesAndCompilerOptions

Host to create watch with root files and options

Properties

Link copied to clipboard
abstract val afterProgramCreate: (program: T) -> Unit?

If provided, callback to invoke after every new program creation

Link copied to clipboard
abstract val clearTimeout: (timeoutId: Any?) -> Unit?

If provided, will be used to reset existing delayed compilation

Link copied to clipboard
abstract val createHash: (data: String) -> String?
Link copied to clipboard

Used to create the program when need for program creation or recreation detected

Link copied to clipboard
abstract val directoryExists: (path: String) -> Boolean?

If provided, used for module resolution as well as to handle directory structure

Link copied to clipboard
abstract val getDefaultLibLocation: () -> String?
Link copied to clipboard
abstract val getDirectories: (path: String) -> ReadonlyArray<String>?

If provided, used in resolutions as well as handling directory structure

Link copied to clipboard
abstract val getEnvironmentVariable: (name: String) -> String??

If provided is used to get the environment variable

Link copied to clipboard

Returns the module resolution cache used by a provided resolveModuleNames implementation so that any non-name module resolution operations (eg, package.json lookup) can reuse it

Link copied to clipboard
abstract val getParsedCommandLine: (fileName: String) -> ParsedCommandLine??

If provided, use this method to get parsed command lines for referenced projects

Link copied to clipboard

If provided along with custom resolveModuleNames or resolveTypeReferenceDirectives, used to determine if unchanged file path needs to re-resolve modules/type reference directives

Link copied to clipboard
Link copied to clipboard
abstract val onWatchStatusChange: (diagnostic: Diagnostic, newLine: String, options: CompilerOptions, errorCount: Double?) -> Unit?

If provided, called with Diagnostic message that informs about change in watch status

Link copied to clipboard
abstract var options: CompilerOptions

Compiler options

Link copied to clipboard

Project References

Link copied to clipboard

If provided, used to cache and handle directory structure modifications

Link copied to clipboard
abstract val realpath: (path: String) -> String?

Symbol links resolution

Link copied to clipboard
abstract val resolveModuleNames: (ReadonlyArray<String>, containingFile: String, ReadonlyArray<String>?, redirectedReference: ResolvedProjectReference?, options: CompilerOptions, containingSourceFile: SourceFile?) -> ReadonlyArray<ResolvedModule?>?
Link copied to clipboard
abstract val resolveTypeReferenceDirectives: (typeReferenceDirectiveNames: Any, containingFile: String, redirectedReference: ResolvedProjectReference?, options: CompilerOptions, ResolutionMode) -> ReadonlyArray<ResolvedTypeReferenceDirective?>?
Link copied to clipboard

root files to use to generate program

Link copied to clipboard
abstract val setTimeout: Function<Any?>?

If provided, will be used to set delayed compilation, so that multiple changes in short span are compiled together

Link copied to clipboard
abstract val trace: (s: String) -> Unit?

If provided would be used to write log about compilation

Link copied to clipboard

Instead of using output d.ts file from project reference, use its source file

Link copied to clipboard
abstract var watchOptions: WatchOptions?

Functions

Link copied to clipboard
abstract fun fileExists(path: String): Boolean

Use to check file presence for source files and if resolveModuleNames is not provided (complier is in charge of module resolution) then module files as well

Link copied to clipboard
abstract fun getCurrentDirectory(): String
Link copied to clipboard
Link copied to clipboard
abstract fun getNewLine(): String
Link copied to clipboard
abstract fun readFile(path: String, encoding: String = definedExternally): String?

Use to read file text for source files and if resolveModuleNames is not provided (complier is in charge of module resolution) then module files as well

Link copied to clipboard
Link copied to clipboard
abstract fun watchDirectory(path: String, callback: DirectoryWatcherCallback, recursive: Boolean = definedExternally, options: WatchOptions = definedExternally): FileWatcher

Used to watch resolved module's failed lookup locations, config file specs, type roots where auto type reference directives are added

Link copied to clipboard
abstract fun watchFile(path: String, callback: FileWatcherCallback, pollingInterval: Double = definedExternally, options: WatchOptions = definedExternally): FileWatcher

Used to watch changes in source files, missing files needed to update the program or config file