feat: add Playwright browser download service and preload types

This commit is contained in:
Misaka_Company
2026-03-24 15:33:52 +08:00
parent 37eade6360
commit 32df3cea67
6 changed files with 372 additions and 2 deletions

View File

@@ -141,6 +141,21 @@ export interface UpdateAPI {
onStatusChanged: (callback: (data: UpdateStatus) => void) => () => void
}
export interface DownloadProgress {
percent: number // 0-100
downloadedBytes: number
totalBytes: number
currentFile: string
speed: number // bytes/s
eta?: number // seconds
}
export interface PlaywrightBrowserAPI {
download: () => Promise<IpcResult<void>>
cancel: () => Promise<IpcResult<void>>
onProgress: (callback: (data: DownloadProgress) => void) => () => void
}
export interface ProcessAPI {
versions: {
electron: string
@@ -168,6 +183,7 @@ declare global {
logger: LoggerAPI
report: ReportAPI
update: UpdateAPI
playwrightBrowser: PlaywrightBrowserAPI
}
api: unknown
}