diff --git a/README.md b/README.md index 731a641..3ffb5b4 100644 --- a/README.md +++ b/README.md @@ -39,8 +39,8 @@ - [x] use_channel - [x] use_window_size - [x] use_interval + - [x] use_debounce - [ ] use_timeout - - [ ] use_debouncer - [ ] Camera - [ ] WiFi - [ ] Bluetooth diff --git a/sdk/src/clipboard/mod.rs b/sdk/src/clipboard/mod.rs index f51ee17..7437962 100644 --- a/sdk/src/clipboard/mod.rs +++ b/sdk/src/clipboard/mod.rs @@ -1,3 +1,8 @@ -mod use_clipboard; - -pub use use_clipboard::*; +cfg_if::cfg_if! { + if #[cfg(not(target_family = "wasm"))] { + mod use_clipboard; + pub use use_clipboard::*; + } else { + compile_error!("the `clipboard` feature is only available on desktop targets"); + } +} diff --git a/sdk/src/color_scheme/mod.rs b/sdk/src/color_scheme/mod.rs index d28f503..7c2e002 100644 --- a/sdk/src/color_scheme/mod.rs +++ b/sdk/src/color_scheme/mod.rs @@ -1,3 +1,8 @@ -mod use_preferred_color_scheme; - -pub use use_preferred_color_scheme::*; +cfg_if::cfg_if! { + if #[cfg(target_family = "wasm")] { + mod use_preferred_color_scheme; + pub use use_preferred_color_scheme::*; + } else { + compile_error!("the `color_scheme` feature is only available on wasm targets"); + } +} diff --git a/sdk/src/geolocation/mod.rs b/sdk/src/geolocation/mod.rs index 79a3ec8..29008e7 100644 --- a/sdk/src/geolocation/mod.rs +++ b/sdk/src/geolocation/mod.rs @@ -7,6 +7,6 @@ cfg_if::cfg_if! { pub use self::use_geolocation::*; } else { - compile_error!("The geolocation module is not supported on this platform."); + compile_error!("the `geolocation` feature is only available on wasm and windows targets"); } } diff --git a/sdk/src/notification/mod.rs b/sdk/src/notification/mod.rs index 392d39d..9058d0d 100644 --- a/sdk/src/notification/mod.rs +++ b/sdk/src/notification/mod.rs @@ -1 +1,7 @@ -pub mod notification; \ No newline at end of file +cfg_if::cfg_if! { + if #[cfg(not(target_family = "wasm"))] { + pub mod notification; + } else { + compile_error!("the `notification` feature is only available on desktop targets"); + } +} \ No newline at end of file