2020-01-02 15:13:47 -05:00
|
|
|
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
|
2020-02-03 18:08:44 -05:00
|
|
|
use crate::ops::JsonResult;
|
2020-01-05 11:56:18 -05:00
|
|
|
use deno_core::ErrBox;
|
2019-07-31 13:16:03 -04:00
|
|
|
use futures::Future;
|
|
|
|
|
2020-01-21 11:50:06 -05:00
|
|
|
mod compiler_worker;
|
2019-07-31 13:16:03 -04:00
|
|
|
mod js;
|
|
|
|
mod json;
|
|
|
|
mod ts;
|
2019-11-14 08:31:39 -05:00
|
|
|
mod wasm;
|
2019-07-31 13:16:03 -04:00
|
|
|
|
|
|
|
pub use js::JsCompiler;
|
|
|
|
pub use json::JsonCompiler;
|
2020-01-08 09:17:44 -05:00
|
|
|
pub use ts::runtime_compile_async;
|
|
|
|
pub use ts::runtime_transpile_async;
|
2020-01-29 12:54:23 -05:00
|
|
|
pub use ts::TargetLib;
|
2019-07-31 13:16:03 -04:00
|
|
|
pub use ts::TsCompiler;
|
2019-11-14 08:31:39 -05:00
|
|
|
pub use wasm::WasmCompiler;
|
2019-07-31 13:16:03 -04:00
|
|
|
|
2020-02-03 18:08:44 -05:00
|
|
|
pub type CompilationResultFuture = dyn Future<Output = JsonResult>;
|
2020-01-08 09:17:44 -05:00
|
|
|
|
2019-07-31 13:16:03 -04:00
|
|
|
#[derive(Debug, Clone)]
|
|
|
|
pub struct CompiledModule {
|
|
|
|
pub code: String,
|
|
|
|
pub name: String,
|
|
|
|
}
|
|
|
|
|
|
|
|
pub type CompiledModuleFuture =
|
2020-02-03 18:08:44 -05:00
|
|
|
dyn Future<Output = Result<CompiledModule, ErrBox>>;
|