2020-01-02 15:13:47 -05:00
|
|
|
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
|
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-08 09:17:44 -05:00
|
|
|
use serde_json::Value;
|
2019-07-31 13:16:03 -04:00
|
|
|
|
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;
|
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-01-08 09:17:44 -05:00
|
|
|
pub type CompilationResultFuture =
|
|
|
|
dyn Future<Output = Result<Value, ErrBox>> + Send;
|
|
|
|
|
2019-07-31 13:16:03 -04:00
|
|
|
#[derive(Debug, Clone)]
|
|
|
|
pub struct CompiledModule {
|
|
|
|
pub code: String,
|
|
|
|
pub name: String,
|
|
|
|
}
|
|
|
|
|
|
|
|
pub type CompiledModuleFuture =
|
2019-11-16 19:17:47 -05:00
|
|
|
dyn Future<Output = Result<CompiledModule, ErrBox>> + Send;
|