refactor(core): [CORE-20] type entry and converge initialization

This commit is contained in:
Harvey Zhao committed 2026-09-11 16:07:06 +08:00
1 parent ccf77c4ed2
commit ee895a558f
100 files changed
+33854 -839

No files matched your search

@@ -24,7 +24,8 @@ export interface ResumePromptHost extends ComponentHost, SubscriptionHost<Prompt
i18n: { get: (key: string) => string }
storage: PlaybackStorage
option: { id?: string, url: string }
seek: number
get seek(): undefined
set seek(value: number)
play: () => unknown
}
@@ -5,7 +5,7 @@ import { isClosing } from '../../lifecycle/instance'
export type PlaybackTimes = Record<string, number>
export interface PlaybackStorage {
get: (key: 'times') => PlaybackTimes | null | undefined
get: (key: 'times') => unknown
set: (key: 'times', value: PlaybackTimes) => void
del: (key: 'times') => void
}
@@ -19,7 +19,9 @@ export interface PlaybackRecordHost extends SubscriptionHost<{ 'video:timeupdate
}
export function readTimes(storage: PlaybackStorage): PlaybackTimes {
return storage.get('times') || {}
// Historical storage is unvalidated JSON. Keep its truthy fallback and localize
// the legacy record assumption to this consumer, rather than all Storage reads.
return (storage.get('times') || {}) as PlaybackTimes
}
export function installPlaybackRecords(art: PlaybackRecordHost): void {