#[cfg(feature = "tui")]
mod app;
#[cfg(feature = "tui")]
mod events;
#[cfg(feature = "tui")]
mod panels;
#[cfg(feature = "tui")]
mod ui;
#[cfg(feature = "tui")]
pub use app::{App, AppMode, AppState};
#[cfg(feature = "tui")]
pub use events::{Event, EventHandler};
#[cfg(feature = "tui")]
pub use panels::{Panel, PanelKind};
#[cfg(feature = "tui")]
pub use ui::render;
#[cfg(feature = "tui")]
pub fn run() -> anyhow::Result<()> {
use crossterm::{
event::{DisableMouseCapture, EnableMouseCapture},
execute,
terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen},
};
use ratatui::prelude::*;
use std::io;
enable_raw_mode()?;
let mut stdout = io::stdout();
execute!(stdout, EnterAlternateScreen, EnableMouseCapture)?;
let backend = CrosstermBackend::new(stdout);
let mut terminal = Terminal::new(backend)?;
let mut app = App::new();
let result = app.run(&mut terminal);
disable_raw_mode()?;
execute!(
terminal.backend_mut(),
LeaveAlternateScreen,
DisableMouseCapture
)?;
terminal.show_cursor()?;
result
}
#[cfg(test)]
#[cfg(feature = "tui")]
mod tests {
#![allow(clippy::assertions_on_constants)]
#[test]
fn test_tui_module_compiles() {
assert!(true);
}
}