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

@@ -0,0 +1,19 @@
import type { GestureHost } from '../input/gesture-types'
import type { PointerRegistry } from '../input/pointer-types'
import { gestureController } from '../input/gesture-controller'
import { isMobile } from '../utils/compatibility'
export default function gestureInit(art: GestureHost, events: Pick<PointerRegistry, 'proxy'>): void {
if (!isMobile || art.option.isLive)
return
const { $video, $progress } = art.template
const gesture = gestureController(art)
const bind = (target: EventTarget) => {
events.proxy(target, 'touchstart', event => gesture.start(target, event as TouchEvent))
events.proxy(target, 'touchmove', event => gesture.move(event as TouchEvent))
events.proxy(target, 'touchcancel', gesture.cancel)
}
if (art.option.gesture)
bind($video)
bind($progress)
}