1#![allow(unexpected_cfgs)]
2
3use std::io;
4use std::io::Write;
5use std::time::Duration;
6
7use rand::rngs::ThreadRng;
8
9pub mod decode;
10pub mod input_buffer;
11pub mod layout;
12pub mod prompt;
13pub mod select_option;
14pub mod style;
15
16pub mod components;
17
18#[cfg(not(tarpaulin_include))]
19mod wizard_composer;
20
21#[cfg(not(tarpaulin_include))]
22pub use wizard_composer::{WizardPromptRefs, render_wizard_prompt_layer};
23
24pub use layout::Size;
25pub use select_option::SelectOption;
26
27pub struct RenderContext {
29 pub terminal_size: Size,
30 pub elapsed: Duration,
31}
32
33pub trait Component {
40 fn render<W: Write>(
41 &self,
42 writer: &mut W,
43 ctx: &RenderContext,
44 rng: &mut ThreadRng,
45 ) -> io::Result<()>;
46}