use crossterm::event::KeyEvent;
use tty_interface::{Interface, Position};
use crate::{
dependency::DependencyState,
text::{DrawerContents, Segment},
Form,
};
mod compound;
pub use compound::*;
mod keyvalue;
pub use keyvalue::*;
mod textblock;
pub use textblock::*;
mod yesno;
pub use yesno::*;
pub trait Step {
fn initialize(&mut self, dependency_state: &mut DependencyState, index: usize);
fn render(
&self,
interface: &mut Interface,
dependency_state: &DependencyState,
position: Position,
is_focused: bool,
) -> u16;
fn update(
&mut self,
dependency_state: &mut DependencyState,
input: KeyEvent,
) -> Option<InputResult>;
fn help(&self) -> Segment;
fn drawer(&self) -> Option<DrawerContents>;
fn result(&self, dependency_state: &DependencyState) -> String;
fn add_to(self, form: &mut Form);
}
pub enum InputResult {
AdvanceForm,
RetreatForm,
}