init
This commit is contained in:
41
src/types/chat.ts
Normal file
41
src/types/chat.ts
Normal file
@@ -0,0 +1,41 @@
|
||||
// types/chat.ts
|
||||
// types/chat.ts (更新)
|
||||
export interface VoiceMessage {
|
||||
id: string;
|
||||
type: "voice";
|
||||
content: {
|
||||
duration: number;
|
||||
url?: string;
|
||||
localId?: string;
|
||||
blob?: Blob;
|
||||
waveform?: number[];
|
||||
// 新增上传相关字段
|
||||
fileId?: string;
|
||||
fileName?: string;
|
||||
serverUrl?: string;
|
||||
uploadStatus?: "uploading" | "success" | "error";
|
||||
uploadProgress?: number;
|
||||
};
|
||||
sender: "user" | "pet";
|
||||
timestamp: number;
|
||||
isPlaying?: boolean;
|
||||
translation?: string;
|
||||
translating?: boolean;
|
||||
}
|
||||
|
||||
export interface TextMessage {
|
||||
id: string;
|
||||
type: "text";
|
||||
content: string;
|
||||
sender: "user" | "pet";
|
||||
timestamp: number;
|
||||
}
|
||||
|
||||
export type ChatMessage = VoiceMessage | TextMessage;
|
||||
|
||||
export interface PetProfile {
|
||||
name: string;
|
||||
avatar: string;
|
||||
species: "dog" | "cat" | "bird" | "other";
|
||||
personality: string;
|
||||
}
|
||||
Reference in New Issue
Block a user