refactor(mask): [PKG-MASK-04] migrate strict types and preserve public consumers

This commit is contained in:
Harvey Zhao committed 2026-09-14 00:05:14 +08:00
1 parent aba125262a
commit aca4bc1cd2
30 files changed
+1848 -72

No files matched your search

@@ -0,0 +1,21 @@
import type { MaskHost, MaskOptions } from './types'
import maskConfig from './config'
import MaskController from './controller'
export default function artplayerPluginDanmukuMask(option: MaskOptions = {}) {
return (art: MaskHost) => {
const { template: { $video, $danmuku } } = art
const controller = new MaskController(art, maskConfig(option), { $video, $danmuku })
async function startSegmentation() {
await controller.start()
}
function stopSegmentation() {
controller.stop()
}
return {
name: 'artplayerPluginDanmukuMask',
start: startSegmentation,
stop: stopSegmentation,
}
}
}