use crate::{Error, PromptBody, PromptInput, PromptState, Terminal};
#[derive(Debug)]
pub struct RenderSnapshot<'a> {
pub state: &'a PromptState,
pub message: String,
pub hint: Option<String>,
pub placeholder: Option<String>,
pub input: PromptInput,
pub body: PromptBody,
}
pub trait Theme<W: std::io::Write> {
fn log(&mut self, term: &mut dyn Terminal<W>, message: String) -> Result<(), Error>;
fn info(&mut self, term: &mut dyn Terminal<W>, message: String) -> Result<(), Error>;
fn warn(&mut self, term: &mut dyn Terminal<W>, message: String) -> Result<(), Error>;
fn error(&mut self, term: &mut dyn Terminal<W>, message: String) -> Result<(), Error>;
fn success(&mut self, term: &mut dyn Terminal<W>, message: String) -> Result<(), Error>;
fn step(&mut self, term: &mut dyn Terminal<W>, message: String) -> Result<(), Error>;
fn begin(&mut self, term: &mut dyn Terminal<W>, intro: Option<String>) -> Result<(), Error>;
fn render(&mut self, term: &mut dyn Terminal<W>, payload: RenderSnapshot) -> Result<(), Error>;
fn finish(
&mut self,
term: &mut dyn Terminal<W>,
state: &PromptState,
outro: Option<String>,
) -> Result<(), Error>;
}