use std::collections::HashMap;
use std::sync::{Arc, Mutex, MutexGuard, OnceLock};
use onetaskgraph_plugin_api::NativeId;
use super::{Vocabulary, WriteKind};
type Vocabularies = HashMap<(String, String), Arc<Vocabulary>>;
type Labels = HashMap<(String, WriteKind, String), NativeId>;
pub(crate) fn vocabularies() -> MutexGuard<'static, Vocabularies> {
static HELD: OnceLock<Mutex<Vocabularies>> = OnceLock::new();
HELD.get_or_init(Mutex::default)
.lock()
.unwrap_or_else(std::sync::PoisonError::into_inner)
}
pub(crate) fn labels() -> MutexGuard<'static, Labels> {
static HELD: OnceLock<Mutex<Labels>> = OnceLock::new();
HELD.get_or_init(Mutex::default)
.lock()
.unwrap_or_else(std::sync::PoisonError::into_inner)
}