pub(crate) mod auth_claims;
pub mod client;
pub(crate) mod device_registry;
pub(crate) mod listener;
pub mod models;
pub mod room;
pub mod schema;
pub mod signaling;
pub(crate) mod webchannel;
#[cfg(all(
not(target_arch = "wasm32"),
not(any(target_os = "ios", target_os = "android"))
))]
pub mod native_signaling;
#[cfg(all(
not(target_arch = "wasm32"),
not(any(target_os = "ios", target_os = "android"))
))]
mod heartbeat;
#[cfg(target_arch = "wasm32")]
pub(crate) fn now_millis_u64() -> u64 {
js_sys::Date::now() as u64
}
#[cfg(target_arch = "wasm32")]
pub(crate) fn now_timestamp_rfc3339() -> String {
js_sys::Date::new_0()
.to_iso_string()
.as_string()
.unwrap_or_else(|| "1970-01-01T00:00:00.000Z".to_string())
}
#[cfg(not(target_arch = "wasm32"))]
pub(crate) fn now_millis_u64() -> u64 {
std::time::SystemTime::now()
.duration_since(std::time::UNIX_EPOCH)
.unwrap_or_default()
.as_millis() as u64
}
#[cfg(not(target_arch = "wasm32"))]
pub(crate) fn now_timestamp_rfc3339() -> String {
let now = std::time::SystemTime::now();
let dt: chrono::DateTime<chrono::Utc> = now.into();
dt.to_rfc3339_opts(chrono::SecondsFormat::Millis, true)
}