Fixup type errors

This commit is contained in:
Eoghan Murray
2026-04-01 12:00:00 +08:00
parent 29d0d3a659
commit 58ee89dd36

View File

@@ -230,7 +230,7 @@ function initMouseInteractionObserver({
: sampling.mouseInteraction; : sampling.mouseInteraction;
const handlers: listenerHandler[] = []; const handlers: listenerHandler[] = [];
let currentPointerType = null; let currentPointerType: PointerTypes | null = null;
const getHandler = (eventKey: keyof typeof MouseInteractions) => { const getHandler = (eventKey: keyof typeof MouseInteractions) => {
return (event: MouseEvent | TouchEvent | PointerEvent) => { return (event: MouseEvent | TouchEvent | PointerEvent) => {
const target = getEventTarget(event) as Node; const target = getEventTarget(event) as Node;
@@ -241,7 +241,7 @@ function initMouseInteractionObserver({
let e = event; let e = event;
if ('pointerType' in e) { if ('pointerType' in e) {
Object.keys(PointerTypes).forEach( Object.keys(PointerTypes).forEach(
(pointerKey: keyof typeof PointerKeys) => { (pointerKey: keyof typeof PointerTypes) => {
if ((e as PointerEvent).pointerType === pointerKey.toLowerCase()) { if ((e as PointerEvent).pointerType === pointerKey.toLowerCase()) {
pointerType = PointerTypes[pointerKey]; pointerType = PointerTypes[pointerKey];
return; return;