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
18pub use layout::Size;
19pub use select_option::SelectOption;
20
21pub struct RenderContext {
23 pub terminal_size: Size,
24 pub elapsed: Duration,
25}
26
27pub trait Component {
34 fn render<W: Write>(
35 &self,
36 writer: &mut W,
37 ctx: &RenderContext,
38 rng: &mut ThreadRng,
39 ) -> io::Result<()>;
40}