- 优化checkbox样式:缩小尺寸(14px)、移除阴影、添加白色填充
- 调整布局:标题和内容左对齐
- 重构右键菜单为垂直分类布局:调整时间/颜色/操作
- 添加菜单边缘保护:自动计算位置避免超出浏览器
- 添加点击外部和ESC键关闭菜单
- 编辑弹窗优先级改为颜色圆点选择器
- 添加priority类型定义
🤖 Generated with Claude Code
90 lines
2.2 KiB
TypeScript
90 lines
2.2 KiB
TypeScript
// User types
|
|
export interface User {
|
|
id: string;
|
|
email: string;
|
|
nickname?: string;
|
|
created_at: string;
|
|
updated_at: string;
|
|
}
|
|
|
|
// Event types - for both Anniversary and Reminder
|
|
export type EventType = 'anniversary' | 'reminder';
|
|
|
|
// Repeat types: 'daily'每天, 'weekly'每周, 'monthly'每月, 'yearly'每年, 'none'不重复
|
|
export type RepeatType = 'daily' | 'weekly' | 'monthly' | 'yearly' | 'none';
|
|
|
|
// Priority types: 'none'无色, 'red'红色, 'green'绿色, 'yellow'黄色
|
|
export type PriorityType = 'none' | 'red' | 'green' | 'yellow';
|
|
|
|
// Unified event type (matches backend API)
|
|
export interface Event {
|
|
id: string;
|
|
user_id: string;
|
|
type: EventType;
|
|
title: string;
|
|
content?: string; // Only for reminders
|
|
date: string; // 当前提醒日期(展示用)
|
|
is_lunar: boolean;
|
|
repeat_type: RepeatType;
|
|
repeat_interval?: number | null; // 周数间隔(仅 weekly 类型使用)
|
|
next_reminder_date?: string | null; // 下一次提醒日期(计算用)
|
|
is_holiday?: boolean; // Only for anniversaries
|
|
is_completed?: boolean; // Only for reminders
|
|
priority?: PriorityType; // Priority level for reminders
|
|
created_at: string;
|
|
updated_at: string;
|
|
}
|
|
|
|
// Note types
|
|
export interface Note {
|
|
id: string;
|
|
user_id: string;
|
|
content: string; // HTML content from rich text editor
|
|
created_at: string;
|
|
updated_at: string;
|
|
}
|
|
|
|
// AI Parsing types
|
|
export interface AIParsedEvent {
|
|
title: string;
|
|
date: string;
|
|
is_lunar: boolean;
|
|
repeat_type: RepeatType;
|
|
reminder_time?: string;
|
|
type: EventType;
|
|
}
|
|
|
|
export interface AIConversation {
|
|
id: string;
|
|
user_id: string;
|
|
message: string;
|
|
response: string;
|
|
parsed_events?: AIParsedEvent[];
|
|
created_at: string;
|
|
}
|
|
|
|
// Auth types
|
|
export interface AuthState {
|
|
user: User | null;
|
|
isAuthenticated: boolean;
|
|
isLoading: boolean;
|
|
}
|
|
|
|
export interface LoginCredentials {
|
|
email: string;
|
|
password: string;
|
|
}
|
|
|
|
export interface RegisterCredentials extends LoginCredentials {
|
|
nickname?: string;
|
|
}
|
|
|
|
// API Response types
|
|
export interface ApiResponse<T> {
|
|
data: T | null;
|
|
error: string | null;
|
|
}
|
|
|
|
// Loading state types
|
|
export type LoadingState = 'idle' | 'loading' | 'success' | 'error';
|