重构PWA状态管理

This commit is contained in:
jxxghp
2025-07-07 14:05:11 +08:00
parent 73d7eb65b8
commit 0cf3342449
8 changed files with 489 additions and 975 deletions

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

@@ -1,26 +0,0 @@
/**
* 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 {}