summaryrefslogtreecommitdiff
path: root/cli/js/ops/runtime_compiler.ts
blob: b46670acef093c33ca16e52b92bbe2dd40deb587 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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 function compile(request: CompileRequest): Promise<string> {
  return sendAsync("op_compile", request);
}

interface TranspileRequest {
  sources: Record<string, string>;
  options?: string;
}

export function transpile(request: TranspileRequest): Promise<string> {
  return sendAsync("op_transpile", request);
}