WatchCompilerHostOfConfigFile

Host to create watch with config file

Properties

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

If provided, callback to invoke after every new program creation

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

If provided, will be used to reset existing delayed compilation

Link copied to clipboard
abstract external var configFileName: String

Name of the config file to compile

Link copied to clipboard
abstract external val createHash: (data: String) -> String?
Link copied to clipboard
abstract external var createProgram: CreateProgram<T>

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

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

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

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

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

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

If provided is used to get the environment variable

Link copied to clipboard
abstract external val getModuleResolutionCache: () -> ModuleResolutionCache??

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 external val getParsedCommandLine: (fileName: String) -> ParsedCommandLine??

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

Link copied to clipboard
abstract external val hasInvalidatedResolutions: (Path) -> Boolean?

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
abstract external var jsDocParsingMode: JSDocParsingMode?
Link copied to clipboard

Reports unrecoverable error when parsing config file

Link copied to clipboard
abstract external 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 external var optionsToExtend: CompilerOptions?

Options to extend

Link copied to clipboard
abstract external var preferNonRecursiveWatch: Boolean?
Link copied to clipboard

If provided, used to cache and handle directory structure modifications

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

Symbol links resolution

Link copied to clipboard
Link copied to clipboard
abstract external val resolveModuleNames: (ReadonlyArray<String>, containingFile: String, ReadonlyArray<String>?, redirectedReference: ResolvedProjectReference?, options: CompilerOptions, containingSourceFile: SourceFile?) -> ReadonlyArray<ResolvedModule?>?
Link copied to clipboard
abstract external val resolveTypeReferenceDirectives: (typeReferenceDirectiveNames: Any, containingFile: String, redirectedReference: ResolvedProjectReference?, options: CompilerOptions, ResolutionMode) -> ReadonlyArray<ResolvedTypeReferenceDirective?>?
Link copied to clipboard
abstract external 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 external val trace: (s: String) -> Unit?

If provided would be used to write log about compilation

Link copied to clipboard
abstract external val useSourceOfProjectReferenceRedirect: () -> Boolean?

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

Link copied to clipboard
abstract external var watchOptionsToExtend: WatchOptions?

Functions

Link copied to clipboard
abstract external 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 external fun getCurrentDirectory(): String
Link copied to clipboard
abstract external fun getDefaultLibFileName(options: CompilerOptions): String
Link copied to clipboard
abstract external fun getNewLine(): String
Link copied to clipboard
abstract external fun readDirectory(path: String, extensions: ReadonlyArray<String> = definedExternally, exclude: ReadonlyArray<String> = definedExternally, include: ReadonlyArray<String> = definedExternally, depth: Double = definedExternally): ReadonlyArray<String>

Used to generate source file names from the config file and its include, exclude, files rules and also to cache the directory stucture

Link copied to clipboard
abstract external 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
abstract external fun useCaseSensitiveFileNames(): Boolean
Link copied to clipboard
abstract external 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 external 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