From 90b550dc6c8390eb2f4e0e6e707f0dc9901a9280 Mon Sep 17 00:00:00 2001 From: Andreas Stassivik Date: Mon, 18 Nov 2024 15:06:19 -0800 Subject: [PATCH] `EventHandlerAsync` type extraction --- src/leaf/map/fullscreen/control/anchor/anchor.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/leaf/map/fullscreen/control/anchor/anchor.ts b/src/leaf/map/fullscreen/control/anchor/anchor.ts index 9b0ea81..50c701b 100644 --- a/src/leaf/map/fullscreen/control/anchor/anchor.ts +++ b/src/leaf/map/fullscreen/control/anchor/anchor.ts @@ -9,9 +9,11 @@ export type ControlAnchorOptions = { export type ControlAnchorAssign = ( props: ControlAnchorAttributes, ) => HTMLElement + +type EventHandlerAsync = EventHandler export type ControlAnchor = { assign: ControlAnchorAssign - onClick: (handler: EventHandler) => void + onClick: (handler: EventHandlerAsync) => void } export function controlAnchor({ @@ -26,7 +28,7 @@ export function controlAnchor({ return { assign, - onClick(handler: EventHandler): void { + onClick(handler: EventHandlerAsync): void { domEventOn({ element, event: 'click', handler }) }, }