dioxus_interpreter_js/
lib.rs1#![allow(clippy::empty_docs)]
2#![doc = include_str!("../README.md")]
3#![doc(html_logo_url = "https://avatars.githubusercontent.com/u/79236386")]
4#![doc(html_favicon_url = "https://avatars.githubusercontent.com/u/79236386")]
5
6pub static INTERPRETER_JS: &str = include_str!("./js/core.js");
8
9pub static NATIVE_JS: &str = include_str!("./js/native.js");
11
12pub static INITIALIZE_STREAMING_JS: &str = include_str!("./js/initialize_streaming.js");
14
15#[cfg(all(feature = "binary-protocol", feature = "sledgehammer"))]
16mod write_native_mutations;
17
18#[cfg(all(feature = "binary-protocol", feature = "sledgehammer"))]
19pub use write_native_mutations::*;
20
21#[cfg(feature = "sledgehammer")]
22pub mod unified_bindings;
23
24#[cfg(feature = "sledgehammer")]
25pub use unified_bindings::*;
26
27#[cfg(all(feature = "minimal_bindings", feature = "webonly"))]
29pub mod minimal_bindings {
30 use wasm_bindgen::{prelude::wasm_bindgen, JsValue};
31
32 #[wasm_bindgen(module = "/src/js/set_attribute.js")]
36 extern "C" {
37 pub fn setAttributeInner(node: JsValue, name: &str, value: JsValue, ns: Option<&str>);
39 }
40
41 #[wasm_bindgen(module = "/src/js/hydrate.js")]
42 extern "C" {
43 pub fn register_rehydrate_chunk_for_streaming(
45 closure: &wasm_bindgen::closure::Closure<dyn FnMut(Vec<u32>, js_sys::Uint8Array)>,
46 );
47
48 pub fn register_rehydrate_chunk_for_streaming_debug(
50 closure: &wasm_bindgen::closure::Closure<
51 dyn FnMut(Vec<u32>, js_sys::Uint8Array, Option<Vec<String>>, Option<Vec<String>>),
52 >,
53 );
54 }
55
56 #[wasm_bindgen(module = "/src/js/patch_console.js")]
57 extern "C" {
58 pub fn monkeyPatchConsole(ws: JsValue);
59 }
60}