mirror of
https://github.com/DayuanJiang/next-ai-draw-io.git
synced 2026-09-03 10:00:22 +08:00
feat: add automatic update functionality for Electron app
Closes #613 - Add electron-updater for Windows NSIS and Linux AppImage auto-update - macOS and Linux DEB fall back to GitHub API check with download link - Add "Check for Updates" menu item with i18n (en, zh, ja, zh-Hant) - Fix Windows CI workflow to publish correct latest.yml after code signing - Add update toast notifications in renderer via sonner
This commit is contained in:
14
electron/electron.d.ts
vendored
14
electron/electron.d.ts
vendored
@@ -2,6 +2,14 @@
|
||||
* Type declarations for Electron API exposed via preload script
|
||||
*/
|
||||
|
||||
/** Update status data sent from main process */
|
||||
type UpdateStatusData =
|
||||
| { status: "available"; version: string }
|
||||
| { status: "available-manual"; version: string; url: string }
|
||||
| { status: "downloading"; percent: number }
|
||||
| { status: "downloaded" }
|
||||
| { status: "error"; message: string }
|
||||
|
||||
/** Configuration preset interface */
|
||||
interface ConfigPreset {
|
||||
id: string
|
||||
@@ -74,6 +82,12 @@ declare global {
|
||||
>
|
||||
/** Set user's preferred locale */
|
||||
setUserLocale: (locale: string) => Promise<SetUserLocaleResult>
|
||||
/** Listen for update status events from main process */
|
||||
onUpdateStatus: (
|
||||
callback: (data: UpdateStatusData) => void,
|
||||
) => () => void
|
||||
/** Start downloading the available update */
|
||||
startDownload: () => Promise<void>
|
||||
}
|
||||
|
||||
/** Settings window Electron API */
|
||||
|
||||
Reference in New Issue
Block a user