summaryrefslogtreecommitdiff
path: root/cli/js/ops
diff options
context:
space:
mode:
Diffstat (limited to 'cli/js/ops')
-rw-r--r--cli/js/ops/compiler.ts12
-rw-r--r--cli/js/ops/runtime_compiler.ts18
2 files changed, 16 insertions, 14 deletions
diff --git a/cli/js/ops/compiler.ts b/cli/js/ops/compiler.ts
index 825cadc16..60f814741 100644
--- a/cli/js/ops/compiler.ts
+++ b/cli/js/ops/compiler.ts
@@ -38,15 +38,3 @@ export function getAsset(name: string): string {
const sourceCodeBytes = core.dispatch(opId, encoder.encode(name));
return decoder.decode(sourceCodeBytes!);
}
-
-export function cache(
- extension: string,
- moduleId: string,
- contents: string
-): void {
- sendSync("op_cache", {
- extension,
- moduleId,
- contents,
- });
-}
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);
}