summaryrefslogtreecommitdiff
path: root/cli/js/ops/runtime_compiler.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cli/js/ops/runtime_compiler.ts')
-rw-r--r--cli/js/ops/runtime_compiler.ts18
1 files changed, 16 insertions, 2 deletions
diff --git a/cli/js/ops/runtime_compiler.ts b/cli/js/ops/runtime_compiler.ts
index b46670ace..5a89983ee 100644
--- a/cli/js/ops/runtime_compiler.ts
+++ b/cli/js/ops/runtime_compiler.ts
@@ -1,6 +1,7 @@
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
import { sendAsync } from "./dispatch_json.ts";
+import { DiagnosticItem } from "../diagnostics.ts";
interface CompileRequest {
rootName: string;
@@ -9,7 +10,13 @@ interface CompileRequest {
bundle: boolean;
}
-export function compile(request: CompileRequest): Promise<string> {
+interface CompileResponse {
+ diagnostics: DiagnosticItem[];
+ output?: string;
+ emitMap?: Record<string, Record<string, string>>;
+}
+
+export function compile(request: CompileRequest): Promise<CompileResponse> {
return sendAsync("op_compile", request);
}
@@ -18,6 +25,13 @@ interface TranspileRequest {
options?: string;
}
-export function transpile(request: TranspileRequest): Promise<string> {
+export interface TranspileOnlyResult {
+ source: string;
+ map?: string;
+}
+
+export function transpile(
+ request: TranspileRequest
+): Promise<Record<string, TranspileOnlyResult>> {
return sendAsync("op_transpile", request);
}