feat: 合并代码

This commit is contained in:
duanshuwen
2025-12-21 20:25:38 +08:00
parent 11702dc9d2
commit 7d6b07e092
56 changed files with 2533 additions and 379 deletions

79
global.d.ts vendored
View File

@@ -32,6 +32,10 @@ declare global {
params: [time: string]
return: void
}
[IPC_EVENTS.RENDERER_IS_READY]: {
params: []
return: void
}
[IPC_EVENTS.CUSTOM_EVENT]: {
params: [message: string]
return: void
@@ -49,11 +53,12 @@ declare global {
external: {
open: (url: string) => void
},
window: {
minimize: () => void,
maximize: () => void,
close: () => void
},
minimizeWindow: () => void,
maximizeWindow: () => void,
closeWindow: () => void,
onWindowMaximized: (callback: (isMaximized: boolean) => void) => void,
isWindowMaximized: () => Promise<boolean>,
viewIsReady: () => void
app: {
setFrameless: (route?: string) => void
},
@@ -69,10 +74,72 @@ declare global {
on: (event: 'tab-updated' | 'tab-created' | 'tab-closed' | 'tab-switched', handler: (payload: any) => void) => void
},
readFile: (filePath: string) => Promise<{success: boolean, data?: string, error?: string}>,
logToMain: (logLevel: string, message: string) => void,
logger: {
debug: (message: string, ...meta?: any[]) => void;
info: (message: string, ...meta?: any[]) => void;
warn: (message: string, ...meta?: any[]) => void;
error: (message: string, ...meta?: any[]) => void;
},
}
declare interface Window {
api: WindowApi;
}
type ThemeMode = 'dark' | 'light' | 'system';
// 弹窗类型定义
interface CreateDialogProps {
winId?: string;
title?: string;
content: string;
confirmText?: string;
cancelText?: string;
isModal?: boolean;
onConfirm?: () => void;
onCancel?: () => void;
}
interface CreateDialogueProps {
messages: DialogueMessageProps[];
providerName: string;
selectedModel: string;
messageId: number;
conversationId: number;
}
interface UniversalChunk {
isEnd: boolean;
result: string;
}
interface DialogueBackStream {
messageId: number;
data: UniversalChunk & { isError?: boolean };
}
interface DialogueMessageProps {
role: DialogueMessageRole;
content: string;
}
}
declare module "@store/*";
declare module "@service/*";
declare module "@utils/*";
declare module "@assets/images/*";
declare module "@constant/*";
declare module "@remixicon/vue";
declare module "vue-router";
declare module '@iconify/vue' {
import { DefineComponent } from 'vue'
export const Icon: DefineComponent<{
icon: string
width?: string | number
height?: string | number
color?: string
flip?: string
rotate?: number
}>
}