(wasm) Add VeilidCrypto class, refine interfaces for VeilidRoutingContext

This commit is contained in:
Brandon Vandegrift
2023-09-03 23:25:04 -04:00
parent c5d7922fc5
commit ca11f6075d
16 changed files with 623 additions and 87 deletions
+21
View File
@@ -0,0 +1,21 @@
cfg_if::cfg_if! {
if #[cfg(target_arch = "wasm32")] {
pub use tsify::*;
pub use wasm_bindgen::prelude::*;
macro_rules! from_impl_to_jsvalue {
($name: ident) => {
impl From<$name> for JsValue {
fn from(value: $name) -> Self {
serde_wasm_bindgen::to_value(&value).unwrap()
}
}
}
}
} else {
macro_rules! from_impl_to_jsvalue {
($name: ident) => {}
}
}
}
pub(crate) use from_impl_to_jsvalue;