LensStudio:TypeScript.TypeScriptCompilationResult
ClassResult of a TypeScript compilation run, containing success status and any reported errors.
Index
Example
const { ITypeScriptCompilationApi } = await import('LensStudio:TypeScript');
const compiler = this.pluginSystem.findInterface(ITypeScriptCompilationApi) as ITypeScriptCompilationApi;
if (Editor.isNull(compiler)) {
console.log('Compilation API not available');
return;
}
const result = await compiler.refreshProjectCompilation();
if (result.succeeded) {
console.log('Compilation succeeded');
} else {
console.log(`Compilation failed with ${result.errors.length} error(s); first: ${result.errors[0] ?? ''}`);
}
Properties
errors
readonlyerrors:string[]
Array of error messages produced by the compilation.
succeeded
readonlysucceeded:boolean
Whether the compilation completed without errors.