refactor(dash): [PKG-DASH-04] migrate strict TypeScript and compatible declarations

This commit is contained in:
Harvey Zhao committed 2026-09-12 05:18:47 +08:00
1 parent 7de04573b6
commit 6840544e0e
38 files changed
+1744 -102

No files matched your search

@@ -0,0 +1,12 @@
import Artplayer from 'artplayer'
import dashControl from 'artplayer-plugin-dash-control'
type OldOption = Parameters<typeof dashControl>[0]
type OldQuality = NonNullable<OldOption['quality']>
const options: OldOption = { quality: { control: true, getName: (level: object) => String(level) }, audio: { setting: true } }
const quality: OldQuality = { title: 'Quality', auto: 'Auto' }
const formatter: NonNullable<OldQuality['getName']> = value => String(value)
const art = new Artplayer({ container: '#player', url: 'video.mpd', plugins: [dashControl(options)] })
const plugin: { name: 'artplayerPluginDashControl', update: () => void } = dashControl({ quality })(art)
const done: void = plugin.update()
void [formatter, done]