summaryrefslogtreecommitdiff
path: root/cli/compilers/mod.rs
blob: bc3bfade2b91469eccd167bddf720f88eda72fc0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
use crate::ops::JsonResult;
use deno_core::ErrBox;
use futures::Future;

mod compiler_worker;
mod js;
mod ts;

pub use js::JsCompiler;
pub use ts::runtime_compile;
pub use ts::runtime_transpile;
pub use ts::TargetLib;
pub use ts::TsCompiler;

pub type CompilationResultFuture = dyn Future<Output = JsonResult>;

#[derive(Debug, Clone)]
pub struct CompiledModule {
  pub code: String,
  pub name: String,
}

pub type CompiledModuleFuture =
  dyn Future<Output = Result<CompiledModule, ErrBox>>;