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 19:16:03 +02:00
|
|
|
use futures::Future;
|
2020-01-09 01:17:44 +11:00
|
|
|
use serde_json::Value;
|
2019-07-31 19:16:03 +02:00
|
|
|
|
2020-01-21 17:50:06 +01:00
|
|
|
mod compiler_worker;
|
2019-07-31 19:16:03 +02:00
|
|
|
mod js;
|
|
|
|
mod json;
|
|
|
|
mod ts;
|
2019-11-14 05:31:39 -08:00
|
|
|
mod wasm;
|
2019-07-31 19:16:03 +02:00
|
|
|
|
|
|
|
pub use js::JsCompiler;
|
|
|
|
pub use json::JsonCompiler;
|
2020-01-09 01:17:44 +11:00
|
|
|
pub use ts::runtime_compile_async;
|
|
|
|
pub use ts::runtime_transpile_async;
|
2020-01-29 18:54:23 +01:00
|
|
|
pub use ts::TargetLib;
|
2019-07-31 19:16:03 +02:00
|
|
|
pub use ts::TsCompiler;
|
2019-11-14 05:31:39 -08:00
|
|
|
pub use wasm::WasmCompiler;
|
2019-07-31 19:16:03 +02:00
|
|
|
|
2020-01-09 01:17:44 +11:00
|
|
|
pub type CompilationResultFuture =
|
|
|
|
dyn Future<Output = Result<Value, ErrBox>> + Send;
|
|
|
|
|
2019-07-31 19:16:03 +02:00
|
|
|
#[derive(Debug, Clone)]
|
|
|
|
pub struct CompiledModule {
|
|
|
|
pub code: String,
|
|
|
|
pub name: String,
|
|
|
|
}
|
|
|
|
|
|
|
|
pub type CompiledModuleFuture =
|
2019-11-17 01:17:47 +01:00
|
|
|
dyn Future<Output = Result<CompiledModule, ErrBox>> + Send;
|