-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
130 lines (118 loc) · 2.63 KB
/
types.ts
File metadata and controls
130 lines (118 loc) · 2.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
export enum MoodLevel {
ANNOYED = 1,
UPSET = 2,
ANGRY = 3,
FURIOUS = 4,
EXPLOSIVE = 5,
}
export enum Deadline {
TODAY = 'today',
THIS_WEEK = 'week',
THIS_MONTH = 'month',
LATER = 'later',
SELF_DIGEST = 'self',
}
export enum Status {
ACTIVE = 'active',
PROCESSING = 'processing',
RESOLVED = 'resolved',
BURNED = 'burned', // 已焚烧状态
}
/**
* 同步状态
*/
export type SyncStatus = 'pending' | 'synced' | 'failed';
/**
* 音频数据结构
*/
export interface AudioData {
id: string;
localUri: string;
remoteUrl?: string;
duration: number; // 时长(秒)
fileSize: number; // 文件大小(字节)
fileHash: string; // MD5哈希,用于去重和完整性校验
name?: string; // 用户自定义名称
createdAt: number;
syncStatus: SyncStatus;
}
/**
* 编辑历史记录
*/
export interface EditHistory {
editedAt: number;
previousContent: string;
previousMoodLevel: MoodLevel;
previousDeadline: string;
previousPeople: string[];
previousTriggers: string[];
}
export interface MoodEntry {
id: string;
timestamp: number;
moodLevel: MoodLevel;
content: string;
deadline: string; // Changed to string to support custom values
people: string[]; // e.g. "Boyfriend", "Mom"
triggers: string[]; // e.g. "Late", "Chore"
status: Status;
resolvedAt?: number;
burnedAt?: number; // 焚烧时间戳
editHistory?: EditHistory[]; // 编辑历史记录
audios?: AudioData[]; // 语音附件
intensity?: 1 | 2 | 3 | 4 | 5; // 情绪强度
syncStatus?: SyncStatus; // 同步状态
}
export interface User {
id: string;
name: string;
email?: string;
avatar?: string;
firstEntryDate?: number; // 第一条记录的时间戳(毫秒)
}
/**
* Profile 缓存数据结构
*/
export interface CachedProfile {
userId: string;
name: string;
avatar?: string;
email?: string;
cachedAt: number; // 缓存时间戳(毫秒)
}
export interface WeatherState {
score: number; // 0 - 100+
condition: 'sunny' | 'cloudy' | 'rainy' | 'stormy';
description: string;
}
export interface AppState {
entries: MoodEntry[];
settings: {
weatherThresholds: {
cloudy: number;
rainy: number;
stormy: number;
};
};
}
// AI相关类型
export interface EmotionForecast {
predictions: {
date: string;
predictedMoodLevel: number;
confidence: number;
riskLevel: 'high' | 'medium' | 'low';
}[];
warnings: {
date: string;
message: string;
severity: 'high' | 'medium' | 'low';
}[];
summary: string;
lastUpdated?: number;
}
export interface EmotionPodcast {
content: string;
period: 'week' | 'month';
generatedAt: number;
}