This library will generate a runtime.js
for your Deno Runtime and an abi.ts
to contextualize ts conventions against.
[build-dependencies]
deno_specta = { git = "https://github.com/whymidnight/deno-specta.git", features = ["runtime"] }
specta = { git = "https://github.com/whymidnight/specta.git" }
[dependencies]
deno_specta = { git = "https://github.com/whymidnight/deno-specta.git", features = ["runtime"] }
specta = { git = "https://github.com/whymidnight/specta.git" }
[features]
default = []
codegen = []
deno_op = []
use specta::specta;
use deno_core::op;
#[cfg_attr(feature = "deno_op", op)]
#[cfg_attr(feature = "codegen", specta)]
pub async fn foo(
my_name: String,
your_name: String,
) -> Result<String, deno_core::anyhow::Error> {
Ok(format!(
"Hello, {my_name}! You've been greeted by {your_name}!"
))
}
use deno_specta::runtime;
runtime::export(
collect_types![foo],
"./runtime.js",
)
.unwrap();