hojicha 0.2.2

Elm Architecture for terminal UIs in Rust, inspired by Bubbletea
Documentation
//! # Hojicha
//!
//! The Elm Architecture for Terminal UIs in Rust.
//!
//! This is a convenience facade that re-exports the core hojicha crates:
//! - `hojicha-core`: Core TEA abstractions (Model, Cmd, Event)
//! - `hojicha-runtime`: Event loop and async runtime (Program)
//!
//! ## Quick Start
//!
//! ```no_run
//! use hojicha::prelude::*;
//!
//! struct Counter {
//!     value: i32,
//! }
//!
//! impl Model for Counter {
//!     type Message = ();
//!
//!     fn update(&mut self, event: Event<()>) -> Cmd<()> {
//!         match event {
//!             Event::Key(key) => match key.key {
//!                 Key::Up => self.value += 1,
//!                 Key::Down => self.value -= 1,
//!                 Key::Char('q') => return quit(),
//!                 _ => {}
//!             },
//!             _ => {}
//!         }
//!         Cmd::noop()
//!     }
//!
//!     fn view(&self) -> String {
//!         // Return a string with ANSI codes for terminal rendering
//!         format!("Count: {}", self.value)
//!     }
//! }
//!
//! fn main() -> Result<()> {
//!     Program::new(Counter { value: 0 })?.run()
//! }
//! ```

#![warn(missing_docs)]

// Re-export core functionality
pub use hojicha_core::{
    async_helpers, commands, concurrency, core, debug, event, fallible, Cmd, Event, Key, KeyEvent,
    KeyModifiers, Message, Model, MouseButton, MouseEvent, MouseEventKind, Result, WindowSize,
};

// Type alias for compatibility
/// Alias for WindowSize for compatibility
pub type Size = WindowSize;

// Re-export runtime
pub use hojicha_runtime::{panic_recovery, program, Program};

/// Convenience function to run a Hojicha application
///
/// # Example
/// ```no_run
/// # use hojicha::{Model, Event, Cmd};
/// # struct MyApp;
/// # impl Model for MyApp {
/// #     type Message = ();
/// #     fn update(&mut self, _: Event<()>) -> Cmd<()> { Cmd::noop() }
/// #     fn view(&self) -> String { String::new() }
/// # }
/// hojicha::run(MyApp, ()).expect("Failed to run app");
/// ```
pub fn run<M>(model: M, _context: ()) -> Result<()>
where
    M: Model,
    M::Message: Clone,
{
    Program::new(model)?.run()
}

/// Prelude module containing commonly used types and traits
pub mod prelude {
    // Core prelude
    pub use hojicha_core::prelude::*;

    // Runtime prelude
    pub use hojicha_runtime::prelude::*;
}