1pub use tui_dispatch_core::reducer_compose;
87pub use tui_dispatch_core::*;
88
89#[cfg(feature = "debug")]
91pub use tui_dispatch_debug::debug;
92#[cfg(not(feature = "debug"))]
93pub mod debug {
94 use std::fmt::Debug;
95
96 #[derive(Clone, Debug, Default)]
97 pub struct DebugEntry {
98 pub key: String,
99 pub value: String,
100 }
101
102 impl DebugEntry {
103 pub fn new(key: impl Into<String>, value: impl Into<String>) -> Self {
104 Self {
105 key: key.into(),
106 value: value.into(),
107 }
108 }
109 }
110
111 #[derive(Clone, Debug, Default)]
112 pub struct DebugSection {
113 pub title: String,
114 pub entries: Vec<DebugEntry>,
115 }
116
117 impl DebugSection {
118 pub fn new(title: impl Into<String>) -> Self {
119 Self {
120 title: title.into(),
121 entries: Vec::new(),
122 }
123 }
124
125 pub fn entry(mut self, key: impl Into<String>, value: impl Into<String>) -> Self {
126 self.entries.push(DebugEntry::new(key, value));
127 self
128 }
129 }
130
131 pub trait DebugState {
132 fn debug_sections(&self) -> Vec<DebugSection>;
133 }
134
135 pub fn debug_string<T: Debug>(value: &T) -> String {
136 format!("{value:?}")
137 }
138
139 pub fn debug_string_pretty<T: Debug>(value: &T) -> String {
140 format!("{value:#?}")
141 }
142}
143
144pub use tui_dispatch_macros::{Action, BindingContext, ComponentId, DebugState, FeatureFlags};
146
147pub mod prelude {
149 pub use tui_dispatch_core::{
151 Action, ActionCategory, ActionParams, BindingContext, Component, ComponentId,
152 };
153
154 pub use tui_dispatch_core::{
156 process_raw_event, spawn_event_poller, DefaultBindingContext, Event, EventBus,
157 EventContext, EventHandler, EventKind, EventRoutingState, EventType, GlobalKeyPolicy,
158 HandlerResponse, NumericComponentId, RawEvent, RouteTarget, RoutedEvent, SimpleEventBus,
159 };
160
161 pub use tui_dispatch_core::{format_key_for_display, parse_key_string, Keybindings};
163
164 pub use tui_dispatch_core::reducer_compose;
166 #[cfg(feature = "tracing")]
167 pub use tui_dispatch_core::LoggingMiddleware;
168 pub use tui_dispatch_core::{
169 ComposedMiddleware, DispatchError, DispatchLimits, Middleware, NoopMiddleware, Reducer,
170 Store, StoreWithMiddleware,
171 };
172
173 pub use tui_dispatch_core::{
175 DataResource, EffectReducer, EffectStore, EffectStoreWithMiddleware, ReducerResult,
176 };
177
178 pub use tui_dispatch_core::{
180 DispatchErrorPolicy, DispatchRuntime, DispatchStore, EffectContext, EffectRuntime,
181 EffectStoreLike, EventOutcome, PollerConfig, RenderContext,
182 };
183
184 #[cfg(feature = "tasks")]
186 pub use tui_dispatch_core::{TaskKey, TaskManager, TaskPauseHandle};
187
188 #[cfg(feature = "subscriptions")]
190 pub use tui_dispatch_core::{SubKey, SubPauseHandle, Subscriptions};
191
192 #[cfg(feature = "debug")]
194 pub use crate::debug::{
195 ActionLoggerConfig, ActionLoggerMiddleware, DebugFreeze, DebugOverlay, DebugTableBuilder,
196 };
197 pub use crate::debug::{DebugSection, DebugState};
198
199 pub use tui_dispatch_macros::{Action, BindingContext, ComponentId, DebugState, FeatureFlags};
201
202 pub use tui_dispatch_core::{Color, Frame, Line, Modifier, Rect, Span, Style, Text};
204}