@sheetxl/scripting
Version:
Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild.
30 lines (29 loc) • 878 B
JavaScript
/**
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.6.6
*
* (C) 2025-present SheetXL Inc. & Michael T. Ford
* License: The license can be found at https://www.sheetxl.com/license.
*/
class o {
constructor(r = {}) {
this.workerWrapper = null;
}
async getWorkerWrapper() {
if (this.workerWrapper) return this.workerWrapper;
const { createCompilerWorker: r } = await import("./C5g8tHLBP9qlrw3p.mjs");
return this.workerWrapper = await r(), this.workerWrapper;
}
async compileModule(r) {
try {
return (await this.getWorkerWrapper()).execute(r);
} catch (e) {
throw console.error("Failed to compile using worker:", e), e;
}
}
terminate() {
this.workerWrapper?.terminate(), this.workerWrapper = null;
}
}
export {
o as TypeScriptCompiler
};