use std::fmt;
use crate::pal::error::PalError;
use crate::pal::pseudoconsole::WindowSize;
#[derive(Clone, Debug, Eq, PartialEq)]
pub(crate) enum ConsoleInput {
Bytes(Vec<u8>),
Resize(WindowSize),
}
#[cfg_attr(test, mockall::automock)]
pub(crate) trait LocalConsole: Send + Sync + fmt::Debug + 'static {
fn has_console(&self) -> bool;
fn stdin_is_terminal(&self) -> bool;
fn disable_ctrl_c_handler(&self) -> Result<(), PalError>;
fn enter_raw_relay(&self) -> Result<(), PalError>;
fn leave_raw_relay(&self) -> Result<(), PalError>;
fn window_size(&self) -> Result<WindowSize, PalError>;
fn read_input(&self) -> Result<ConsoleInput, PalError>;
fn write_output(&self, data: &[u8]) -> Result<(), PalError>;
fn read_prompt_line(&self) -> Result<String, PalError>;
}