Fixup type errors

This commit is contained in:
Eoghan Murray
2023-04-12 12:10:04 +01:00
parent be856443dd
commit b00798099a

View File

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