1#[cfg(target_arch = "wasm32")]
12pub use fret_platform_web::*;
13
14#[cfg(target_arch = "wasm32")]
15mod cursor;
16#[cfg(target_arch = "wasm32")]
17mod events;
18#[cfg(target_arch = "wasm32")]
19mod raf;
20
21#[cfg(target_arch = "wasm32")]
22pub use cursor::{
23 RunnerError, WebCursorListener, canvas_by_id, install_canvas_cursor_listener,
24 last_cursor_offset_px,
25};
26#[cfg(target_arch = "wasm32")]
27pub use events::{WebInputState, WebPointerEventKind, map_keyboard_event};
28#[cfg(target_arch = "wasm32")]
29pub use raf::{cancel_animation_frame, request_animation_frame, set_timeout_ms};
30
31#[cfg(not(target_arch = "wasm32"))]
32mod native;
33#[cfg(not(target_arch = "wasm32"))]
34pub use native::*;
35
36#[cfg(all(test, not(target_arch = "wasm32")))]
37mod tests {
38 use super::*;
39
40 #[test]
41 fn runner_error_is_actionable_on_non_wasm_targets() {
42 let err = RunnerError;
43 assert_eq!(
44 err.to_string(),
45 "fret-runner-web is only available on wasm32"
46 );
47
48 fn assert_error(_err: &dyn std::error::Error) {}
49 assert_error(&err);
50 }
51}