Implement PWA state management for improved iOS background persistence

Co-authored-by: jxxghp <jxxghp@163.com>
This commit is contained in:
Cursor Agent
2025-07-06 06:44:06 +00:00
parent a16dd497c4
commit 0e440955c8
7 changed files with 1417 additions and 2 deletions

26
src/types/pwa.d.ts vendored Normal file
View File

@@ -0,0 +1,26 @@
/**
* PWA相关的类型声明
*/
// 扩展Window接口
declare global {
interface Window {
pwaStateController?: import('@/utils/pwaStateManager').PWAStateController
orientation?: number
}
interface Navigator {
standalone?: boolean
setAppBadge?: (count: number) => Promise<void>
clearAppBadge?: () => Promise<void>
}
// 自定义事件类型
interface WindowEventMap {
'pwaStateRestored': CustomEvent<{
state: import('@/utils/pwaStateManager').PWAState
}>
}
}
export {}