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