feat(types): 添加应用核心类型定义

- 定义 Model 模型类型
- 定义 Tool 工具类型
- 定义 ChatHistory 聊天记录类型
- 定义 Message 消息类型
- 定义 User 用户类型
- 定义 Settings 设置类型
- 定义 QuickAction 快捷操作类型
This commit is contained in:
gaoziman 2025-12-17 22:52:44 +08:00
parent 75e7c957aa
commit db418d0f0d

57
src/types/index.ts Normal file
View File

@ -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;
}