Files
k-frame/crates/domain/src/ports/broadcast.rs
Gabriel Kaszewski fe59b68c37 theme config, layout preview, container alignment
Server: ThemeConfig entity + CRUD (GET/PUT /theme), SQLite persistence,
ThemeUpdate broadcast to ESP32 on save and initial connect.
Client: render engine uses theme colors, full-screen redraw on theme change.
SPA: theme page with color pickers + presets, layout preview with TS port
of layout engine, justify/align controls on containers.
DisplayHint refactored to struct (kind + h_align + v_align).
2026-06-19 03:26:18 +02:00

24 lines
661 B
Rust

use crate::entities::WidgetId;
use crate::value_objects::{DisplayHint, Layout, ThemeConfig, WidgetState};
use std::future::Future;
pub trait BroadcastPort {
type Error;
fn push_screen_update(
&self,
layout: &Layout,
widgets: &[(WidgetId, DisplayHint, WidgetState)],
) -> impl Future<Output = Result<(), Self::Error>> + Send;
fn push_data_update(
&self,
updates: &[(WidgetId, DisplayHint, WidgetState)],
) -> impl Future<Output = Result<(), Self::Error>> + Send;
fn push_theme_update(
&self,
theme: &ThemeConfig,
) -> impl Future<Output = Result<(), Self::Error>> + Send;
}