1use wasm_bindgen::prelude::*;
7
8pub use flow_rs_core as core;
10pub use flow_rs_renderer as renderer;
11
12pub mod bindings;
13pub mod utils;
14
15#[wasm_bindgen(start)]
17pub fn init() {
18 #[cfg(feature = "console_error_panic_hook")]
19 console_error_panic_hook::set_once();
20
21 #[cfg(feature = "debug")]
22 {
23 use tracing::Level;
24 use tracing_wasm::WASMLayerConfigBuilder;
25
26 let config = WASMLayerConfigBuilder::default()
27 .set_max_level(Level::INFO)
28 .build();
29
30 tracing_wasm::set_as_global_default_with_config(config);
31
32 tracing::info!("Leptos Flow WASM initialized");
33 }
34}
35
36pub mod wasm_exports {
38 #[allow(unused_imports)]
39 use super::*;
40 pub use crate::bindings::*;
41}
42
43#[cfg(test)]
44mod tests {
45 use super::*;
46 use wasm_bindgen_test::*;
47
48 wasm_bindgen_test::wasm_bindgen_test_configure!(run_in_browser);
49
50 #[wasm_bindgen_test]
51 fn test_init() {
52 init();
53 }
55}