refactor(core): CORE-17 type input events and own interaction lifetimes

This commit is contained in:
Harvey Zhao committed 2026-09-11 11:24:15 +08:00
1 parent 88aef830df
commit a842058136
72 files changed
+31156 -1219

No files matched your search

+16
View File
@@ -0,0 +1,16 @@
import type { GestureHost } from '../../packages/artplayer/src/input/gesture-types'
import type Artplayer from '../../packages/artplayer/types/artplayer'
import { gestureController } from '../../packages/artplayer/src/input/gesture-controller'
declare const art: Artplayer
declare const host: GestureHost
const gesture = gestureController(host)
gesture.start(host.template.$video, new TouchEvent('touchstart'))
gesture.move(new TouchEvent('touchmove'))
gesture.cancel()
// @ts-expect-error Gesture input requires touch coordinates and identifiers.
gesture.move(new MouseEvent('mousemove'))
art.on('document:touchcancel', (event) => {
const original: Event = event
return original
})