diff options
Diffstat (limited to 'cli/js/ops/runtime_compiler.ts')
-rw-r--r-- | cli/js/ops/runtime_compiler.ts | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/cli/js/ops/runtime_compiler.ts b/cli/js/ops/runtime_compiler.ts new file mode 100644 index 000000000..035a4ef59 --- /dev/null +++ b/cli/js/ops/runtime_compiler.ts @@ -0,0 +1,23 @@ +// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. + +import { sendAsync } from "./dispatch_json.ts"; + +interface CompileRequest { + rootName: string; + sources?: Record<string, string>; + options?: string; + bundle: boolean; +} + +export async function compile(request: CompileRequest): Promise<string> { + return sendAsync("op_compile", request); +} + +interface TranspileRequest { + sources: Record<string, string>; + options?: string; +} + +export async function transpile(request: TranspileRequest): Promise<string> { + return sendAsync("op_transpile", request); +} |