init: 初始化

This commit is contained in:
电摇小子
2025-12-15 16:01:25 +08:00
commit a967e17679
42 changed files with 7400 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
import { ElectronAPI } from '@electron-toolkit/preload'
import { Contact, Message } from '../shared/types'
declare global {
interface Window {
electron: ElectronAPI
api: {
initDb: (key: string) => Promise<boolean>
getContacts: (filter?: string) => Promise<Contact[]>
getMessages: (userMd5: string, startTime?: number, endTime?: number) => Promise<Message[]>
search: (keyword: string) => Promise<string | null>
aiChat: (
messages: { role: string; content: string }[],
options?: { apiKey?: string; model?: string }
) => Promise<{ success: boolean; data?: string; error?: string }>
copyImage: (base64String: string) => Promise<{ success: boolean; error?: string }>
}
}
}