use std::sync::OnceLock;
use crate::engine::{CoreResult, OxideError};
use crate::engine::navigation_runtime::NavigationRuntime;
static NAVIGATION: OnceLock<NavigationRuntime> = OnceLock::new();
pub fn init_navigation() -> CoreResult<()> {
let _ = NAVIGATION.get_or_init(NavigationRuntime::new);
Ok(())
}
pub fn navigation_runtime() -> CoreResult<&'static NavigationRuntime> {
NAVIGATION.get().ok_or_else(|| OxideError::Validation {
message: "navigation runtime not initialized; call init_navigation() (or init_engine_globals()) first".into(),
})
}