use std::io;
use crate::{ Size, Position };
pub enum ClearType {
All,
Purge,
CurrentLine,
FromCursorDown,
FromCursorUp,
UntilNewLine,
}
pub trait Backend<T> {
fn flush(&mut self) -> Result<(), io::Error>;
fn terminal_size(&self) -> Result<Size, io::Error>;
fn set_cursor_pos(&mut self, position: Position) -> Result<(), io::Error>;
fn alt_screen(&mut self, enable: bool) -> Result<(), io::Error>;
fn raw_mode(&mut self, enable: bool) -> Result<(), io::Error>;
fn capture_mouse(&mut self, enable: bool) -> Result<(), io::Error>;
fn clear(&mut self, clear_type: ClearType) -> Result<(), io::Error>;
fn show_cursor(&mut self, enable: bool) -> Result<(), io::Error>;
fn begin_sync_update(&mut self) -> Result<(), io::Error>;
fn end_sync_update(&mut self) -> Result<(), io::Error>;
fn print(&mut self, print: T) -> Result<(), io::Error>;
fn cursor_position(&self) -> Result<Position, io::Error>;
}