export type Uuid = string; export type TimeRange = { start: string; // ISO date end: string; // ISO date }; export type TimePoint = { time: string; // ISO datetime }; export type TimeRecurring = | { mode: "daily"; } | { mode: "weekly"; start?: number; end?: number; } | { mode: "yearly"; month?: number; day?: number; }; export type Time = | (TimeRange & { type: "range" }) | (TimePoint & { type: "point" }) | (TimeRecurring & { type: "recurring" }); export type ReminderTime = { time: string; // ISO datetime }; export type ReminderRelative = { offset: number; }; export type Reminder = | (ReminderTime & { type: "time" }) | (ReminderRelative & { type: "relative" }); export type CreateTodoData = { title: string; note: string; time?: Time; tags?: Uuid[]; category?: Uuid; reminders?: Reminder[]; }; export type Todo = { uuid: Uuid; title: string; note: string; time?: Time; tags?: Tag[]; category?: Category; checks?: string[]; // ISO dates reminders?: Reminder[]; }; export type Label = { uuid: Uuid; name: string; color: string; // "#RRGGBB" }; export type Category = Label & { icon: string; }; export type Tag = Label & { group: number; }; export type Organization = { uuid: Uuid; name: string; };