[I] CompilerHost
Extends
Section titled âExtendsâSystemHost
Properties
Section titled âPropertiesâProperty | Type | Description |
---|---|---|
logSink | LogSink | - |
parseCache? | WeakMap <SourceFile , TypeSpecScriptNode > | Optional cache to reuse the results of parsing and binding across programs. |
Methods
Section titled âMethodsâfileURLToPath()
Section titled âfileURLToPath()âfileURLToPath(url): string;
Parameters
Section titled âParametersâParameter | Type |
---|---|
url | string |
Returns
Section titled âReturnsâstring
getExecutionRoot()
Section titled âgetExecutionRoot()âgetExecutionRoot(): string;
Returns
Section titled âReturnsâstring
getJsImport()
Section titled âgetJsImport()âgetJsImport(path): Promise<Record<string, any>>;
Parameters
Section titled âParametersâParameter | Type |
---|---|
path | string |
Returns
Section titled âReturnsâPromise
<Record
<string
, any
>>
getLibDirs()
Section titled âgetLibDirs()âgetLibDirs(): string[];
Returns
Section titled âReturnsâstring
[]
getSourceFileKind()
Section titled âgetSourceFileKind()âgetSourceFileKind(path): undefined | SourceFileKind;
Parameters
Section titled âParametersâParameter | Type |
---|---|
path | string |
Returns
Section titled âReturnsâundefined
| SourceFileKind
mkdirp()
Section titled âmkdirp()âmkdirp(path): Promise<undefined | string>;
create directory recursively.
Parameters
Section titled âParametersâParameter | Type | Description |
---|---|---|
path | string | Path to the directory. |
Returns
Section titled âReturnsâPromise
<undefined
| string
>
Inherited from
Section titled âInherited fromâSystemHost.mkdirp
pathToFileURL()
Section titled âpathToFileURL()âpathToFileURL(path): string;
Parameters
Section titled âParametersâParameter | Type |
---|---|
path | string |
Returns
Section titled âReturnsâstring
readDir()
Section titled âreadDir()âreadDir(path): Promise<string[]>;
Read directory.
Parameters
Section titled âParametersâParameter | Type | Description |
---|---|---|
path | string | Path to the directory. |
Returns
Section titled âReturnsâPromise
<string
[]>
list of file/directory in the given directory. Returns the name not the full path.
Inherited from
Section titled âInherited fromâSystemHost.readDir
readFile()
Section titled âreadFile()âreadFile(path): Promise<SourceFile>;
read a utf-8 or utf-8 with bom encoded file
Parameters
Section titled âParametersâParameter | Type |
---|---|
path | string |
Returns
Section titled âReturnsâPromise
<SourceFile
>
Inherited from
Section titled âInherited fromâSystemHost.readFile
readUrl()
Section titled âreadUrl()âreadUrl(url): Promise<SourceFile>;
read a file at the given url.
Parameters
Section titled âParametersâParameter | Type |
---|---|
url | string |
Returns
Section titled âReturnsâPromise
<SourceFile
>
Inherited from
Section titled âInherited fromâSystemHost.readUrl
realpath()
Section titled ârealpath()ârealpath(path): Promise<string>;
Parameters
Section titled âParametersâParameter | Type |
---|---|
path | string |
Returns
Section titled âReturnsâPromise
<string
>
Inherited from
Section titled âInherited fromâSystemHost.realpath
rm(path, options?): Promise<void>;
Deletes a directory or file.
Parameters
Section titled âParametersâParameter | Type | Description |
---|---|---|
path | string | Path to the directory or file. |
options? | RmOptions | - |
Returns
Section titled âReturnsâPromise
<void
>
Inherited from
Section titled âInherited fromâSystemHost.rm
stat(path): Promise<{ isDirectory: boolean; isFile: boolean;}>;
Parameters
Section titled âParametersâParameter | Type |
---|---|
path | string |
Returns
Section titled âReturnsâPromise
<{
isDirectory
: boolean
;
isFile
: boolean
;
}>
Inherited from
Section titled âInherited fromâSystemHost.stat
writeFile()
Section titled âwriteFile()âwriteFile(path, content): Promise<void>;
Write the file.
Parameters
Section titled âParametersâParameter | Type | Description |
---|---|---|
path | string | Path to the file. |
content | string | Content of the file. |
Returns
Section titled âReturnsâPromise
<void
>
Inherited from
Section titled âInherited fromâSystemHost.writeFile