use std::io;
use thiserror::Error;
pub type Result<T> = std::result::Result<T, GuiError>;
#[derive(Error, Debug)]
pub enum GuiError {
#[error("IO error: {0}")]
Io(#[from] io::Error),
#[error("JSON error: {0}")]
Json(#[from] serde_json::Error),
#[error("Failed to bind socket: {0}")]
SocketBind(String),
#[error("Failed to connect to Termux GUI service")]
ConnectionFailed,
#[error("Invalid response: {0}")]
InvalidResponse(String),
#[error("View with ID {0} not found")]
ViewNotFound(i64),
#[error("Invalid view operation: {0}")]
InvalidOperation(String),
#[error("Event handling error: {0}")]
EventError(String),
}