///
import { Default, NAME, Stream, UI, type VNode, Writable } from "commontools";
// === Domain Types ===
export interface Habit {
name: string;
icon: Default;
color: Default;
}
export interface HabitLog {
habitName: string;
date: string; // YYYY-MM-DD
completed: boolean;
}
// === Pattern Types ===
export interface HabitTrackerInput {
habits: Writable>;
logs: Writable>;
}
export interface HabitTrackerOutput {
[NAME]: string;
[UI]: VNode;
habits: Habit[];
logs: HabitLog[];
todayDate: string;
summary: string;
toggleHabit: Stream<{ habitName: string }>;
addHabit: Stream<{ name: string; icon: string }>;
deleteHabit: Stream<{ habit: Habit }>;
}