[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()
fileURLToPath(url): stringParameters
| Parameter | Type |
|---|---|
url | string |
Returns
string
getExecutionRoot()
getExecutionRoot(): stringReturns
string
getJsImport()
getJsImport(path): Promise<Record<string, any>>Parameters
| Parameter | Type |
|---|---|
path | string |
Returns
Promise<Record<string, any>>
getLibDirs()
getLibDirs(): string[]Returns
string[]
getSourceFileKind()
getSourceFileKind(path): undefined | SourceFileKindParameters
| Parameter | Type |
|---|---|
path | string |
Returns
undefined | SourceFileKind
mkdirp()
mkdirp(path): Promise<undefined | string>create directory recursively.
Parameters
| Parameter | Type | Description |
|---|---|---|
path | string | Path to the directory. |
Returns
Promise<undefined | string>
pathToFileURL()
pathToFileURL(path): stringParameters
| Parameter | Type |
|---|---|
path | string |
Returns
string
readDir()
readDir(path): Promise<string[]>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()
readFile(path): Promise<SourceFile>read a utf-8 or utf-8 with bom encoded file
Parameters
| Parameter | Type |
|---|---|
path | string |
Returns
Promise<SourceFile>
readUrl()
readUrl(url): Promise<SourceFile>read a file at the given url.
Parameters
| Parameter | Type |
|---|---|
url | string |
Returns
Promise<SourceFile>
realpath()
realpath(path): Promise<string>Parameters
| Parameter | Type |
|---|---|
path | string |
Returns
Promise<string>
rm()
rm(path, options?): Promise<void>Deletes a directory or file.
Parameters
| Parameter | Type | Description |
|---|---|---|
path | string | Path to the directory or file. |
options? | RmOptions | - |
Returns
Promise<void>
stat()
stat(path): Promise<object>Parameters
| Parameter | Type |
|---|---|
path | string |
Returns
Promise<object>
| Name | Type |
|---|---|
isDirectory() | boolean |
isFile() | boolean |
writeFile()
writeFile(path, content): Promise<void>Write the file.
Parameters
| Parameter | Type | Description |
|---|---|---|
path | string | Path to the file. |
content | string | Content of the file. |
Returns
Promise<void>