use printobserver_printer_api::{
Adjustable, HeaterSnapshot, JobSnapshot, PrinterSnapshot, PrinterState,
};
use printobserver_types::contract::TypeContract;
pub fn declared() -> Vec<TypeContract> {
vec![
TypeContract::of::<Adjustable>("Adjustable"),
TypeContract::of::<HeaterSnapshot>("HeaterSnapshot"),
TypeContract::of::<JobSnapshot>("JobSnapshot"),
TypeContract::of::<PrinterSnapshot>("PrinterSnapshot"),
TypeContract::of::<PrinterState>("PrinterState"),
]
}
pub fn contract(type_name: &str) -> TypeContract {
declared()
.into_iter()
.find(|entry| entry.name == type_name)
.unwrap_or_else(|| panic!("{type_name} is declared"))
}