pub use tui_dispatch_core::reducer_compose;
pub use tui_dispatch_core::*;
#[cfg(feature = "debug")]
pub use tui_dispatch_debug::debug;
#[cfg(not(feature = "debug"))]
pub mod debug {
use std::fmt::Debug;
#[derive(Clone, Debug, Default)]
pub struct DebugEntry {
pub key: String,
pub value: String,
}
impl DebugEntry {
pub fn new(key: impl Into<String>, value: impl Into<String>) -> Self {
Self {
key: key.into(),
value: value.into(),
}
}
}
#[derive(Clone, Debug, Default)]
pub struct DebugSection {
pub title: String,
pub entries: Vec<DebugEntry>,
}
impl DebugSection {
pub fn new(title: impl Into<String>) -> Self {
Self {
title: title.into(),
entries: Vec::new(),
}
}
pub fn entry(mut self, key: impl Into<String>, value: impl Into<String>) -> Self {
self.entries.push(DebugEntry::new(key, value));
self
}
}
pub trait DebugState {
fn debug_sections(&self) -> Vec<DebugSection>;
}
pub fn debug_string<T: Debug>(value: &T) -> String {
format!("{value:?}")
}
pub fn debug_string_pretty<T: Debug>(value: &T) -> String {
format!("{value:#?}")
}
}
pub use tui_dispatch_macros::{Action, BindingContext, ComponentId, DebugState, FeatureFlags};
pub mod prelude {
pub use tui_dispatch_core::{
Action, ActionCategory, ActionParams, BindingContext, Component, ComponentId,
};
pub use tui_dispatch_core::{
process_raw_event, spawn_event_poller, DefaultBindingContext, Event, EventBus,
EventContext, EventHandler, EventKind, EventRoutingState, EventType, GlobalKeyPolicy,
HandlerResponse, NumericComponentId, RawEvent, RouteTarget, RoutedEvent, SimpleEventBus,
};
pub use tui_dispatch_core::{format_key_for_display, parse_key_string, Keybindings};
pub use tui_dispatch_core::reducer_compose;
#[cfg(feature = "tracing")]
pub use tui_dispatch_core::LoggingMiddleware;
pub use tui_dispatch_core::{
ComposedMiddleware, DispatchError, DispatchLimits, Middleware, NoopMiddleware, Reducer,
Store, StoreWithMiddleware,
};
pub use tui_dispatch_core::{DataResource, NoEffect, ReducerResult};
pub use tui_dispatch_core::{
DispatchErrorPolicy, EffectContext, EventOutcome, PollerConfig, RenderContext, Runtime,
RuntimeStore,
};
#[cfg(feature = "tasks")]
pub use tui_dispatch_core::{TaskKey, TaskManager, TaskPauseHandle};
#[cfg(feature = "subscriptions")]
pub use tui_dispatch_core::{SubKey, SubPauseHandle, Subscriptions};
#[cfg(feature = "debug")]
pub use crate::debug::{
ActionLoggerConfig, ActionLoggerMiddleware, DebugFreeze, DebugOverlay, DebugTableBuilder,
};
pub use crate::debug::{DebugSection, DebugState};
pub use tui_dispatch_macros::{Action, BindingContext, ComponentId, DebugState, FeatureFlags};
pub use tui_dispatch_core::{Color, Frame, Line, Modifier, Rect, Span, Style, Text};
}