From db418d0f0d228c8f4f519e7f26006055c0b29dbc Mon Sep 17 00:00:00 2001 From: gaoziman <2942894660@qq.com> Date: Wed, 17 Dec 2025 22:52:44 +0800 Subject: [PATCH] =?UTF-8?q?feat(types):=20=E6=B7=BB=E5=8A=A0=E5=BA=94?= =?UTF-8?q?=E7=94=A8=E6=A0=B8=E5=BF=83=E7=B1=BB=E5=9E=8B=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 定义 Model 模型类型 - 定义 Tool 工具类型 - 定义 ChatHistory 聊天记录类型 - 定义 Message 消息类型 - 定义 User 用户类型 - 定义 Settings 设置类型 - 定义 QuickAction 快捷操作类型 --- src/types/index.ts | 57 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 src/types/index.ts diff --git a/src/types/index.ts b/src/types/index.ts new file mode 100644 index 0000000..e5a3967 --- /dev/null +++ b/src/types/index.ts @@ -0,0 +1,57 @@ +// 模型类型 +export interface Model { + id: string; + name: string; + tag: string; +} + +// 工具类型 +export interface Tool { + id: string; + name: string; + icon: string; + enabled: boolean; +} + +// 聊天记录类型 +export interface ChatHistory { + id: string; + title: string; + createdAt: Date; + updatedAt: Date; +} + +// 消息类型 +export interface Message { + id: string; + role: 'user' | 'assistant'; + content: string; + timestamp: Date; +} + +// 用户类型 +export interface User { + id: string; + email: string; + name: string; + plan: 'free' | 'pro' | 'enterprise'; + avatar?: string; +} + +// 设置类型 +export interface Settings { + defaultModel: string; + theme: 'light' | 'dark' | 'system'; + language: string; + webSearchEnabled: boolean; + codeExecutionEnabled: boolean; + chatHistoryEnabled: boolean; +} + +// 快捷操作类型 +export interface QuickAction { + id: string; + label: string; + icon: string; + prompt?: string; +}