From e6cb27fc64e4e240590b50836e7eb8675d1bde19 Mon Sep 17 00:00:00 2001 From: Anton Lavrenov Date: Thu, 18 Jul 2024 13:48:45 -0500 Subject: [PATCH] better types, fix #1794 --- src/Node.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Node.ts b/src/Node.ts index a26ce37bb..98a2f1eeb 100644 --- a/src/Node.ts +++ b/src/Node.ts @@ -116,19 +116,19 @@ type NodeEventMap = GlobalEventHandlersEventMap & { [index: string]: any; }; -export interface KonvaEventObject { +export interface KonvaEventObject { type: string; target: Shape | Stage; evt: EventType; pointerId: number; - currentTarget: Node; + currentTarget: This; cancelBubble: boolean; child?: Node; } export type KonvaEventListener = ( this: This, - ev: KonvaEventObject + ev: KonvaEventObject ) => void; /** @@ -814,7 +814,7 @@ export abstract class Node { var targets = evt.target.findAncestors(selector, true, stopNode); for (var i = 0; i < targets.length; i++) { evt = Util.cloneObject(evt); - evt.currentTarget = targets[i]; + evt.currentTarget = targets[i] as any; handler.call(targets[i], evt as any); } });