feat: rebuild portable auto-update flow

This commit is contained in:
Misaka
2026-03-20 21:20:28 +08:00
parent 5e50a8fbcf
commit 6ad9463e73
29 changed files with 2333 additions and 13 deletions

View File

@@ -22,6 +22,11 @@ import type {
import type { IpcResult } from '../main/ipc'
import type { LogLevel } from '../shared/ipc-channels'
import type { CleanerConfig } from '../main/types/config.schema'
import type {
DownloadReleaseRequest,
UpdateDialogCatalog,
UpdateStatus
} from '../main/types/update.types'
export interface ResolverAPI {
resolve: (input: ResolverInput) => Promise<IpcResult<ResolverResponse>>
@@ -120,6 +125,16 @@ export interface LoggerAPI {
log: (level: LogLevel, message: string, context?: Record<string, unknown>) => void
}
export interface UpdateAPI {
getStatus: () => Promise<IpcResult<UpdateStatus>>
checkNow: () => Promise<IpcResult<UpdateStatus>>
getCatalog: () => Promise<IpcResult<UpdateDialogCatalog>>
getChangelog: (release: DownloadReleaseRequest) => Promise<IpcResult<string>>
downloadRelease: (release: DownloadReleaseRequest) => Promise<IpcResult<UpdateStatus>>
installDownloaded: () => Promise<IpcResult<void>>
onStatusChanged: (callback: (data: UpdateStatus) => void) => () => void
}
export interface ProcessAPI {
versions: {
electron: string
@@ -146,6 +161,7 @@ declare global {
config: ConfigAPI
logger: LoggerAPI
report: ReportAPI
update: UpdateAPI
}
api: unknown
}