-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
174 lines (150 loc) · 3.32 KB
/
types.ts
File metadata and controls
174 lines (150 loc) · 3.32 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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
export interface Post {
id: string;
title: string;
excerpt: string;
date: string;
category: string;
contentPath: string;
image?: string;
author?: {
name: string;
avatar: string;
username: string;
};
}
export interface Interest {
name: string;
icon: string; // 图标名称(lucide-react图标名)
color: string; // 颜色类名,如 'text-pink-600'
bg: string; // 背景色类名,如 'bg-pink-50 dark:bg-pink-900/20'
}
export interface Skill {
name: string;
level: number; // 0-100
desc: string;
}
export interface SkillCategory {
[key: string]: Skill[];
}
export interface Work {
title: string;
desc: string;
tags: string[];
}
export interface Music {
name: string;
subtitle: string;
url: string;
description: string;
}
export interface Contact {
type: string; // 'wechat' | 'qq' | 'github' | 'email' | 'twitter'
label: string;
value: string;
}
export interface Game {
name: string;
icon: string; // 图标链接
quote: string; // 描述
about?: string; // 关于
}
export interface AboutData {
intro?: string; // 简介文本
interests?: Interest[]; // 兴趣与技能
skills?: SkillCategory; // 专业能力(按分类)
skillCategoryLabels?: { [key: string]: string }; // 技能分类标签(可自定义)
works?: Work[]; // 我的作品
music?: Music; // 音乐
contacts?: Contact[]; // 联系方式
games?: Game[]; // 喜欢玩的游戏
}
export interface SiteSettings {
siteName?: string; // 网站名
siteIcon?: string; // 网站图标链接
siteDescription?: string; // 网站描述
}
export interface Profile {
name: string;
bio: string;
avatar: string;
socials: {
github?: string;
twitter?: string;
email?: string;
};
about?: AboutData; // 关于页面数据
siteSettings?: SiteSettings; // 站点设置
}
export interface GitHubConfig {
token: string;
owner: string;
repo: string;
branch: string;
}
export interface PublicConfig {
owner: string;
repo: string;
branch: string;
uniid?: UniIdConfig;
}
export interface FileChange {
path: string;
content: string;
}
export interface BinaryFileChange {
path: string;
contentBase64: string;
}
/** 文章内嵌入的文件块(与 data-zenfile div 属性对应) */
export interface ZenFileBlock {
uuid: string;
name: string;
caption?: string;
mime: string;
}
/** 编辑器内部未上传文件状态 */
export interface EditorFileState {
localId: string;
file: File;
previewUrl: string;
}
export interface AppState {
posts: Post[];
profile: Profile;
config: GitHubConfig | null;
}
export interface UniIdConfig {
authServer: string;
appId: string;
}
export interface UniIdUser {
id: string;
username?: string;
role?: string;
}
export interface AuthState {
isUniIdAuthed: boolean;
isWriterUnlocked: boolean;
uniIdToken: string | null;
uniIdUser: UniIdUser | null;
}
export type CommentStatus = 'pending' | 'approved' | 'rejected';
export interface CommentAuthor {
userId: string;
username: string;
}
export interface ZenCommentData {
postId: string;
content: string;
status: CommentStatus;
author: CommentAuthor;
parentCommentId: string | null;
rootCommentId: string | null;
depth: 0 | 1;
createdAt: number;
updatedAt: number;
}
export interface ZenCommentRecord {
id: string;
data: ZenCommentData;
}