// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. import { sendAsync } from "./dispatch_json.ts"; import type { DiagnosticItem } from "../diagnostics.ts"; interface CompileRequest { rootName: string; sources?: Record; options?: string; bundle: boolean; } interface CompileResponse { diagnostics: DiagnosticItem[]; output?: string; emitMap?: Record>; } export function compile(request: CompileRequest): Promise { return sendAsync("op_compile", request); } interface TranspileRequest { sources: Record; options?: string; } export interface TranspileOnlyResult { source: string; map?: string; } export function transpile( request: TranspileRequest ): Promise> { return sendAsync("op_transpile", request); }