// ============================================================ // 共享类型定义 —— 主进程 & 渲染进程通用 // ============================================================ /** 平台类型 */ export type Platform = 'win32' | 'darwin' | 'linux'; /** 窗口标识 */ export interface WindowIdentity { /** 窗口唯一 ID */ id: number; /** 窗口类型标识 */ type: 'main' | 'settings' | 'preview' | 'custom'; /** 窗口标题 */ title: string; } /** IPC 响应包装 */ export interface IpcResponse { success: boolean; data?: T; error?: string; } /** 主题模式 */ export type ThemeMode = 'light' | 'dark' | 'system'; /** 版本类型 */ export type Edition = 'enterprise' | 'personal'; /** 应用配置 */ export interface AppConfig { themeMode: ThemeMode; language: string; autoLaunch: boolean; minimizeToTray: boolean; } // ============================================================ // 更新相关类型 // ============================================================ // ============================================================ // 日志类型(从 logging.ts 重导出) // ============================================================ export type { LogLevel, LogCategory, LogErrorSnapshot, LogEntry } from './logging'; /** 更新检查请求参数 */ export interface UpdateCheckParams { platform: Platform; version: string; edition: Edition; channel?: 'stable' | 'beta' | 'alpha'; } /** 更新检查响应(API 返回的 data 字段) */ export interface UpdateCheckResult { /** 是否有可用更新 */ hasUpdate: boolean; /** 最新版本号 */ latestVersion: string; /** 安装包下载地址 */ downloadUrl: string; /** 安装包大小(字节) */ fileSize: number; /** SHA512 校验值 */ sha512: string; /** 更新日志(支持 Markdown) */ changelog: string; /** 发布日期 */ releaseDate: string; /** 是否强制更新 */ forceUpdate: boolean; /** 最低兼容版本(低于此版本必须强制更新) */ minimumVersion: string; /** Blockmap 文件下载地址(可选,用于增量更新) */ blockMapUrl?: string; /** Blockmap 文件大小(可选,>0 时客户端启用差分下载) */ blockMapSize?: number; }