import { CompilerService , Language } from "./types" ; import { RustService } from "./rustService" ; import { ClangService } from "./clangService" ; import { X86Service } from "./x86Service" ; export { ServiceInput , ServiceOutput , CompilerService , InputFile , OutputItem , Language , } from "./types" ; export async function createCompilerService ( from , to ) { if ( from === Language . Rust && to === Language . Wasm ) { return new RustService ( ) ; } if ( ( from === Language . C || from === Language . Cpp ) && to === Language . Wasm ) { return new ClangService ( from ) ; } if ( from === Language . Wasm && to === Language . x86 ) { return new X86Service ( ) ; } throw new Error ( `createCompilerService: not supported ${ from }->${ to }` ) ; }